Learn R Programming

psc (version 1.2.0)

dataComb.flexsurvreg: Function for cleaning the data of a model with class 'flexsurvreg'

Description

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 flexsurvreg
dataComb(CFM, DC, id = NULL, trt = NULL)

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

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'