Learn R Programming

tipse (version 1.2)

impute_model: Model-based imputation from parametric distributions

Description

Impute data with Weibull or exponential distribution conditional on follow-up time

Usage

impute_model(
  dat,
  reason,
  impute,
  imputation_model = c("weibull", "exponential"),
  alpha,
  J,
  seed = NULL
)

Value

a list of data.frame from each imputation with imputed AVAL and EVENT, where original variables are kept as AVALo and EVENTo.

Arguments

dat

data.frame containing at least 5 columns: TRT01P (treatment arm as factor), AVAL (survival time), EVENT (event indicator), CNSRRS (censoring reason) and MAXAVAL (maximum potential survival time, duration between randomization to data cut-off)

reason

a string specifying the censoring reasons which require imputation. It must be one of the reasons from variable CNSRRS.

impute

a string specifying the treatment arm(s) which require imputation. It must be one of the arms from variable TRT01P, the first level of TRT01P is considered as the control arm.

imputation_model

a string specifying the parametric distribution used for imputation, can be "Weibull" or "exponential".

alpha

hazard inflation (if treatment arm is imputed) or deflation (if control arm is imputed) rate

J

numeric indicating number of imputations.

seed

Integer. Random seed for reproducibility.

Details

First fit model based on the data without dropout. And then impute the the survival outcome based on exponential or Weibull distribution for those who dropped out.