runPSM | R Documentation |
Run complete parametric survival analysis for multiple models with multiple distributions
runPSM(
data,
time_var,
event_var,
weight_var = "",
model.type = c("Separate", "Common shape", "Independent shape"),
distr = c("exp", "weibull", "gompertz", "lnorm", "llogis", "gengamma", "gamma", "genf"),
strata_var,
int_name,
ref_name
)
data |
A data frame containing individual patient data for the relevant time to event outcomes. |
time_var |
Name of time variable in 'data'. Variable must be numerical and >0. |
event_var |
Name of event variable in 'data'. Variable must be numerical and contain 1's to indicate an event and 0 to indicate a censor. |
weight_var |
Optional name of a variable in "data" containing case weights. |
model.type |
Character vector indicating the types of model formula provided. Permitted values are
Default is c("Separate", "Common shape", "Independent shape"). |
distr |
A vector string of distributions, see dist argument in
|
strata_var |
Name of stratification variable in "data". This is usually the treatment variable and must be categorical. Not required when model.type='One arm'. |
int_name |
Character to indicate the name of the treatment of interest, must be a level of the "strata_var" column in "data", used for labelling the parameters. |
ref_name |
Character to indicate the name of the reference treatment, must be a level of the "strata_var" column in "data", used for labelling the parameters. Not required when model.type='One arm'. |
Possible distributions include:
Exponential ('exp')
Weibull ('weibull')
Gompertz ('gompertz')
Log-normal ('lnorm')
Log-logistic ('llogis')
Generalized gamma ('gengamma')
Gamma ('gamma')
Generalised F ('genf')
For more details and examples see the package vignettes:
vignette("Fitting_models_in_R", package = "flexsurvPlus")
vignette("Bootstrap_models_in_R", package = "flexsurvPlus")
vignette("Model_theory", package = "flexsurvPlus")
A list containing 'models' (models fit using flexsurvreg), 'model_summary' (a tibble containing AIC, BIC and convergence information), 'parameters_vector' (a vector containing the coefficients of each flexsurv model), and 'config' (a list containing information on the function call).
'models' is a list of flexsurv objects for each distribution specified
'model_summary' is a tibble object containing the fitted model objects, the parameter
estimates (coef
), AIC
and BIC
from flexsurv objects.
'parameters_vector' is a vector which contains the coefficients for all of the flexsurv models specified. The column names are in the format 'modeltype.distribution.parameter.TreatmentName', for example, comshp.weibull.shape.Int refers to the shape parameter of the common shape weibull distribution for the intervention treatment and 'indshp.gengamma.mu.ref' refers to the mu parameter of the independent shape generalised gamma distribution for the reference treatment. Columns with 'TE' at the end are the treatment effect coefficients (applicable to the scale and shape parameters for independent shape models, applicable to the scale parameter only for the common shape model and not applicable for the separate or one-arm model).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.