Methods: Survival Analysis, Kaplan-Meier, Cox Proportional Hazards
Language: R
This project applies survival analysis methods to a greenhouse experiment studying survival outcomes in newly germinated tree seedlings. The dataset includes three temperate Acer species exposed to different light and microbial treatments. The main goal is to evaluate whether species identity, light availability, and microbial community treatment are associated with differences in seedling survival.
How do species, light availability, and microbial filtrate treatment affect seedling survival over time?
More specifically, this project asks:
- Do survival curves differ across Acer species?
- Does light availability affect seedling survival?
- Do microbial filtrate treatments influence survival?
- After adjusting for species, light, and microbe treatment, which factors are associated with increased or decreased hazard of seedling death?
The data come from a greenhouse experiment involving three Acer species:
Acsa: Acer saccharumAcru: Acer rubrumAcne: Acer negundo
The experimental treatments include:
- Light treatment: low light and high light
- Microbial filtrate treatment: small filtrate, large filtrate, combined filtrate, and sterilized control
The outcome is time-to-event survival data, where seedlings are followed until either harvest, death, or the experiment ended.
The project uses the following survival analysis methods:
- Kaplan-Meier survival curves to estimate survival probabilities over time.
- Log-rank tests to compare survival distributions across groups.
- Cox proportional hazards regression to estimate the association between treatment variables and hazard of seedling death.
- Proportional hazards diagnostics using Schoenfeld residuals.
The script 00_libraries.R automatically installs and loads the required packages. These include:
- tidyverse
- survival
- survminer
- broom
- kableExtra
- janitor
- naniar
- skimr
No manual installation is required. Package versions are recorded using renv.
To reproduce the analysis, run the scripts in the following order:
source("scripts/00_libraries.R")
source("scripts/01_data_cleaning.R")
source("scripts/02_missingness_summary.R")
source("scripts/03_eda.R")
source("scripts/04_km_analysis.R")
source("scripts/05_cox_models.R")
source("scripts/06_model_diagnostics.R")
Running the scripts will generate cleaned datasets, summary tables, exploratory figures, Kaplan-Meier plots, Cox Model results, and diagnostic plots. Main outputs include:
- Cleaned analysis datasets used for survival modeling
- Exploratory data analysis figures showing survival patterns by species, light, and microbial treatment
- Kaplan-Meier survival curves comparing survival across all groups
- Log-rank test results comparing survival distributions across groups
- Cox proportional hazards model tables with hazard ratios,
$95/%$ confidence intervals, and p-values - Model comparison results for the main Cox model and exploratory AMF model
- Diagnostic plots for evaluating Cox model assumptions