Function for Generating Summaries for Survival Analysis.
Usage
survival(
data,
elapsedtime,
tint = FALSE,
dxdate,
fudate,
explanatory,
outcome,
outcomeLevel,
dod,
dooc,
awd,
awod,
analysistype = "overall",
cutp = "12, 36, 60",
timetypedata = "ymd",
timetypeoutput = "months",
uselandmark = FALSE,
landmark = 3,
pw = FALSE,
padjustmethod = "holm",
ph_cox = FALSE,
sc = FALSE,
kmunicate = FALSE,
ce = FALSE,
ch = FALSE,
endplot = 60,
ybegin_plot = 0,
yend_plot = 1,
byplot = 12,
multievent = FALSE,
ci95 = FALSE,
risktable = FALSE,
censored = FALSE,
pplot = TRUE
)
Arguments
- data
The data as a data frame.
- elapsedtime
The time elapsed from the start of the study to the event or censoring.
- tint
If the time is in date format, select this option to calculate the survival time. The time will be calculated as the difference between the event date and the diagnosis date. If the follow-up date is available, the time will be calculated as the difference between the event date and the follow-up date.
- dxdate
The date of diagnosis. If the time is in date format, the time will be calculated as the difference between the event date and the diagnosis date.
- fudate
The date of follow-up. If the time is in date format, the time will be calculated as the difference between the event date and the follow-up date.
- explanatory
The explanatory variable that will be used to compare the survival times of different groups.
- outcome
The outcome variable that will be used to compare the survival times of different groups.
- outcomeLevel
The level of the outcome variable that will be used as the event level.
- dod
.
- dooc
.
- awd
.
- awod
.
- analysistype
.
- cutp
.
- timetypedata
select the time type in data
- timetypeoutput
select the time type in output
- uselandmark
.
- landmark
.
- pw
.
- padjustmethod
.
- ph_cox
.
- sc
.
- kmunicate
.
- ce
.
- ch
.
- endplot
.
- ybegin_plot
.
- yend_plot
.
- byplot
.
- multievent
.
- ci95
.
- risktable
.
- censored
.
- pplot
.
Value
A results object containing:
results$subtitle | a preformatted | ||||
results$todo | a html | ||||
results$medianSummary | a preformatted | ||||
results$medianTable | a table | ||||
results$coxSummary | a preformatted | ||||
results$coxTable | a table | ||||
results$tCoxtext2 | a html | ||||
results$cox_ph | a preformatted | ||||
results$plot8 | an image | ||||
results$survTableSummary | a preformatted | ||||
results$survTable | a table | ||||
results$pairwiseSummary | a preformatted | ||||
results$pairwiseTable | a table | ||||
results$plot | an image | ||||
results$plot2 | an image | ||||
results$plot3 | an image | ||||
results$plot6 | an image | ||||
results$calculatedtime | an output | ||||
results$outcomeredefined | an output |
Tables can be converted to data frames with asDF
or as.data.frame
. For example:
results$medianTable$asDF
as.data.frame(results$medianTable)