Function for cleaning the data of a model with class 'flexsurvreg'
Source:R/dataComb.flexsurvreg.R
dataComb.flexsurvreg.Rd
The purpose of this function is to prepare the dataset and the counter-factual model for estimation and is the first step pf the pscfit.R process. The output is a complete-case dataset where the data names match the variables used in the CFM.
Usage
# S3 method for class 'flexsurvreg'
dataComb(CFM, DC, id = NULL, trt = NULL, cfmOb = FALSE)
Arguments
- CFM
a model object supplied to pscfit
- DC
a dataset including covariates to match the CFM
- id
a vector specifiying whether a subset of the dataset should be selected. Defaults to 'NULL' e.g. all data points included
- trt
An optional additional vector denoting treatment allocations for multiple treatment comparisons. Defaults to 'NULL'
- cfmOb
used to specify if a CFM object is supplies as the counter factual model
Value
a list containing objects which specifiy the required exported components of the model and a cleaned data cohort. Attributes include
'model.type' specifying the class of model to be used as the CFM
'model_extract' sepcifying the model componets required for estimation
'cov' a cleaned dataset of covariates
'outcome' a cleaned dataset containing the outcomes