View source: R/multisurvival.h.R
multisurvival | R Documentation |
Function for Multivariable Survival Analysis using Cox-regression.
multisurvival(
data,
elapsedtime,
tint = FALSE,
dxdate,
fudate,
timetypedata = "ymd",
timetypeoutput = "months",
uselandmark = FALSE,
landmark = 3,
outcome,
outcomeLevel,
dod,
dooc,
awd,
awod,
analysistype = "overall",
explanatory,
contexpl,
multievent = FALSE,
hr = FALSE,
sty = "t1",
ph_cox = FALSE,
km = FALSE,
endplot = 60,
byplot = 12,
ci95 = FALSE,
risktable = FALSE,
censored = FALSE,
medianline = "none",
pplot = TRUE,
cutp = "12, 36, 60",
calculateRiskScore = FALSE,
numRiskGroups = "four",
plotRiskGroups = FALSE,
ac = FALSE,
adjexplanatory,
ac_method = "average",
showNomogram = FALSE,
use_stratify = FALSE,
stratvar
)
data |
The dataset to be analyzed, provided as a data frame. Must contain the variables specified in the options below. |
elapsedtime |
The numeric variable representing follow-up time until
the event or last observation. If |
tint |
If true, survival time will be calculated from |
dxdate |
Date of diagnosis. Required if |
fudate |
Follow-up date or date of last observation. Required if
|
timetypedata |
Specifies the format of the date variables in the input
data. This is critical if |
timetypeoutput |
The units in which survival time is reported in the output. Choose from days, weeks, months, or years. |
uselandmark |
If true, applies a landmark analysis starting at a specified time point. |
landmark |
The time point (in the units defined by
|
outcome |
The outcome variable. Typically indicates event status (e.g., death, recurrence). For survival analysis, this may be a factor or numeric event indicator. |
outcomeLevel |
The level of |
dod |
The level of |
dooc |
The level of |
awd |
The level of |
awod |
The level of |
analysistype |
Type of survival analysis: - overall: All-cause survival - cause: Cause-specific survival - compete: Competing risks analysis |
explanatory |
Categorical explanatory (predictor) variables included in the Cox model. |
contexpl |
Continuous explanatory (predictor) variables included in the Cox model. |
multievent |
If true, multiple event levels will be considered for
competing risks analysis. Requires specifying |
hr |
If true, generates a plot of hazard ratios for each explanatory variable in the Cox model. |
sty |
The style of the hazard ratio (forest) plot. "finalfit" or "survminer forestplot". |
ph_cox |
If true, tests the proportional hazards assumption for the Cox model. Use if you suspect violations of the PH assumption. |
km |
If true, produces a Kaplan-Meier survival plot. Useful for visualization of survival functions without covariate adjustment. |
endplot |
The maximum follow-up time (in units defined by
|
byplot |
The interval (in units defined by |
ci95 |
If true, displays 95\ estimates on plots. |
risktable |
If true, displays the number of subjects at risk at each time point below the survival plot. |
censored |
If true, marks censored observations (e.g., using tick marks) on the survival plot. |
medianline |
If true, displays a line indicating the median survival time on the survival plot. |
pplot |
If true, displays the p-value from the survival comparison test on the survival plot. |
cutp |
. |
calculateRiskScore |
If true, calculates a risk score from the Cox model coefficients for each individual. |
numRiskGroups |
Select the number of risk groups to create from the risk scores. The data will be divided into equal quantiles based on this selection. |
plotRiskGroups |
If true, stratifies individuals into risk groups based on their calculated risk scores and plots their survival curves. |
ac |
. |
adjexplanatory |
. |
ac_method |
Method for computing adjusted survival curves |
showNomogram |
. |
use_stratify |
If true, uses stratification to handle variables that violate the proportional hazards assumption. Stratification creates separate baseline hazard functions for different groups. |
stratvar |
Variables used for stratification. When proportional hazards are not met, stratification can adjust the model to better fit the data by allowing different baseline hazards. |
A results object containing:
results$todo | a html | ||||
results$text | a html | ||||
results$text2 | a html | ||||
results$plot | an image | ||||
results$plot3 | an image | ||||
results$cox_ph | a preformatted | ||||
results$plot8 | an image | ||||
results$plotKM | an image | ||||
results$risk_score_analysis | a preformatted | ||||
results$risk_score_analysis2 | a html | ||||
results$riskScoreTable | a table | ||||
results$riskScoreMetrics | a html | ||||
results$riskGroupPlot | an image | ||||
results$stratificationExplanation | a html | ||||
results$calculatedtime | an output | ||||
results$outcomeredefined | an output | ||||
results$addRiskScore | an output | ||||
results$addRiskGroup | an output | ||||
results$plot_adj | an image | ||||
results$mydataview_nomogram2 | a preformatted | ||||
results$mydataview_nomogram | a preformatted | ||||
results$plot_nomogram | an image | ||||
results$nomogram_display | a html | ||||
Tables can be converted to data frames with asDF
or as.data.frame
. For example:
results$riskScoreTable$asDF
as.data.frame(results$riskScoreTable)
# example will be added
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.