Survival Analysis for Continuous Variable
survivalcont(
data,
elapsedtime,
tint = FALSE,
dxdate,
fudate,
contexpl,
outcome,
outcomeLevel,
dod,
dooc,
awd,
awod,
analysistype = "overall",
cutp = "12, 36, 60",
timetypedata = "ymd",
timetypeoutput = "months",
uselandmark = FALSE,
landmark = 3,
sc = FALSE,
kmunicate = FALSE,
ce = FALSE,
ch = FALSE,
endplot = 60,
ybegin_plot = 0,
yend_plot = 1,
byplot = 12,
findcut = FALSE,
multievent = FALSE,
ci95 = FALSE,
risktable = FALSE,
censored = FALSE
)
The data as a data frame.
The time-to-event or follow-up duration for each patient. Should be numeric and continuous, measured in consistent units (e.g., months or years). Can be calculated automatically from dates if using the date options below.
Enable this option if you want to calculate survival time from dates in your data. This is useful when you have separate columns for diagnosis date and follow-up date and want to calculate the time elapsed between them.
The date of diagnosis or study entry for each patient. Should be in a consistent date format (e.g., YYYY-MM-DD).
The date of last follow-up or event for each patient. Should be in a consistent date format (e.g., YYYY-MM-DD).
The continuous explanatory variable to be used in the analysis.
The outcome variable to be used in the analysis.
The level of the outcome variable that represents the event of interest.
.
.
.
Select the levels of the outcome variable that correspond to different event types in your data. For example, you might have separate levels for "Dead of Disease" and "Alive w Disease" in a survival analysis of cancer patients.
Select the type of survival analysis to perform. "Overall" survival analysis considers all events as equivalent, while "Cause Specific" analysis distinguishes between different event types. "Competing Risk" analysis accounts for competing risks that may prevent the event of interest from occurring.
Specify the cutpoints at which to divide the continuous explanatory variable into groups for survival analysis. Separate multiple cutpoints with commas (e.g., "12, 36, 60").
select the time type in data
select the time type in output
Enable this option to perform landmark survival analysis at a specified time point.
Specify the landmark time at which to evaluate survival probabilities in landmark analysis. This option is only available if you enable the "Use Landmark Time" option.
Enable this option to create a Kaplan-Meier survival plot for the continuous explanatory variable.
Enable this option to create a KMunicate-style survival plot for the continuous explanatory variable.
Enable this option to create a plot of cumulative events over time for the continuous explanatory variable.
Enable this option to create a plot of cumulative hazard over time for the continuous explanatory variable.
Specify the end time for the survival plots. This option determines the maximum time point to include in the plots.
Specify the starting value for the y-axis in the survival plots. This option allows you to customize the range of the y-axis.
Specify the ending value for the y-axis in the survival plots. This option allows you to customize the range of the y-axis.
Specify the time interval for the survival plots. This option determines the spacing of tick marks on the x-axis.
Enable this option to automatically find the optimal cut-off point for the continuous explanatory variable using the maximally selected rank statistic. This option is only available if you enable the "Survival Plot" option. The optimal cut-off point will be displayed on the survival plot as a vertical dashed line.
Enable this option if your data includes multiple event levels (e.g., different types of events or outcomes). This option is required for cause-specific and competing risk survival analyses.
Enable this option to display 95\ the survival estimates in the plots.
Enable this option to display a table of risk estimates for each group in the survival analysis.
Enable this option to display censored observations in the survival plots.
A results object containing:
results$todo | a html | ||||
results$coxSummary | a preformatted | ||||
results$coxTable | a table | ||||
results$tCoxtext2 | a html | ||||
results$rescutTable | a table | ||||
results$plot4 | an image | ||||
results$plot5 | an image | ||||
results$medianSummary | a preformatted | ||||
results$medianTable | a table | ||||
results$survTableSummary | a preformatted | ||||
results$survTable | a table | ||||
results$plot2 | an image | ||||
results$plot3 | an image | ||||
results$plot6 | an image | ||||
results$calculatedtime | an output | ||||
results$outcomeredefined | an output | ||||
results$calculatedcutoff | an output |
Tables can be converted to data frames with asDF
or as.data.frame
. For example:
results$coxTable$asDF
as.data.frame(results$coxTable)