Survival Associations
Time-to-event outcomes: Cox, competing risks, Kaplan-Meier, and the assumption nobody checks for you
Declaring a time-to-event outcome
Same function as chapter 07.1 — what changes is how you declare the outcome and what the coefficient means.
Wrap the time and event columns with surv(). Survival and plain outcomes cannot share one call, so run them separately.
Three families, three questions
Cox regression gives a coefficient on the log-hazard scale, with the event count recorded alongside. This is the rate of the event among those still at risk.
Fine–Gray competing risks gives a coefficient on the log-subdistribution-hazard scale. This is about the cumulative incidence of your event when a competing event can remove people from ever having it.
These two answer genuinely different questions and are not interchangeable. It is also why they never pool together: the family is part of what defines a poolable cell.
Kaplan–Meier is different again: one omnibus log-rank row per fit, with no effect estimate and no standard error. The statistic is the log-rank chi-square, and the per-group medians live in the group-summary artifact rather than in the results table.
Kaplan–Meier requires a categorical predictor. A raw score column errors. Build a tertile or quantile column first and pass that — there is no binning helper on this path.
data$samples$prs.tertile <- cut(data$scores$X.scaled[, 1],
breaks = quantile(data$scores$X.scaled[, 1], c(0, 1/3, 2/3, 1)),
labels = c("low", "mid", "high"), include.lowest = TRUE)What you get to plot
Survival results carry the curves with them: the observed curves, model-predicted curves, a risk table, and a per-group summary with medians and event counts.
Kaplan–Meier is the one analysis in PolyGenius with a required artifact — a KM result without its curve is not a result. That requirement is enforced when you ask for full artifacts.
Proportional hazards
PolyGenius does not test proportional hazards. There is no Schoenfeld residual check and no cox.zph anywhere in the package.
This is a capability boundary rather than an oversight, and it matters: proportional hazards has to hold within each cohort for a Cox coefficient to mean anything, and for any later pooled estimate to mean anything either.
If you want to check it, take the fitted models with output = "models" and test them yourself. A plot cannot do it for you, because plots never recompute.
Competing risks, honestly
A competing event changes the question when it is common enough to remove a meaningful share of people from ever experiencing your event. Death before dementia onset is the standard example.
The incremental test for a Fine–Gray model is a likelihood-ratio test on a weighted pseudo-likelihood, so treat its reference distribution as approximate.
Fine–Gray does not require an extra package — do not install one on this account.
Subgroups and comparisons
split.by and associate$compare() work here as they do for other families, with one gap: comparisons support Cox and Fine–Gray but not Kaplan–Meier. See 07.1 rather than a repeat here.
Pooling
Cox and Fine–Gray results pool across cohorts. Kaplan–Meier does not, and the reason is statistical rather than a missing feature: a log-rank omnibus has no coefficient-scale standard error, so there is nothing to weight. See chapter 07.5.