Description Usage Arguments Details Value Examples
View source: R/2b_parameter_estimation_survival_functions.R
########################################################################### Get the parameter values using the Kaplan-Meier survival analysis
1 2 3 4 5 6 7 | use_km_survival(
param_to_be_estimated,
dataset,
indep_var,
covariates,
timevar_survival
)
|
param_to_be_estimated |
parameter of interest |
dataset |
data set to be provided |
indep_var |
the independent variable (column name in data file) |
covariates |
list of covariates |
timevar_survival |
time variable for survival analysis, default is NA |
This function is for survival analysis using Kaplan Meier. This plots the cumulative survival function for each combination of covariate If the covariate is numeric, R takes it as different levels. The plot uses the returned list of survfit and extracts the time and the strata from summary of the fit (implemented in plot_return_survival_curve function)
the results of the regression analysis, fit results, summary and plot
1 2 3 4 5 6 7 8 | data_for_survival <- survival::aml
surv_estimated <- use_km_survival("status", data_for_survival, "x",
covariates = NA, "time")
data_for_survival <- survival::lung
surv_estimated <- use_km_survival("status", data_for_survival, "sex",
covariates = c("ph.ecog"), "time")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.