Assesses the proportional hazards assumption for survival data using a
Cox proportional hazards model and related tests.
Usage
test_ph(data, time, event, group, plot_theme = theme_easysurv())
Value
A list containing plots and test results related to the assessment
of the proportional hazards assumption.
cloglog_plot
A plot of the log cumulative hazard function. If the
lines are roughly parallel, this suggests that the proportional hazards
assumption holds."
coxph_model
The coefficients from the Cox proportional hazards
model. The exp(coef) column shows the hazard ratio.
survdiff
The results of the log-rank test for differences in
survival curves between groups. A p-value less than 0.05 suggests that
survival differences between groups are statistically significant.
coxph_test
The results of the proportional hazards assumption test.
A p-value less than 0.05 suggests that the proportional hazards assumption
may be violated.
schoenfeld_plot
A plot of the Schoenfeld residuals. A flat smoothed
line close to zero supports the proportional hazards assumption. A non-flat
smoothed line with a trend suggests the proportional hazards assumption is
violated.
Arguments
data
A data frame containing the survival data.
time
The name of the column in data containing the
time-to-event information.
event
The name of the column in data indicating whether the
event of interest occurred.
group
The name of the column in data defining the grouping
variable.