Atlas
statminds
Survival Analysis (Hazard-Rate Model)The underlying model family class (e.g. GLM, linear model, categorical matrix, log-linear).Parametric ReferenceStatistical methods that assume a specific probability distribution family (typically normal).12-stage workflow

Cox Proportional Hazards

The engine for Survival Discovery. This semi-parametric model audits the time-to-event trajectories of participants, revealing how predictors 'accelerate' or 'brake' the hazard of occurrence.

Model familySurvival Analysis (Hazard-Rate Model)
Hypothesistwo-tailed
AliasesCox PH Model · Time-to-Event Regression · Semi-Parametric Survival Model
G1
Hazard Mapping
Quantify the risk of an event occurring over time while adjusting for multiple baseline predictors.
G2
Censoring Forensics
Effectively utilize data from participants who completed the study without experiencing the event.
G3
Survival Advantage Audit
Identify specific factors that significantly prolong the time until a critical clinical milestone.
1

What is it?

Cox Proportional Hazards Regression models the time until an event occurs (e.g. survival, system failure), investigating the relative risk ratios (Hazard Ratios) of predictors while adjusting for covariates.

2

When to use it

  • Time-to-Event Outcome: Duration metrics containing censored individuals.
  • Proportional Risk: Hazards remain proportional over time intervals.
  • Hazard Ratios: Quantify treatment outcomes (HR < 1 means protective effect).
3

Core Idea

It models the hazard rate as h(t) = h0(t) * e^(beta * X). The baseline hazard h0(t) is left unspecified, making it a semi-parametric model. We visualize survival curves over time:

Treatment (HR < 1)Control
Interactive Sandbox

Cox Survival curves Live Laboratory

Adjust the Treatment group Hazard Ratio (HR) to see survival curve divergence.

Presets
Treatment Hazard Ratio (HR)0.50
Survival Probability space (Time axis X: 0 to 40; Probability Y: 0% to 100%)Treatment (green) vs Control (amber) curves
Risk Summary
MetricValue
Hazard Ratio (Treatment)0.50
Control Relative Risk1.00 (Reference)
Log-rank p-value< 0.001
Clinical Verdict
✅ Significant Survival Shift
The treatment significantly decreases risk of events, prolonging survival time.
The 12-Stage Precision Workflow
01Hazard Shift
Hypotheses
We test the null of zero hazard-rate influence against the discovery of a non-zero 'Acceleration' or 'Deceleration' of the event risk.
02Proportionality Mandate
Assumptions
The ultimate gatekeeper: ensuring the Hazard Ratio remains constant over the entire temporal window of the study.
03Schoenfeld Forensics
Diagnostics
Utilizing Schoenfeld Residuals to audit the Proportional Hazards assumption—hunting for any time-dependent predictor interactions.
04focus
Auditing the 'Time to Full Recovery' in FlowMotion practitioners vs. Controls, accounting for baseline severity and age.
05AFT Pivot
Alternatives
Knowing when to switch to Accelerated Failure Time (AFT) models if the PH assumption fails or if 'Time Ratios' are more meaningful.
06Informative Bias
Censoring
Checking if 'Dropouts' are random or related to the outcome—the 'Silent Bias' that can invalidate survival discovery.
07Hazard Ratio (HR)
Effect Size
Interpreting HR: e.g., HR = 0.5 indicates a 50% reduction in the risk of the event at any given timepoint compared to control.
08The Event Count
Sample Size
Calculating the N based on the number of expected 'Events,' not just total participants—the true currency of survival power.
09The Risk Narrative
Reporting
Reporting HRs with 95% CIs and providing Kaplan-Meier curves to visualize the divergence of survival trajectories.
10Survival Object Logic
Software
Executing 'coxph(Surv(time, status) ~ ...)' commands, ensuring the event-status variable is correctly encoded.
11focus
Identifying the 'Immortal Time Bias'—failing to account for the time it took for a participant to start a treatment.
12focus
Tracing the model back to Sir David Cox (1972) and the foundational evolution of semi-parametric clinical research.
01Hypothesis test logic

Hypotheses

Pragmatic null and alternative hypotheses defined in mathematical notation.

We ask not just 'is there a link?', but 'how much does Y change for every unit of X?'
Logic Core
Null · H₀

H₀: β₁ = 0 (covariate has no effect on hazard; HR = 1)

Alternative · Hₐ

Hₐ: β₁ ≠ 0 (covariate affects hazard; HR ≠ 1)

Why it matters two-tailed

For each covariate. Overall model test: H₀: all βⱼ = 0 (likelihood ratio test, Wald test, or score test). Coefficients are log-hazard ratios; exponentiate for hazard ratios (HR). HR > 1 indicates increased hazard (shorter survival), HR < 1 indicates decreased hazard (longer survival). The proportional hazards assumption means HR is constant over time.

02Model diagnostics

Assumptions

The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.

Linearity is a strong claim. Nature often curves; ensure your model does not force a straight line on a bent world.
Integrity Shield
7
Assumptions
4
Critical / High Severity
How to check
Quick
Schoenfeld residuals test (p > .05 indicates PH OK). Plot log-log survival curves by covariate groups; curves should be parallel. Visual inspection of scaled Schoenfeld residuals vs time (should be flat horizontal line).
Rigorous
Global Schoenfeld test and per-covariate tests. Fit time-interaction model (covariate × time) and test interaction term significance. Plot smoothed Schoenfeld residuals with confidence bands. Check for crossing survival curves in Kaplan-Meier plots by groups.
If violated
If Schoenfeld test p < .05: (1) BEST: Stratified Cox model (stratify by violating covariate if categorical, allows separate baseline hazards per stratum). (2) Time-varying coefficients (include covariate × time interaction). (3) Use extended Cox model with time-dependent covariates. (4) Split follow-up into periods with constant HR (piecewise Cox). (5) Consider parametric models (Weibull, log-logistic) that don't assume PH. (6) If violation is minor and clinical importance unclear, report sensitivity analysis.
How to check
Quick
Design review: assess censoring mechanism. Check if censoring rates differ by covariate levels (may indicate informative censoring). Compare baseline characteristics between censored and non-censored subjects.
Rigorous
Competing risks analysis if censoring due to alternative events. Test for association between covariates and censoring (fit Cox model with censoring as outcome). Sensitivity analysis: vary censoring assumptions and assess impact on results.
If violated
If censoring is informative: (1) Competing risks analysis (Fine-Gray model, cause-specific hazards). (2) Joint modeling of event and censoring processes. (3) Inverse probability of censoring weighting (IPCW). (4) Sensitivity analysis under different censoring scenarios (best/worst case). (5) If loss-to-follow-up is issue, conduct attrition analysis and report.
How to check
Quick
Martingale residuals plot: plot residuals from null model vs each continuous covariate; add lowess smooth. Should show linear relationship (straight line). Alternatively, categorize continuous predictor into quartiles and check for monotonic trend in hazard.
Rigorous
Fit model with restricted cubic splines and test for non-linearity (compare to linear model via likelihood ratio test). Plot predicted log-hazard vs continuous covariate. Check for influential covariate patterns.
If violated
If non-linearity detected: (1) Transform continuous covariate (log, sqrt, polynomial). (2) Include polynomial terms (X, X²). (3) Use restricted cubic splines (3-5 knots) to flexibly model relationship. (4) Categorize covariate into meaningful groups (but loses information). (5) Test nested models to confirm transformation improves fit.
How to check
Quick
Design review: check for repeated events (same subject multiple times), clustering (patients within hospitals), or matched pairs. Verify each subject contributes one observation unless recurrent events explicitly modeled.
Rigorous
Calculate intraclass correlation if clustering suspected. Check for within-subject correlation if recurrent events. Review data structure for repeated IDs.
If violated
If repeated events: (1) Andersen-Gill model (recurrent events with counting process). (2) Prentice-Williams-Peterson models (gap time, total time). (3) Frailty models (random effects for subjects). If clustered: (4) Marginal Cox with robust/sandwich SE clustered by site. (5) Frailty models with cluster random effects. If matched pairs: (6) Stratified Cox (stratify by matched set).
How to check
Quick
Correlation matrix: |r| > .80 indicates strong collinearity. Check if adding/removing covariates dramatically changes coefficient estimates (instability suggests multicollinearity).
Rigorous
Calculate variance inflation factors (VIF) for each covariate using auxiliary linear regressions. Examine condition indices and eigenvalues of covariate correlation matrix. Check tolerance values (1/VIF).
If violated
If VIF > 10: (1) Remove one covariate from highly correlated pair (choose based on theory). (2) Create composite score (e.g., comorbidity index instead of individual conditions). (3) Use ridge Cox regression (penalized likelihood). (4) Center continuous covariates if interactions cause collinearity. (5) Conduct sensitivity analysis varying which correlated covariate is included.
elastic net
How to check
Quick
Count total events (not total n). Calculate EPV = (number of events) / (number of covariates). EPV < 10 is problematic; EPV < 5 is severely underpowered and biased.
Rigorous
Simulation studies show EPV ≥ 10 needed to avoid bias in HR estimates and maintain nominal coverage of confidence intervals. EPV ≥ 20 recommended for stable estimates and adequate power.
If violated
If EPV < 10: (1) Reduce number of covariates (select based on prior research, clinical importance). (2) Use penalized Cox regression (Firth, ridge, lasso) to shrink estimates. (3) Increase follow-up time to accumulate more events if feasible. (4) Combine rare categories of categorical covariates. (5) Report wide confidence intervals reflecting uncertainty.
How to check
Quick
Deviance residuals: |residual| > 3 suspect. Check for extremely long or short survival times. Scatterplot of covariates to identify unusual combinations.
Rigorous
Calculate dfbeta (change in coefficient when observation deleted), Cook's distance analogue for Cox. Score residuals for detecting influential observations. Assess impact of extreme times via sensitivity analysis (exclude top/bottom 1% of times).
If violated
First verify data accuracy. If legitimate outliers: (1) Report results with/without outliers (sensitivity analysis). (2) Use robust standard errors. (3) Winsorize extreme survival times at pre-specified percentiles (e.g., 95th). (4) Check if outliers suggest model misspecification (e.g., non-PH, non-linearity). (5) Consider parametric models with heavy-tailed distributions. Never remove outliers just to achieve significance.
03Residual Forensics

Diagnostics

Checking residual plots and indices to examine model deviations and ensure standard error integrity.

Trust, but verify. The outliers often hold more truth than the averages.
System Health
Essential checks
  1. Schoenfeld residuals test for proportional hazards (global and per-covariate)
  2. Kaplan-Meier curves by covariate groups (check for crossing curves)
  3. Number of events and EPV (events per variable) calculation
  4. Overall model test (likelihood ratio, Wald, or score test)
  5. Martingale residuals plot for continuous covariates (check linearity)
Recommended checks
  1. Plot scaled Schoenfeld residuals vs time (should be flat)
  2. Log-log survival plots (parallel lines indicate PH)
  3. Deviance residuals to identify influential observations
  4. Score residuals for overall fit
  5. Concordance index (C-statistic) for discrimination
  6. Cumulative hazard plots (Nelson-Aalen)
  7. Check for outliers in covariate space
  8. Assess censoring patterns by covariate levels
  9. VIF for multicollinearity if multiple continuous covariates
04Live Instances

Applied Minds

Review concrete study examples, data layout guidelines, and copy executable syntax scripts.

Theory is the map. Practice is the terrain. Simulation bridges the gap.
Applied Wisdom
Example 01

Yoga Practice and Cardiovascular Event-Free Survival (Basic Cox Model)

Research question: Does regular yoga practice reduce risk of cardiovascular events (MI, stroke, cardiac death) in adults with hypertension? Design: Prospective cohort study (n=500) with 10-year follow-up. Outcome: Time to first CV event (months). Covariates: Yoga practice (yes/no), age, sex, baseline systolic BP.

DesignProspective cohort with right-censoring
Outcome ScaleTime to CV event (months)
# Cox Proportional Hazards Model: Yoga → CV Event-Free Survival
# Based on Chu et al. (2016) meta-analysis showing CV benefit

library(survival)    # For Cox models
library(survminer)   # For Kaplan-Meier and forest plots
library(ggplot2)

set.seed(2025)

# Simulate realistic survival data
n <- 500
age <- runif(n, 40, 80)
sex <- sample(c("M", "F"), n, replace=TRUE)
baseline_SBP <- rnorm(n, 150, 15)
yoga_practice <- sample(c("No", "Yes"), n, replace=TRUE, prob=c(0.6, 0.4))

# Simulate survival times (Weibull distribution)
# Yoga reduces hazard (HR ~ 0.65)
shape <- 1.5
scale <- exp(5 - 0.43*(yoga_practice=="Yes") + 0.03*age + 
             0.2*(sex=="M") + 0.015*baseline_SBP)
survival_time <- rweibull(n, shape=shape, scale=1/scale)

# Right censoring (administrative censoring at 10 years = 120 months)
censor_time <- runif(n, 60, 120)  # Variable follow-up
observed_time <- pmin(survival_time, censor_time)
event <- as.numeric(survival_time <= censor_time)

data <- data.frame(time=observed_time, event, yoga_practice, age, sex, baseline_SBP)

cat("=== Study Overview ===\n")
cat("Total n:", n, "\n")
cat("Events:", sum(event), "\n")
cat("Censored:", sum(1-event), "\n")
cat("Event rate:", round(mean(event)*100, 1), "%\n")
cat("Median follow-up:", round(median(observed_time), 1), "months\n\n")

# === STEP 1: Kaplan-Meier Survival Curves ===

# Overall survival
fit_km <- survfit(Surv(time, event) ~ 1, data=data)
print(fit_km)

# By yoga practice
fit_km_yoga <- survfit(Surv(time, event) ~ yoga_practice, data=data)
print(fit_km_yoga)

# Visualize Kaplan-Meier curves
ggsurvplot(fit_km_yoga, data=data,
           pval=TRUE, conf.int=TRUE,
           risk.table=TRUE,
           xlab="Time(months)", ylab="CV Event-Free Survival",
           title="Kaplan-Meier Curves by Yoga Practice",
           legend.labs=c("No Yoga", "Yoga Practice"),
           palette=c("#E69F00", "#56B4E9"),
           ggtheme=theme_classic())

# Log-rank test (univariate comparison)
logrank_test <- survdiff(Surv(time, event) ~ yoga_practice, data=data)
print(logrank_test)
cat("\nLog-rank test p-value:", 
    round(1 - pchisq(logrank_test$chisq, df=1), 4), "\n\n")

# === STEP 2: Fit Cox Proportional Hazards Model ===

cox_model <- coxph(Surv(time, event) ~ yoga_practice + age + sex + baseline_SBP,
                   data=data)

summary(cox_model)

# Extract key statistics
cat("\n=== Model Summary ===\n")
cat("Likelihood ratio test: p =", 
    summary(cox_model)$logtest["pvalue"], "\n")
cat("Concordance index(C-statistic):", 
    summary(cox_model)$concordance[1], "\n")

# Hazard ratios with 95% CI
hr_table <- summary(cox_model)$conf.int
cat("\n=== Hazard Ratios(95% CI) ===\n")
print(hr_table)

# Interpretation
cat("\n=== Interpretation ===\n")
cat("Yoga practice: HR =", round(hr_table["yoga_practiceYes", "exp(coef)"], 2),
    ", 95% CI [", round(hr_table["yoga_practiceYes", "lower .95"], 2), ",",
    round(hr_table["yoga_practiceYes", "upper .95"], 2), "]\n")
cat("Interpretation: Yoga practitioners have", 
    round((1 - hr_table["yoga_practiceYes", "exp(coef)"])*100, 0),
    "% lower hazard of CV events compared to non-practitioners\n\n")

# === STEP 3: Check Proportional Hazards Assumption ===

# Schoenfeld residuals test
ph_test <- cox.zph(cox_model)
print(ph_test)

cat("\n=== Proportional Hazards Test ===\n")
cat("If p > .05 for all covariates, PH assumption met\n")
cat("Global test p-value:", round(ph_test$table["GLOBAL", "p"], 3), "\n\n")

# Plot Schoenfeld residuals
par(mfrow=c(2,2))
for(i in 1:4) {
  plot(ph_test[i], main=names(coef(cox_model))[i])
  abline(h=0, col="red", lty=2)
}
par(mfrow=c(1,1))

# Alternative: Log-log survival plots (for categorical covariates)
plot(survfit(Surv(time, event) ~ yoga_practice, data=data),
     fun="cloglog", 
     col=c("red", "blue"),
     xlab="Log Time", ylab="Log(-Log(Survival))",
     main="Log-Log Plot(should be parallel)")
legend("topleft", legend=c("No Yoga", "Yoga"), col=c("red", "blue"), lty=1)

# === STEP 4: Check Linearity for Continuous Covariates ===

# Martingale residuals from null model
null_model <- coxph(Surv(time, event) ~ 1, data=data)
martingale_resid <- residuals(null_model, type="martingale")

# Plot for age
par(mfrow=c(1,2))
plot(data$age, martingale_resid, 
     xlab="Age", ylab="Martingale Residuals",
     main="Linearity Check: Age")
lines(lowess(data$age, martingale_resid), col="red", lwd=2)

# Plot for baseline SBP
plot(data$baseline_SBP, martingale_resid,
     xlab="Baseline SBP", ylab="Martingale Residuals",
     main="Linearity Check: Baseline SBP")
lines(lowess(data$baseline_SBP, martingale_resid), col="red", lwd=2)
par(mfrow=c(1,1))

# === STEP 5: Check for Influential Observations ===

# Deviance residuals
deviance_resid <- residuals(cox_model, type="deviance")
cat("\nOutliers(|deviance residual| > 3):", 
    sum(abs(deviance_resid) > 3), "\n")

par(mfrow=c(1,2))
plot(deviance_resid, ylab="Deviance Residuals",
     main="Deviance Residuals", pch=19, col="steelblue")
abline(h=c(-3, 0, 3), lty=c(2,1,2), col=c("red", "black", "red"))

plot(predict(cox_model), deviance_resid,
     xlab="Linear Predictor", ylab="Deviance Residuals",
     main="Residuals vs Fitted", pch=19, col="steelblue")
abline(h=0, col="red")
par(mfrow=c(1,1))

# === STEP 6: Predictions and Visualization ===

# Predicted survival curves for yoga vs no yoga (at mean age, 50% male, mean SBP)
new_data <- data.frame(
  yoga_practice = c("No", "Yes"),
  age = rep(mean(data$age), 2),
  sex = rep("M", 2),
  baseline_SBP = rep(mean(data$baseline_SBP), 2)
)

pred_surv <- survfit(cox_model, newdata=new_data)

# Plot predicted survival
ggsurvplot(pred_surv, data=new_data,
           conf.int=TRUE,
           legend.labs=c("No Yoga", "Yoga Practice"),
           xlab="Time(months)", 
           ylab="Predicted CV Event-Free Survival",
           title="Adjusted Survival Curves(Mean Age, Male, Mean SBP)",
           palette=c("#E69F00", "#56B4E9"),
           ggtheme=theme_classic())

# === STEP 7: Forest Plot ===

ggforest(cox_model, data=data,
         main="Hazard Ratios for CV Events",
         cpositions=c(0.02, 0.22, 0.4),
         fontsize=1.0)

# === APA-Style Reporting ===
cat("\n=== APA-Style Report ===\n")
cat("A Cox proportional hazards regression examined the association between\n")
cat("yoga practice and cardiovascular event-free survival in adults with\n")
cat("hypertension(n=500, 250 events over 10-year follow-up). Covariates\n")
cat("included age, sex, and baseline systolic blood pressure. The proportional\n")
cat("hazards assumption was met(Schoenfeld test, global p =", 
    round(ph_test$table["GLOBAL", "p"], 2), ").\n\n")
cat("Regular yoga practice was associated with significantly reduced hazard\n")
cat("of CV events(HR = 0.65, 95% CI [0.49, 0.87], p = .003), representing\n")
cat("a 35% risk reduction after adjusting for age, sex, and baseline BP.\n")
cat("Age(HR = 1.03 per year, p < .001) and male sex(HR = 1.22, p = .048)\n")
cat("were also significant predictors. The model demonstrated good discrimination\n")
cat("(C-statistic = 0.68). Findings support yoga as a protective factor for\n")
cat("cardiovascular health in hypertensive adults.\n")
Interpretation Blueprint

HR = 0.65 for yoga practice (p = .003, 95% CI [0.49, 0.87]): Yoga practitioners have 35% lower hazard of cardiovascular events compared to non-practitioners after adjusting for age, sex, and baseline BP. This translates to substantially longer event-free survival. The proportional hazards assumption was met (Schoenfeld test p > .05), validating constant HR over time. C-statistic = 0.68 indicates good discrimination. Results align with Chu et al. (2016) meta-analysis showing ~30% CV risk reduction with regular yoga practice. The dose-response relationship and mechanisms (BP reduction, autonomic balance, inflammation reduction) support causality.

05Tactical Pivots

Alternatives

Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.

When the path is blocked, pivot. Rigor is not rigidity; it is the intelligent adaptation to reality.
Adaptive Strategy
Measurement Precision Ladder Ideal · Time-to-Event + Binary Status
Ratio (Time)
Maintain Cox logic. Optimal for auditing 'When' an event occurs, not just 'If' it occurs.
Peak Signal
Binary (Status)
Ideal for Primary Clinical Milestones. Ensure 'Censoring' is not related to the treatment effect.
Standard Precision
Ordinal (Time)
Pivot to Discrete-Time Survival Models if time is measured in large, ranked blocks (e.g., years).
Precision Leak
Nominal
Abandon Cox. Use Logistic Regression if the temporal dimension is irrelevant to the discovery.
Information Suicide
Temporal Trajectory Audit Dynamic Hazard Trajectory
Survival Flow
Dynamic time-to-event.
Stay with Cox PH. The gold-standard for longitudinal risk forensics.
Recurrent Events
Multiple occurrences.
Pivot to Anderson-Gill or PWP models to account for internal subject history.
Competing Risks
Multiple event types.
Pivot to Fine-Gray Modeling to isolate the 'Primary' risk while neutralizing secondary threats.
Adaptive Technical Safeguards · adaptive safeguards
non proportional hazards
  • Time-Dependent Covariates — Model the variable's influence as it changes over the study window.
  • AFT Pivot — Use Accelerated Failure Time models to focus on 'Time Ratios' rather than 'Hazard Ratios'.
non linear hazards
  • Cox-GAM — Apply smoothing splines to the hazard predictors to capture 'Wiggly' risk paths.
  • Log-Transformation — Neutralize extreme baseline severity signals.
independence violated
  • Frailty Models — Incorporate random effects to account for clustering within clinics or sites.
06Adjusted Comparisons

Post-hoc

Group mean comparisons and correction controls (e.g. Tukey HSD, Bonferroni) to protect against Family-Wise Error Rates.

The omnibus test opens the door; post-hoc analysis explores the room.
Forensic Detail
Adjusted Comparisons

Post-hoc pairwise tests defined for this model.

Interpretation Guidelines

No specific guidelines provided.

07Standardized scale impact

Effect Size

Understanding effect sizes (e.g., Cohen's d, Partial Eta-Squared) and clinical impact benchmarks.

Significance is noise. Magnitude is the signal. Measure the impact, not just the probability.
Impact Magnitude

HR = 1.5 means 50% higher hazard (shorter survival). HR = 0.7 means 30% lower hazard (longer survival). HR = 1.0 means no effect. Report with 95% CI. HR is multiplicative: HR of 2.0 doubles the hazard at any time. Cohen's d approximation: d ≈ log(HR) × √3/π.

C-statistic (Harrell's C): discrimination ability. C = 0.5 (no discrimination), C = 1.0 (perfect). C > 0.7 considered adequate, C > 0.8 good discrimination. Similar to AUC for binary outcomes.

Difference in median survival times between groups. More interpretable than HR but requires that median is reached (50% event). Report with CI from Kaplan-Meier.

Recommended Metric: hazard_ratio with 95% CI (primary), concordance index (model-level discrimination)
Small
0.2
Medium
0.5
Large
0.8
0.50
hazard_ratio with 95% CI (primary), concordance index (model-level discrimination)
Recommended Measure
3
Available Metrics
ReportUse hazard_ratio with 95% CI (primary), concordance index (model-level discrimination) to represent clinical impact magnitude.
08Statistical Power

Sample Size

Guidelines for minimum sample requirements and power analysis parameters.

An underpowered study is an ethical failure. Respect the data by collecting enough of it.
Power Protocol
Floor Requirements

The 'Event Currency' Mandate: Statistical power is dictated by the total number of 'Events' (failures), not the total N. A minimum of 10-15 events per predictor is essential for model stabilization.

Effect SizeParametersRequired n
Small EffectHazard Ratio = 1.5 (Small)n ≈ 250 total events required
Medium EffectHazard Ratio = 2.0 (Medium)n ≈ 65 total events required
Large EffectHazard Ratio = 3.0 (Large)n ≈ 25 total events required
Key considerations

The 'Censoring Penalty': If your study window is too short, most participants will be 'Censored' (finish without an event), effectively zeroing out their contribution to the power. Recruit for events, not just for people.

G*Power StrategyBenchmark: Z-tests → Cox Proportional Hazards. Parameters: Hazard Ratio (HR), Event Rate = 0.5, α = .05, Power = .80. The 'Survival Shield': Power is a function of the HR magnitude and the probability of observing the event during the study.
09APA narrative blueprint

Reporting

How to compile statistical results into publication prose matching APA and journal style guides.

The Beta coefficient is the currency of change. Interpret it in real-world units, not just standardized abstractions.
Narrative Arc
Worked APA paragraph example
A Cox proportional hazards regression examined the association between regular yoga practice and cardiovascular event-free survival in adults with hypertension (n=500, 250 events over 10-year follow-up, 50% censoring). Covariates included age, sex, and baseline systolic blood pressure. The proportional hazards assumption was met (Schoenfeld test, global p = .18). The overall model was significant (likelihood ratio χ²(4) = 48.32, p < .001). Regular yoga practice significantly reduced CV event hazard (HR = 0.65, 95% CI [0.49, 0.87], p = .003), representing a 35% risk reduction after adjusting for age, sex, and baseline BP. Age (HR = 1.03 per year, 95% CI [1.02, 1.05], p < .001) and male sex (HR = 1.22, 95% CI [1.01, 1.48], p = .048) were also significant predictors. The model demonstrated adequate discrimination (C-statistic = 0.68). Median event-free survival was 87 months for yoga practitioners vs 62 months for non-practitioners (log-rank p = .002). Findings support yoga as a protective factor for cardiovascular health in hypertensive adults.
Reusable template

A Cox proportional hazards regression examined research question. The sample included n population description followed for duration. Outcome was time to event, with n events events and n censored censored observations (censoring rate%). Covariates included list with measurement scales. The proportional hazards assumption was assessed using Schoenfeld residuals test / log-log plots; assumption met/violated; if violated, describe remedy. The overall model was significant likelihood ratio test χ²(df) = X.XX, p < .XXX. For each covariate: Covariate name was positively/negatively associated with event hazard (HR = X.XX, 95% CI X.XX, X.XX, p = .XXX), substantive interpretation. The model demonstrated adequate/good discrimination (C-statistic = X.XX). Conclude with implications and limitations.

Essential statistics to report
  • Sample size, number of events, censoring rate
  • Follow-up duration (median or range)
  • Hazard ratios with 95% CI for each covariate
  • p-values for each covariate
  • Overall model test (likelihood ratio, Wald, or score)
  • C-statistic (concordance index)
  • Statement about proportional hazards assumption
  • Median survival times by groups (if estimable)
10Exhibit Builder

Manuscript Lab

Copy standard summary tables and forensic reporting grids to outline analysis details.

Table 1: Cox Proportional Hazards Model for Patient Survival
PredictorB (Coeff)SEWald zpHR (Hazard Ratio)95% CI (HR)
Age (>65)0.820.204.10< .0012.27[1.53, 3.36]
Therapy (New)-1.100.25-4.40< .0010.33[0.20, 0.54]
Stage (Advanced)1.450.304.83< .0014.26[2.37, 7.68]
Note. Event: Mortality. N = 450. PH Assumption verified via Schoenfeld residuals (p = .35).
Therapy HR = 0.33Superior Clinical Efficacy. The new treatment significantly delays the event (death) compared to standard care.
Stage HR = 4.26Identifies high-risk stratification. Advanced stage patients have over 4x the baseline hazard rate.
Header glossary

The Survival Multiplier. HR = 0.33 means the new therapy reduces the 'instantaneous risk' of death by 67% at any given time.

The Constant Risk rule. Assumes the HR remains stable across the entire study duration.

11Algorithmic Logic

Command Center

Syntax libraries and function parameters for executing calculations in stats packages.

Code your model to handle residuals. The errors tell you what your model missed.
Execution Engine
# 1. Fit Cox Model
model <- survival::coxph(Surv(time, event) ~ age + therapy + stage, data = df)
summary(model)

# 2. Visualize Hazards (Forest Plot)
survminer::ggforest(model, data = df)
Library stack
R
survivalsurvminer
Python
lifelines
Elite Forensic Strike

If the Proportional Hazards assumption fails, the HR is a lie. Always run the Schoenfeld test.

# Execute PH Assumption Audit
test_ph <- survival::cox.zph(model)
print(test_ph)

# Visualize PH Violations
survminer::ggcoxzph(test_ph)
12The Over-adjustment Trap

Common Mistakes

Analytical caveats and corrections to maintain modeling integrity.

Wisdom is learning from the failures of others. Anticipate the error before it occurs.
Defensive Logic
Why it's wrong
Hazard ratio is instantaneous risk ratio (rate of events at time t given survival to t), not cumulative odds or risk. HR = 2.0 means double the hazard rate, not double the probability of event by end of study. HR can exceed any value (not bounded by 0-1 like probabilities), and interpretation depends on constant hazard assumption.
The correction
Interpret HR as multiplicative effect on hazard rate: 'HR = 1.5 means 50% higher hazard at any given time'. For absolute risk, report survival probabilities at specific timepoints from Kaplan-Meier or predicted survival curves, not HR.
Why it's wrong
When proportional hazards assumption is violated, HR is not constant over time—single HR averages time-varying effect and can be misleading. For example, treatment may be protective early but not late (or vice versa). Standard Cox inference is invalid (biased estimates, incorrect SEs, poor coverage).
The correction
If Schoenfeld test p < .05: (1) Use stratified Cox (stratify by violating covariate), (2) Add time interactions to estimate time-varying HR, (3) Use extended Cox with time-dependent covariates, or (4) Consider parametric models. Report which covariate(s) violate PH and chosen remedy.
Why it's wrong
Cox regression power depends on number of EVENTS, not n. With n=500 but only 50 events (90% censoring), effective sample is 50 for estimating covariate effects. Low event count → low power, biased estimates, wide CIs. Common in studies with short follow-up or rare outcomes.
The correction
Report number of events prominently. Calculate EPV = events / covariates. If EPV < 10, reduce number of covariates, extend follow-up, or use penalized methods. Power analysis should be based on expected event count, not n.
Why it's wrong
Competing risks are events that prevent the outcome of interest (e.g., death from other cause prevents relapse). Treating as censoring assumes they are non-informative, but competing events alter risk set and can bias HR estimates. Standard Cox overestimates absolute risk when competing risks present.
The correction
Use competing risks methods: (1) Cause-specific Cox models (separate model per event type), or (2) Fine-Gray subdistribution hazards. Report cumulative incidence functions (CIF) instead of Kaplan-Meier (which assumes censoring). Specify which events are competing.
Why it's wrong
Cox assumes log-linear relationship between continuous covariate and log-hazard. Non-linearity (e.g., quadratic age effect) leads to misspecified model, biased HR, reduced power. Single HR for non-linear covariate averages relationship and misses important patterns.
The correction
Plot martingale residuals vs continuous covariates (should be linear). Test non-linearity by adding polynomial terms or splines and comparing nested models. If non-linear, transform covariate (log, sqrt), use splines, or categorize (but loses information).
Why it's wrong
Censored observations contribute information up to censoring time. Removing them wastes data, introduces bias (censored subjects may differ from non-censored), and invalidates survival analysis. Treating as non-events (event=0) implies they never experienced event, which is unknown and false.
The correction
Keep censored observations with appropriate event indicator (event=0 or 1). Cox regression properly accounts for censoring using partial likelihood. Report censoring rate and reasons. If informative censoring suspected, conduct sensitivity analysis or use methods for informative censoring.
Why it's wrong
Clustering violates independence assumption. Observations from same cluster (patient, hospital, family) are more similar than between clusters, deflating SEs and inflating Type I error. Standard Cox treats all observations as independent, leading to anti-conservative tests.
The correction
Use frailty models (random effects for clusters), marginal Cox with robust/sandwich SEs clustered by site, or stratified Cox (stratify by cluster if fixed effects). Report ICC if clustering present. Never ignore known clustering structure.
Why it's wrong
C-statistic (concordance) measures discrimination (rank ordering) but not calibration or clinical impact. C = 0.70 may be 'adequate' statistically but insufficient for clinical decision-making if miscalibrated or if decision threshold matters more than ranking. C-statistic insensitive to risk recalibration.
The correction
Report C-statistic for discrimination but also assess calibration (observed vs predicted survival), decision curve analysis for clinical utility, and predicted survival curves. Consider clinical context: C = 0.75 may be excellent for some applications, inadequate for others.
13Academic Lineage

References

Scholarly lineage and citation keys grounding the statistical framework.

We stand on the shoulders of giants. Honor the source of the method.
Academic Lineage
[1]
Cox, D. R. (1972). Regression models and life-tables. Journal of the Royal Statistical Society: Series B, 34(2), 187-202.
Seminal paper introducing Cox proportional hazards model. Foundation of modern survival analysis.
doi: 10.1111/j.2517-6161.1972.tb00899.x
[2]
Schoenfeld, D. (1982). Partial residuals for the proportional hazards regression model. Biometrika, 69(1), 239-241.
Introduced Schoenfeld residuals for testing proportional hazards assumption. Essential diagnostic tool.
doi: 10.1093/biomet/69.1.239
[3]
Grambsch, P. M., & Therneau, T. M. (1994). Proportional hazards tests and diagnostics based on weighted residuals. Biometrika, 81(3), 515-526.
Comprehensive treatment of Schoenfeld residuals test and diagnostics for Cox models.
doi: 10.1093/biomet/81.3.515
[4]
Fine, J. P., & Gray, R. J. (1999). A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association, 94(446), 496-509.
Introduced Fine-Gray model for competing risks. Alternative to cause-specific Cox models.
doi: 10.1080/01621459.1999.10474144
[5]
Harrell, F. E., Lee, K. L., & Mark, D. B. (1996). Multivariable prognostic models: Issues in developing models, evaluating assumptions and adequacy, and measuring and reducing errors. Statistics in Medicine, 15(4), 361-387.
Comprehensive guide to Cox model development, validation, and diagnostics including C-statistic.
doi: 10.1002/(SICI)1097-0258(19960229)15:4<361::AID-SIM168>3.0.CO;2-4
[6]
Vittinghoff, E., & McCulloch, C. E. (2007). Relaxing the rule of ten events per variable in logistic and Cox regression. American Journal of Epidemiology, 165(6), 710-718.
Simulation study on events per variable (EPV) rule. Recommends EPV ≥10-20 for reliable inference.
doi: 10.1093/aje/kwk052
[7]
Chu, P., Gotink, R. A., Yeh, G. Y., Goldie, S. J., & Hunink, M. G. (2016). The effectiveness of yoga in modifying risk factors for cardiovascular disease and metabolic syndrome: A systematic review and meta-analysis of randomized controlled trials. European Journal of Preventive Cardiology, 23(3), 291-307.
Meta-analysis showing yoga reduces CV risk (RR~0.71). Basis for Example 1.
doi: 10.1177/2047487314562741
In survival, time is not just a dimension; it is the outcome. Proportionality is the anchor of the model—if it breaks, your hazard ratio is a fiction.
The Interpretive Rigor Directive
statminds · CoxMind reference · v2.2 · updated 2026-01-1715 of 15 sections