Tutorials › Biostatistics › Building a Biostatistics Portfolio Project

Biostatistics Career Development

Building a Biostatistics Portfolio Project

A practical guide to designing a professional biostatistics portfolio project from research question through data preparation, statistical analysis, visualization, reproducible R programming, reporting, quality control, and interview presentation.

Intermediate 25 min read

What You'll Learn

  • How to choose a portfolio project that demonstrates real biostatistical skills
  • How to convert a clinical problem into a statistical question
  • How to create an analysis plan before programming
  • How to build a reproducible R analysis workflow
  • How to produce professional tables, figures, and statistical summaries
  • How to document, validate, and present your project to employers

Introduction

A strong biostatistics portfolio is more than a collection of statistical tests or attractive plots.

A professional portfolio project should demonstrate that you can take an analytical problem from question to conclusion.

That means showing that you can understand the scientific problem, define an estimand or analysis objective, prepare data appropriately, select a suitable statistical method, implement the analysis, check assumptions, interpret the results, and communicate the findings.

For someone hiring a biostatistician, this workflow is often more informative than a list of software packages on a résumé.

Key idea: The goal of a portfolio project is not to prove that you know every statistical method. The goal is to demonstrate that you can perform a credible, reproducible, well-documented analysis and explain why you made each major analytical decision.

What Is a Biostatistics Portfolio Project?

A biostatistics portfolio project is a self-contained analysis that demonstrates your ability to solve a realistic biomedical, public-health, epidemiological, clinical-trial, or health-services research problem.

A complete project commonly contains:

  • A scientific research question
  • A description of the study population
  • A defined exposure, treatment, or predictor
  • One or more outcomes
  • A statistical analysis plan
  • Data preparation and quality checks
  • Statistical modeling
  • Tables and figures
  • Interpretation
  • Reproducible code
  • Documentation
  • A final report or presentation

The project may use public data, simulated data, or another dataset for which you have appropriate rights to use the information.

What Employers Are Actually Looking For

A portfolio project should demonstrate several dimensions of statistical competence.

Skill What the Project Should Demonstrate
Scientific thinking You understand the biomedical question being investigated.
Study design You understand population, exposure, outcome, and comparison groups.
Statistical reasoning You can justify the method rather than simply run a test.
Programming Your analysis is reproducible and organized.
Data management You can inspect, clean, derive, and validate analysis variables.
Visualization You can communicate results clearly.
Interpretation You understand effect estimates, uncertainty, and limitations.
Communication You can explain technical results to scientific and non-statistical audiences.

What Makes a Project Strong?

The strongest portfolio projects have a coherent narrative.

For example:

$$ \text{Clinical Question} \rightarrow \text{Study Design} \rightarrow \text{Data} \rightarrow \text{Analysis} \rightarrow \text{Results} \rightarrow \text{Interpretation} $$

A weak portfolio often looks like this:

$$ \text{Dataset} \rightarrow \text{Random Tests} \rightarrow \text{Lots of Plots} $$

The second approach may demonstrate programming ability, but it does not necessarily demonstrate biostatistical reasoning.

Portfolio principle: Start with the scientific question, not the statistical test.

Choosing a Portfolio Project

A useful project should be complex enough to demonstrate meaningful skills but small enough that you can finish it.

A practical project can often be completed around one primary research question and several secondary objectives.

Good Project Characteristics

  • Has a clear biomedical question
  • Uses a realistic dataset
  • Contains enough observations for meaningful analysis
  • Includes both descriptive and inferential analysis
  • Requires data preparation
  • Allows useful visualizations
  • Has identifiable limitations
  • Can be explained in five to ten minutes during an interview

Weak Project Characteristics

  • Only demonstrates a simple t-test
  • Contains dozens of unrelated statistical tests
  • Has no scientific question
  • Uses a dataset without understanding its structure
  • Contains copied code with little explanation
  • Reports p-values without effect estimates
  • Has no reproducibility documentation
  • Cannot be explained without reading the code

Possible Portfolio Project Topics

Clinical Trial Efficacy Analysis

Clinical Trials ADaM Concepts Survival Analysis R

Compare progression-free survival between treatment groups and evaluate baseline characteristics, tumor response, Kaplan-Meier curves, and a Cox proportional-hazards model.

Risk Factors for a Binary Clinical Outcome

Logistic Regression Confounding Clinical Epidemiology

Investigate whether a clinical exposure is associated with an adverse outcome after adjustment for clinically relevant covariates.

Longitudinal Biomarker Analysis

Repeated Measures Mixed Models Visualization

Evaluate how a laboratory biomarker changes over time and whether the trajectory differs between treatment groups.

Diagnostic Test Evaluation

ROC Sensitivity Specificity AUC

Evaluate the ability of a biomarker or diagnostic test to discriminate between patients with and without a clinically relevant condition.

Meta-Analysis

Evidence Synthesis Random Effects Heterogeneity

Combine published effect estimates, evaluate between-study heterogeneity, and investigate whether study characteristics explain differences in results.

A Recommended Portfolio Project

For a clinical biostatistics portfolio, one particularly useful project is a simulated randomized clinical trial analysis.

This type of project allows you to demonstrate concepts that appear frequently in clinical-trial work:

  • Baseline characteristics
  • Treatment-emergent adverse events
  • Continuous laboratory endpoints
  • Binary response endpoints
  • Time-to-event endpoints
  • Kaplan-Meier estimation
  • Cox regression
  • Odds ratios
  • Confidence intervals
  • Clinical interpretation
  • Tables and figures

The dataset does not need to be real patient data. A carefully designed simulated dataset can be an excellent way to demonstrate the complete workflow without creating privacy or data-access concerns.

Define the Research Question

Before opening R, write the research question in one sentence.

For example:

Primary question: Among adults enrolled in a simulated randomized clinical trial, does treatment A improve progression-free survival compared with treatment B?

That question immediately suggests the primary endpoint, treatment comparison, analysis population, and statistical framework.

Convert the Question Into an Analysis Framework

A useful framework is:

Component Example
Population Randomized patients who received study treatment
Intervention Treatment A
Comparator Treatment B
Primary endpoint Progression-free survival
Secondary endpoint Objective response
Safety endpoint Treatment-emergent adverse events
Primary analysis Kaplan-Meier and Cox proportional hazards model

Write an Analysis Plan Before Coding

A portfolio project becomes substantially more professional when the analysis plan is written before the statistical programming begins.

Your analysis plan does not need to be a 100-page Statistical Analysis Plan.

A two- to five-page document can be sufficient for a portfolio project.

Minimum Analysis Plan

  • Study objective
  • Analysis population
  • Baseline definition
  • Primary endpoint
  • Secondary endpoints
  • Covariates
  • Missing-data strategy
  • Statistical methods
  • Confidence interval convention
  • Significance level, if applicable
  • Sensitivity analyses
  • Planned figures and tables
Why write the plan first? It prevents the project from becoming a search for statistically significant results after seeing the data.

The Portfolio Project Workflow

1
Define the scientific problem. State what clinical question the project addresses.
2
Identify the data. Determine the source, structure, variables, and limitations.
3
Write the analysis plan. Specify the primary and secondary analyses before modeling.
4
Build the data pipeline. Import, clean, derive, and validate analysis variables.
5
Perform descriptive analysis. Understand the study population before fitting models.
6
Perform the primary analysis. Use the prespecified statistical method.
7
Perform secondary and sensitivity analyses. Assess robustness and clinically relevant subgroups.
8
Create tables and figures. Focus on clear scientific communication.
9
Validate the analysis. Check derivations, counts, models, and outputs.
10
Document and present. Make the project understandable to another statistician.

Design the Dataset

If public data are unavailable or unsuitable, simulation is an excellent alternative.

A clinical-trial portfolio dataset might contain:

Variable Description
USUBJID Unique subject identifier
TRT01P Planned treatment
AGE Age at baseline
SEX Sex
ECOG Baseline performance status
BIOMARKER Baseline biomarker value
RESP Objective response indicator
PFS Progression-free survival time
PFS_EVENT Progression or death indicator
AE_ANY Indicator for any treatment-emergent adverse event

Keep the Dataset Realistic

A simulated dataset should not be perfectly clean.

A realistic portfolio project can include:

  • Missing laboratory values
  • Unequal treatment-group sizes
  • Continuous and categorical variables
  • Different follow-up times
  • Censored survival observations
  • Occasional outliers
  • Imbalanced categories

However, simulated problems should be intentional and documented.

Example Project Dataset

Suppose the project contains 240 simulated randomized patients.

Characteristic Treatment A Treatment B
Patients 122 118
Median age 61 years 62 years
Female 47% 49%
ECOG 0 58% 55%
Baseline biomarker, mean 4.8 4.9

The numbers above are illustrative and should be described as simulated if used in the project.

Start With Data Inspection

Before performing any statistical test, inspect the dataset.

In R:

library(tidyverse)

dat <- read_csv("data/analysis_data.csv")

glimpse(dat)

summary(dat)

nrow(dat)

names(dat)

You should understand:

  • How many observations exist
  • How many variables exist
  • Variable types
  • Missingness
  • Unique treatment values
  • Potentially impossible values

Check Treatment Assignment

table(dat$TRT01P, useNA = "ifany")

prop.table(
  table(dat$TRT01P)
)

This basic check can identify unexpected treatment values or missing treatment assignments.

Check Continuous Variables

dat %>%
  summarise(
    n = n(),
    mean_age = mean(AGE, na.rm = TRUE),
    sd_age = sd(AGE, na.rm = TRUE),
    median_age = median(AGE, na.rm = TRUE),
    min_age = min(AGE, na.rm = TRUE),
    max_age = max(AGE, na.rm = TRUE)
  )

Do not assume that a variable is valid simply because R accepts it.

A value such as age = 250 is syntactically valid but clinically implausible for most adult clinical studies.

Define Analysis Populations

A portfolio project should explicitly define which patients are included in each analysis.

For example:

Population Definition
Safety population All randomized patients who received at least one dose
Intent-to-treat population All randomized patients analyzed according to assigned treatment
Efficacy population Patients meeting prespecified efficacy-analysis requirements

In a real clinical trial, these definitions should follow the protocol and statistical analysis plan. In a portfolio project, state your assumptions clearly.

Descriptive Statistics

The first statistical output should usually describe the study population.

For continuous variables, consider:

  • N
  • Mean
  • Standard deviation
  • Median
  • Minimum
  • Maximum
  • Selected percentiles where useful

For categorical variables, consider:

  • Count
  • Percentage
  • Missing category where appropriate

Do Not Turn Baseline Tables Into a Collection of P-Values

A common portfolio mistake is to compare every baseline variable using a p-value.

For a randomized trial, baseline tables are primarily descriptive.

The objective is to understand whether clinically important imbalances exist, not to test whether randomization "worked."

Better approach: Report clinically relevant baseline distributions and discuss meaningful differences rather than mechanically attaching a hypothesis test to every row.

Example Baseline Visualization

Figure 1. Example Treatment-Group Size
Illustrative distribution of patients across two simulated randomized treatment groups.

Define the Primary Endpoint

A portfolio project should have one clearly identified primary endpoint.

For a time-to-event project:

Primary endpoint: Progression-free survival, defined as the time from randomization to the first documented disease progression or death, whichever occurs first.

The exact definition depends on the scientific setting and should be stated explicitly.

Time-to-Event Analysis

Time-to-event data are different from ordinary continuous outcomes because some patients may not experience the event during follow-up.

Those observations are commonly treated as right censored.

A simple representation is:

$$ T_i=\min(T_i^*,C_i) $$

where \(T_i^*\) is the true event time and \(C_i\) is the censoring time.

The event indicator is:

$$ \delta_i= \begin{cases} 1,&T_i^*\le C_i\\ 0,&T_i^*>C_i \end{cases} $$

Kaplan-Meier Analysis

A portfolio project involving survival analysis should generally include a Kaplan-Meier curve.

library(survival)
library(survminer)

fit_km <- survfit(
  Surv(PFS, PFS_EVENT) ~ TRT01P,
  data = dat
)

ggsurvplot(
  fit_km,
  data = dat,
  risk.table = TRUE,
  conf.int = TRUE,
  xlab = "Time from Randomization",
  ylab = "Progression-Free Survival Probability"
)

What to Report From a Kaplan-Meier Analysis

Useful outputs include:

  • Number of patients analyzed
  • Number of events
  • Number censored
  • Median survival, if estimable
  • Confidence interval for the median
  • Survival probabilities at clinically meaningful time points
  • Between-group comparison

Do not report only the p-value.

Cox Proportional Hazards Model

The Cox model can estimate the relative instantaneous event rate associated with treatment.

$$ h(t|X)=h_0(t)\exp(\beta_1X_1+\cdots+\beta_pX_p) $$

For a binary treatment variable, the exponentiated treatment coefficient is often interpreted as a hazard ratio.

cox_fit <- coxph(
  Surv(PFS, PFS_EVENT) ~ TRT01P + AGE + ECOG,
  data = dat
)

summary(cox_fit)

Interpreting a Hazard Ratio

Suppose the estimated hazard ratio for Treatment A versus Treatment B is:

$$ HR=0.72 $$

A common interpretation is that the estimated instantaneous event hazard in the Treatment A group is approximately 28% lower than in the Treatment B group, assuming the proportional-hazards model and coding convention are appropriate.

The interpretation should always include the confidence interval.

Confidence Intervals Matter

Suppose:

$$ HR=0.72 \qquad 95\%\,CI=(0.55,\;0.94) $$

The interval communicates both the estimated effect and its uncertainty.

A portfolio project should demonstrate that you understand this distinction.

Interview tip: If someone asks you to interpret a hazard ratio, start with the direction, magnitude, and confidence interval. Do not simply say "the p-value is significant."

Check Model Assumptions

A professional project should demonstrate that you understand assumptions.

For a Cox model, one important assumption is proportional hazards.

ph_check <- cox.zph(cox_fit)

print(ph_check)

plot(ph_check)

If the assumption is questionable, discuss the issue and consider an appropriate alternative or sensitivity analysis.

Secondary Endpoint: Objective Response

Suppose objective response is binary:

  • Responder
  • Non-responder

The response rate can be calculated as:

$$ ORR= \frac{\text{Number of responders}} {\text{Number of evaluable patients}} \times100\% $$

For example, if 52 of 122 patients respond:

$$ ORR= \frac{52}{122}\times100 \approx42.6\% $$

Comparing Response Rates

A portfolio project can demonstrate estimation of risk differences, risk ratios, odds ratios, or model-based adjusted effects.

For example:

response_tab <- table(
  dat$TRT01P,
  dat$RESP
)

response_tab

prop.table(
  response_tab,
  margin = 1
)

Logistic Regression

If response is modeled as a binary endpoint, logistic regression is a natural method.

$$ \log\left( \frac{p}{1-p} \right) = \beta_0+\beta_1X_1+\cdots+\beta_pX_p $$
logit_fit <- glm(
  RESP ~ TRT01P + AGE + ECOG,
  data = dat,
  family = binomial()
)

summary(logit_fit)

exp(cbind(
  OR = coef(logit_fit),
  confint(logit_fit)
))

Why Adjust for Covariates?

Covariate adjustment can improve precision and account for clinically important prognostic factors.

Possible covariates include:

  • Age
  • Baseline disease severity
  • Performance status
  • Biomarker status
  • Prior treatment
  • Disease stage

The covariates should be selected using scientific reasoning and the analysis plan rather than simply choosing variables based on univariable p-values.

Missing Data

Missing data are one of the most important areas in which a portfolio project can demonstrate statistical maturity.

First quantify missingness.

missing_summary <- dat %>%
  summarise(
    across(
      everything(),
      ~sum(is.na(.))
    )
  )

missing_summary

Then ask:

  • Which variables are missing?
  • How much is missing?
  • Is missingness associated with treatment?
  • Is missingness associated with outcome?
  • Why might the data be missing?
  • Does the analysis require an explicit missing-data method?

Do Not Automatically Delete Missing Records

Complete-case analysis is sometimes appropriate, but it should not be treated as the universal solution.

A strong portfolio project should explain why its chosen missing-data approach is reasonable.

Better than saying "missing values were removed": Explain which observations were excluded, why they were excluded, how much information was lost, and whether the conclusions could be sensitive to the missing-data mechanism.

Visualization Is Part of the Analysis

A professional project should contain figures that answer specific questions.

Useful examples include:

  • Baseline distribution plots
  • Boxplots or violin plots
  • Response-rate plots
  • Kaplan-Meier curves
  • Forest plots
  • Longitudinal plots
  • Diagnostic plots
  • ROC curves

Avoid adding a figure simply because you know how to make it.

Example Response-Rate Visualization

Figure 2. Simulated Objective Response Rate
Illustrative response rates from a simulated randomized clinical trial.

Build a Forest Plot

A forest plot is an excellent portfolio figure because it demonstrates estimation, uncertainty, and subgroup interpretation.

A simplified treatment-effect representation is:

$$ \hat\theta \quad (95\%\,CI) $$

For example:

Subgroup Hazard Ratio 95% CI
Overall 0.72 0.55–0.94
Age <65 0.68 0.47–0.98
Age ≥65 0.78 0.54–1.14
ECOG 0 0.64 0.45–0.91
ECOG 1 0.82 0.58–1.17

These values are illustrative and should not be interpreted as evidence from a real clinical trial.

Do Not Overinterpret Subgroups

A subgroup confidence interval crossing one does not automatically prove that the treatment has no effect in that subgroup.

Similarly, apparent differences between subgroup estimates do not establish heterogeneity of treatment effect.

If you include subgroup analyses, discuss interaction testing and the limitations of multiple comparisons and reduced sample size.

Create a Statistical Analysis Dataset

A useful portfolio project separates raw or source data from analysis-ready data.

For example:

data/
├── raw/
│   └── trial_source.csv
│
└── analysis/
    └── analysis_dataset.csv

The analysis dataset should contain clearly defined variables that correspond to the statistical analyses.

Separate Data Preparation From Analysis

Avoid putting the entire project into one giant script.

A cleaner structure is:

R/
├── 01_import.R
├── 02_clean_data.R
├── 03_derive_variables.R
├── 04_descriptive_analysis.R
├── 05_primary_analysis.R
├── 06_secondary_analysis.R
├── 07_figures.R
└── 08_qc.R

This structure makes the project easier to review and maintain.

Use Functions for Repeated Tasks

Reusable functions demonstrate programming maturity.

summarize_continuous <- function(x){

  tibble(
    N = sum(!is.na(x)),
    Mean = mean(x, na.rm = TRUE),
    SD = sd(x, na.rm = TRUE),
    Median = median(x, na.rm = TRUE),
    Min = min(x, na.rm = TRUE),
    Max = max(x, na.rm = TRUE)
  )

}

The exact implementation is less important than demonstrating that you can recognize repeated analytical operations and make them reproducible.

Use a Project Configuration File

For larger projects, a configuration file can make assumptions explicit.

analysis_config <- list(

  alpha = 0.05,

  confidence_level = 0.95,

  primary_endpoint = "PFS",

  treatment_variable = "TRT01P",

  event_variable = "PFS_EVENT"

)

This prevents important assumptions from being scattered throughout multiple scripts.

Reproducibility Is a Portfolio Skill

Another statistician should ideally be able to clone your repository and reproduce your results.

A reproducible project should document:

  • Required software
  • Required R packages
  • Input data
  • Data preparation steps
  • Analysis scripts
  • Output locations
  • Software versions where relevant

Use a README

The README is often the first thing a recruiter, hiring manager, or statistician will see.

A strong README should answer:

  • What is the project?
  • What question does it answer?
  • What data were used?
  • What statistical methods were used?
  • What were the major findings?
  • How can the analysis be reproduced?

Example README Structure

# Clinical Trial Biostatistics Portfolio Project

## Objective

Evaluate whether Treatment A improves progression-free survival
compared with Treatment B.

## Data

Simulated randomized clinical-trial dataset.

## Methods

- Descriptive statistics
- Kaplan-Meier analysis
- Cox proportional hazards model
- Logistic regression
- Response-rate analysis
- Sensitivity analysis

## Results

Treatment A was associated with longer estimated progression-free
survival in the simulated dataset.

## Reproducibility

Run:

R/01_import.R
R/02_clean_data.R
R/03_derive_variables.R
R/04_descriptive_analysis.R
R/05_primary_analysis.R
R/06_secondary_analysis.R
R/07_figures.R
R/08_qc.R

Recommended GitHub Structure

biostatistics-portfolio/
│
├── README.md
│
├── data/
│   ├── raw/
│   └── analysis/
│
├── R/
│   ├── 01_import.R
│   ├── 02_clean_data.R
│   ├── 03_derive_variables.R
│   ├── 04_descriptive_analysis.R
│   ├── 05_primary_analysis.R
│   ├── 06_secondary_analysis.R
│   ├── 07_figures.R
│   └── 08_qc.R
│
├── output/
│   ├── tables/
│   └── figures/
│
├── report/
│   └── analysis_report.html
│
├── docs/
│   ├── analysis_plan.md
│   └── data_dictionary.md
│
└── renv/
    └── project_environment.lock

Create a Data Dictionary

A data dictionary makes your analysis easier to understand.

Variable Type Description Example
USUBJID Character Unique patient identifier SUBJ-001
TRT01P Categorical Planned treatment Treatment A
AGE Numeric Age in years at baseline 61
PFS Numeric Time to progression or death 14.3
PFS_EVENT Binary Event indicator 0 / 1

Document Derived Variables

Derived variables should be explicitly documented.

For example:

$$ PFS=\min(\text{Progression Time},\text{Death Time}) $$

and:

$$ PFS\_EVENT= I(\text{Progression or Death Occurred}) $$

A reviewer should not have to reverse-engineer your definitions from your R code.

Quality Control

Quality control is one of the easiest ways to make a portfolio project look more like professional biostatistical work.

Create independent checks for important results.

Verify the number of randomized patients.
Verify treatment-group counts.
Verify analysis-population counts.
Verify endpoint derivations.
Verify event and censoring counts.
Verify model estimates against the source output.
Verify table totals and percentages.
Verify figure labels and denominators.
Verify that reported values match the final analysis dataset.

Independent QC Example

Suppose your primary analysis reports 122 patients in Treatment A.

Do not simply trust the same programming code that created the table.

Create an independent check:

qc_n_treatment_a <- dat %>%
  filter(TRT01P == "Treatment A") %>%
  distinct(USUBJID) %>%
  nrow()

stopifnot(qc_n_treatment_a == 122)

The exact approach will depend on the project, but the principle is important: critical outputs should be independently verified.

Statistical QC vs. Programming QC

QC Type Question
Programming QC Did the code produce the intended output?
Statistical QC Is the method appropriate for the question?
Clinical QC Do the results make sense in the scientific context?
Output QC Are labels, units, denominators, and formatting correct?

Write the Results Like a Statistician

A portfolio report should distinguish between statistical output and scientific interpretation.

For example, instead of writing:

Weak: "The p-value was 0.03, so Treatment A was better."

write:

Stronger: "Treatment A was associated with a lower estimated hazard of progression or death than Treatment B. The estimated hazard ratio was 0.72 (95% CI: 0.55–0.94), corresponding to an estimated 28% lower instantaneous event hazard under the fitted Cox model."

Then discuss clinical relevance separately.

Separate Statistical Significance From Clinical Importance

Suppose a study estimates:

$$ HR=0.94 \qquad 95\%\,CI=(0.89,\;0.99) $$

The result may meet a conventional statistical criterion, but the magnitude of the estimated treatment effect may be modest.

Conversely, a large estimated effect with a very wide confidence interval may be statistically uncertain.

Portfolio principle: Always discuss the magnitude and precision of an effect, not just whether a p-value crosses 0.05.

Include Sensitivity Analyses

A single analysis can make a portfolio project look superficial.

A better project asks whether the primary conclusion is robust.

Possible sensitivity analyses include:

  • Alternative covariate adjustment
  • Alternative endpoint definitions
  • Complete-case versus imputation approaches
  • Alternative censoring assumptions
  • Different follow-up windows
  • Alternative model specifications

Example Sensitivity Analysis

Suppose the primary model adjusts for age and ECOG.

cox_primary <- coxph(
  Surv(PFS, PFS_EVENT) ~ TRT01P + AGE + ECOG,
  data = dat
)

cox_sensitivity <- coxph(
  Surv(PFS, PFS_EVENT) ~ TRT01P + AGE + ECOG + BIOMARKER,
  data = dat
)

The purpose is not to search for the model that gives the most favorable result.

The purpose is to evaluate whether the scientific conclusion depends strongly on reasonable analytical choices.

Do Not P-Hack Your Portfolio

A portfolio project is an opportunity to demonstrate statistical integrity.

Avoid:

  • Running dozens of tests until one is significant
  • Removing inconvenient observations without justification
  • Trying multiple endpoints and reporting only favorable ones
  • Changing the analysis after seeing results without disclosure
  • Presenting exploratory analyses as confirmatory findings

If an analysis was exploratory, label it as exploratory.

Document Exploratory Analyses

Exploratory analyses can be valuable.

For example, you might discover an interesting treatment-by-biomarker pattern.

You can present it as:

Exploratory finding: An exploratory treatment-by-biomarker interaction suggested possible heterogeneity of treatment effect. Because this analysis was not prespecified and the subgroup sample sizes were limited, the finding should be interpreted as hypothesis-generating rather than confirmatory.

Build a Professional Report

The final report can be structured similarly to a short statistical report.

Section Purpose
Executive Summary Explain the question, methods, major findings, and conclusion.
Background Provide scientific context.
Objectives State primary and secondary objectives.
Methods Describe data, populations, endpoints, and statistical methods.
Results Present tables, figures, estimates, and uncertainty.
Sensitivity Analyses Assess robustness.
Limitations Explain weaknesses and assumptions.
Conclusion State the evidence-supported interpretation.

Include a Statistical Methods Section

The methods section should answer:

  • What population was analyzed?
  • What was the primary endpoint?
  • How was it defined?
  • What statistical model was used?
  • Which covariates were included?
  • How was censoring handled?
  • How was missing data handled?
  • What confidence level was used?
  • Which software was used?

Make the Portfolio Project Visually Professional

Presentation matters because statistical output is ultimately a communication product.

Use:

  • Consistent fonts
  • Consistent decimal places
  • Meaningful figure titles
  • Readable axis labels
  • Clear legends
  • Units where appropriate
  • Confidence intervals
  • Denominators
  • Footnotes for abbreviations

Avoid:

  • Three-dimensional charts
  • Excessive decoration
  • Unreadable legends
  • Unnecessary colors
  • Plots without units
  • Tables containing unexplained abbreviations

Tables Should Be Reproducible Too

Do not manually type your final results into a Word document.

Instead, generate tables from the analysis dataset whenever possible.

Packages such as gt, gtsummary, or flextable can be useful depending on the desired output.

library(gtsummary)

table1 <- dat %>%
  select(
    TRT01P,
    AGE,
    SEX,
    ECOG,
    BIOMARKER
  ) %>%
  tbl_summary(
    by = TRT01P,
    statistic = list(
      all_continuous() ~ "{mean} ({sd})",
      all_categorical() ~ "{n} ({p}%)"
    )
  )

table1

Use Quarto or R Markdown

A reproducible report can combine narrative, code, tables, and figures.

For example, a Quarto document can contain:

---
title: "Clinical Trial Biostatistics Portfolio Project"
format: html
---

## Objective

Evaluate progression-free survival...

```{r}
fit <- survfit(
  Surv(PFS, PFS_EVENT) ~ TRT01P,
  data = dat
)
```

## Results

The Kaplan-Meier estimates showed...

This is particularly valuable because the report and analysis remain connected to the code.

Use Version Control

Git is an important professional skill for modern statistical programming.

Useful commands include:

git init

git add .

git commit -m "Initial analysis workflow"

git status

git log

You do not need a complicated Git workflow for a portfolio project.

The important principle is that changes should be traceable.

Do Not Upload Sensitive Data

Critical: Never publish identifiable patient-level clinical data to a public repository unless you have explicit authorization and an appropriate legal and ethical basis for doing so.

For portfolio work, simulated data or appropriately licensed public datasets are generally safer choices.

Consider Data Licensing

If you use public data, document:

  • Where the data came from
  • Whether registration is required
  • Whether redistribution is permitted
  • What license applies
  • What preprocessing you performed

If the original dataset cannot legally be redistributed, publish your analysis code and instructions for obtaining the data rather than uploading the data itself.

Build a Project Scorecard

5
Scientific question
5
Statistical reasoning
5
Programming
5
Communication

A simple internal scorecard can help identify weaknesses before you publish your project.

Dimension Question
Scientific Can I clearly explain why this analysis matters?
Statistical Can I explain why each method was selected?
Programming Can someone reproduce my results?
Visualization Do my figures communicate the findings?
QC Have I independently checked important results?
Communication Can I explain the project to a hiring manager?

Build the Project in Stages

1
Day 1–2: Define the scientific question and identify the dataset.
2
Day 3–4: Create the data dictionary and analysis plan.
3
Day 5–7: Build the data-cleaning and derivation pipeline.
4
Week 2: Perform descriptive and primary analyses.
5
Week 3: Add secondary and sensitivity analyses.
6
Week 4: Create final tables, figures, report, and QC checks.

Do Not Make the Project Too Large

One of the most common portfolio mistakes is trying to demonstrate every statistical method in one project.

A project containing:

  • ANOVA
  • ANCOVA
  • Logistic regression
  • Cox regression
  • Poisson regression
  • Mixed models
  • ROC analysis
  • Principal components analysis
  • Cluster analysis
  • Machine learning
  • Meta-analysis

may look impressive at first glance, but it can lack a coherent scientific story.

Better strategy: Build one excellent project around one scientific question. Then build a second project if you need to demonstrate another statistical domain.

One Project Can Demonstrate Many Skills

A well-designed clinical-trial project can demonstrate:

Figure 3. How One Portfolio Project Demonstrates Multiple Skills
Clinical Trial Portfolio Project Study Design Scientific reasoning Statistical Modeling Inference & estimation Programming R & reproducibility Communication Tables & figures

The strongest portfolio projects demonstrate multiple skills through one coherent scientific problem rather than unrelated statistical exercises.

What Should the Final Portfolio Contain?

Artifact Purpose
README Quick explanation of the project.
Analysis plan Documents the intended statistical approach.
Data dictionary Defines variables and derivations.
R scripts Demonstrates reproducible programming.
Tables Communicates descriptive and inferential results.
Figures Communicates important patterns visually.
Final report Connects methods, results, and conclusions.
QC script Demonstrates validation.
Session information Documents software environment.

Create a Portfolio Landing Page

If you have multiple projects, your portfolio can contain a simple landing page.

# Biostatistics Portfolio

## Featured Projects

### 1. Randomized Clinical Trial Analysis
Kaplan-Meier analysis, Cox regression,
objective response, safety summaries.

### 2. Diagnostic Test Accuracy
ROC curves, AUC, sensitivity,
specificity, predictive values.

### 3. Longitudinal Biomarker Analysis
Mixed-effects models and repeated-measures
visualization.

## Software

R | SAS | SQL | Git | Quarto

## Contact

Your Name

Tailor the Project to the Job

Different jobs value different skills.

Target Role Emphasize
Clinical Biostatistician Clinical trials, endpoints, survival, regulatory-style reporting
Statistical Programmer Data derivation, reproducibility, tables, listings, figures, programming QC
Epidemiologist Study design, confounding, regression, causal interpretation
Real-World Evidence Observational data, propensity methods, missing data, large datasets
Data Scientist Prediction, feature engineering, validation, machine learning

If You Want a Clinical-Trial Job

A portfolio project should ideally demonstrate familiarity with concepts such as:

  • Randomization
  • Analysis populations
  • Baseline characteristics
  • Primary and secondary endpoints
  • Estimands
  • Missing data
  • Adverse events
  • Time-to-event endpoints
  • Response endpoints
  • Confidence intervals
  • Multiplicity
  • Sensitivity analyses
  • Statistical programming
  • Tables, listings, and figures

If You Want to Demonstrate SAS

You can implement the same project in both R and SAS.

For example, the survival analysis could be implemented using SAS procedures such as:

proc lifetest data=analysis
    plots=survival(atrisk);

    time PFS*PFS_EVENT(0);

    strata TRT01P;

run;

proc phreg data=analysis;

    class TRT01P(ref="Treatment B");

    model PFS*PFS_EVENT(0)
        = TRT01P AGE ECOG;

run;

The value of doing this is not simply showing two software packages.

It demonstrates that you understand the underlying statistical analysis independently of the software implementation.

R vs. SAS in a Portfolio

Capability R SAS
Statistical modeling Excellent Excellent
Visualization Excellent Strong
Reproducible reporting Excellent Strong
Clinical-trial programming Strong Excellent
Open-source accessibility Excellent Limited
Hiring relevance Depends on organization Depends on organization

Do Not Claim Expertise You Have Not Demonstrated

A portfolio should be honest about your experience.

There is a meaningful difference between:

  • "Used Cox regression in a portfolio project"
  • "Experienced clinical-trial statistician specializing in survival analysis"

The first is precise and defensible.

The second implies professional experience that a portfolio project alone cannot establish.

How to Present the Project in an Interview

Prepare a five-minute version.

A useful structure is:

1
Problem: What clinical question were you trying to answer?
2
Data: What population and variables did you analyze?
3
Method: Why did you choose the statistical method?
4
Result: What was the estimated effect and uncertainty?
5
Limitation: What is one important weakness?
6
Lesson: What did you learn from the project?

Example Interview Explanation

Example: "I built a simulated randomized clinical-trial analysis to demonstrate an end-to-end biostatistical workflow. I defined progression-free survival as the primary endpoint, generated an analysis-ready dataset, performed descriptive analyses, estimated Kaplan-Meier curves, and fitted a Cox model adjusting for prespecified prognostic variables. I also evaluated objective response using logistic regression and performed sensitivity analyses. The main thing I wanted to demonstrate was not simply that I could run the models, but that I could connect the clinical question to the endpoint definition, statistical method, interpretation, and reproducible reporting."

Questions an Interviewer May Ask

Question What It Tests
Why did you choose this endpoint? Scientific reasoning
Why did you use Cox regression? Method selection
What does the hazard ratio mean? Statistical interpretation
What assumptions did your model make? Statistical maturity
How did you handle missing data? Data-analysis judgment
What would you do differently with real clinical data? Clinical-trial awareness
How did you validate your results? Programming/QC skills
What is the biggest limitation? Scientific judgment

Be Ready to Explain Every Variable

If your model contains:

Surv(PFS, PFS_EVENT) ~ TRT01P + AGE + ECOG + BIOMARKER

you should be able to explain:

  • Why treatment is included
  • Why age is included
  • Why ECOG is included
  • Why the biomarker is included
  • How each variable is coded
  • What happens if values are missing
  • What the treatment coefficient means

Never include a variable simply because a tutorial told you to.

Include Limitations

A project becomes more credible when you acknowledge its weaknesses.

For a simulated clinical-trial project, limitations might include:

  • The dataset is simulated rather than real clinical data.
  • Simulation assumptions may not reflect real-world disease behavior.
  • The sample size may be too small for reliable subgroup analyses.
  • The analysis does not reproduce every operational aspect of a real trial.
  • Missing-data assumptions are simplified.
  • The results should not be interpreted as clinical evidence.
Good statistical communication includes knowing what your analysis cannot establish.

What Not to Put in the Final Portfolio

  • Raw identifiable patient data
  • Unlicensed proprietary datasets
  • Screenshots of statistical software without interpretation
  • Hundreds of unfiltered exploratory plots
  • Output copied directly from software with no explanation
  • Unexplained p-values
  • Claims of clinical efficacy based solely on simulated data
  • Code that cannot be reproduced

A Professional Project Checklist

Clear scientific research question
Clearly defined analysis population
Primary endpoint identified
Analysis plan written before final analysis
Data dictionary included
Data preparation is reproducible
Primary statistical method is justified
Model assumptions evaluated
Effect estimates include confidence intervals
Missing data are addressed
Sensitivity analysis included where appropriate
Tables and figures are publication-quality
Independent QC performed
README explains how to reproduce the project
No sensitive or unauthorized data are published

Common Portfolio Mistakes

  1. Starting with a statistical test. A good project begins with a scientific question.
  2. Using too many methods. A coherent project is stronger than a statistical-method shopping list.
  3. Ignoring data preparation. Real biostatistical work involves substantial data understanding and derivation.
  4. Reporting only p-values. Effect estimates and confidence intervals are usually more informative.
  5. Ignoring assumptions. Every statistical method has conditions that should be considered.
  6. Hiding limitations. Acknowledging limitations demonstrates statistical maturity.
  7. Manual results. Important results should be generated reproducibly from the analysis dataset.
  8. No QC. A portfolio project should demonstrate that you know how to verify your work.
  9. Overly complicated GitHub repositories. Organization should make the analysis easier to understand, not harder.
  10. Publishing confidential data. Portfolio development should never compromise patient privacy or data rights.
  11. Unable to explain the model. If you cannot explain why a method was selected, reconsider including it.
  12. Overclaiming results. Simulated or exploratory analyses should never be presented as clinical evidence.

How to Make the Project Stand Out

The difference between an ordinary portfolio and an excellent one is often documentation and reasoning rather than statistical complexity.

Consider adding:

  • A prespecified analysis plan
  • A data dictionary
  • A reproducible Quarto report
  • Independent QC checks
  • Clear figure captions
  • A sensitivity analysis
  • A limitations section
  • A short executive summary
  • Session information
  • A clean Git history

Demonstrate Reproducibility

A particularly strong portfolio allows a reviewer to reproduce the project using a single command or a clearly documented sequence.

For example:

source("R/01_import.R")
source("R/02_clean_data.R")
source("R/03_derive_variables.R")
source("R/04_descriptive_analysis.R")
source("R/05_primary_analysis.R")
source("R/06_secondary_analysis.R")
source("R/07_figures.R")
source("R/08_qc.R")

For a more advanced project, consider using a workflow manager such as targets to formalize dependencies.

Document the Software Environment

Package versions can affect reproducibility.

The renv package can record the project's R environment.

install.packages("renv")

renv::init()

renv::snapshot()

Another user can then restore the documented package environment.

Think Like a Reviewer

Before publishing, pretend you are reviewing someone else's analysis.

Ask:

  • Can I understand the scientific question in one minute?
  • Can I identify the primary endpoint?
  • Can I reproduce the analysis?
  • Can I determine how variables were derived?
  • Can I tell which analyses were prespecified?
  • Can I distinguish exploratory results?
  • Can I understand the uncertainty around estimates?
  • Can I identify major limitations?

Portfolio Project Maturity Levels

Level Characteristics
Basic Dataset, descriptive statistics, simple plots, basic hypothesis test.
Intermediate Clear research question, regression model, confidence intervals, reproducible code.
Advanced Prespecified analysis plan, multiple endpoints, sensitivity analysis, QC, polished report.
Professional End-to-end workflow, rigorous documentation, independent validation, strong scientific interpretation, reproducible reporting.

A Suggested Capstone Project

If you want one project that demonstrates broad clinical-biostatistics competence, consider building the following:

Simulated Randomized Oncology Trial

Primary objective: Compare progression-free survival between two randomized treatment groups.

Secondary objectives: Compare objective response and selected safety outcomes and evaluate whether treatment effects remain similar after adjustment for baseline prognostic variables.

Core analyses:

  • Patient disposition
  • Baseline characteristics
  • Adverse-event summaries
  • Objective response rate
  • Kaplan-Meier analysis
  • Cox proportional hazards model
  • Logistic regression
  • Forest plot
  • Sensitivity analysis

Suggested Final Deliverables

Deliverable Recommended Format
Analysis plan PDF or Markdown
Data dictionary Markdown or HTML
Analysis code R scripts
Results HTML or PDF
Tables HTML, PDF, or RTF
Figures PNG/SVG/PDF
README Markdown
QC R script or documented validation report

How the Project Maps to a Résumé

Once completed, the project can become a concise résumé entry.

Example résumé entry: Clinical Trial Biostatistics Portfolio Project — Developed a reproducible R-based analysis of a simulated randomized clinical trial, including data derivation, baseline summaries, objective response analysis, Kaplan-Meier estimation, Cox proportional hazards modeling, sensitivity analyses, publication-quality figures, and independent QC checks.

Notice that this description focuses on what was actually done rather than claiming professional experience that the project does not establish.

How the Project Can Support an Interview

A strong project gives you concrete examples for common behavioral and technical interview questions.

Interview Topic Portfolio Evidence
Statistical judgment Method-selection rationale
Programming R analysis pipeline
Data management Cleaning and derivation scripts
QC Independent validation code
Communication Executive summary and figures
Clinical understanding Endpoint definitions and interpretation

Final Portfolio Audit

Before publishing the project, perform a final audit.

1
Read the README as if you have never seen the project.
2
Run the analysis from a clean R session.
3
Confirm that all expected outputs are generated.
4
Check every table against the underlying analysis data.
5
Check every figure for labels, units, denominators, and legends.
6
Confirm that all statistical interpretations match the models.
7
Remove unnecessary files and temporary outputs.
8
Confirm that no confidential or restricted data are included.
9
Ask another statistician to review the project if possible.

The Most Important Portfolio Principle

The most valuable portfolio project is not necessarily the one with the most advanced statistics.

It is the one that most convincingly demonstrates that you can think like a biostatistician.

That means understanding the question before analyzing the data, choosing methods for scientific reasons, quantifying uncertainty, validating your results, communicating limitations, and making the entire workflow reproducible.

Bottom line: A strong biostatistics portfolio project tells a complete analytical story: scientific question → study design → data → estimand/endpoint → statistical method → results → uncertainty → interpretation → limitations → reproducible code → validated outputs. One polished, coherent project can demonstrate more professional competence than a large collection of unrelated statistical exercises.

Summary Checklist

Area Essential Question
Scientific question What clinical or biomedical problem am I answering?
Population Who is included in the analysis?
Endpoint What exactly is being measured?
Analysis plan What methods were specified before examining final results?
Data Can I explain every important variable?
Model Why is this statistical method appropriate?
Assumptions Have I evaluated important model assumptions?
Uncertainty Have I reported confidence intervals or other measures of precision?
Missing data Have I explained how missing observations were handled?
QC Have important results been independently checked?
Reproducibility Can another analyst reproduce the results?
Communication Can I explain the project clearly in an interview?
Limitations Can I explain what the analysis does not establish?

References and Further Reading

Hernán, M.A., & Robins, J.M. (2020). Causal Inference: What If. Chapman & Hall/CRC.

Harrell, F.E. (2015). Regression Modeling Strategies. Springer.

Klein, J.P., & Moeschberger, M.L. (2003). Survival Analysis: Techniques for Censored and Truncated Data. Springer.

R Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing.

Wickham, H., Çetinkaya-Rundel, M., & Grolemund, G. R for Data Science. O'Reilly Media.