Learn R Programming

idem (version 5.2)

imImpAll: Impute missing data

Description

Conduct imputation under benchmark assumptions or for sensitivity analysis for a given set of subjects using the model fitting results

Usage

imImpAll(
  fit.rst,
  data.all = NULL,
  deltas = 0,
  normal = TRUE,
  n.imp = 5,
  endponly = TRUE,
  update.progress = NULL,
  imputeNone = FALSE,
  ...,
  seed = NULL
)

Value

If imputeNone is TRUE, return a dataset with the original data for the subset of subjects who died at the end of the study or had no missing outcomes.

Otherwise, return a class IDEMIMP list with components

lst.var

List of parameters

complete

A dataset with the original data for the subset of subjects who died at the end of the study or had no missing outcomes and the n.imp imputed missing outcomes for subjects who need missing value imputation.

n.imp

Number of imputed complete datasets

deltas

Imputation sensitivity parameters

org.data

Original dataset

normal

Normal assumption for the imputation

stan.par

STAN options

Arguments

fit.rst

A class IDEMFIT results generated by imFitModel.

data.all

A dataframe containing subjects with missing data. The default value is NULL, in which case the function will impute missing data for subjects in the original dataset in the class IDEMFIT object fit.rst

deltas

Vector of imputation sensitivity parameters

normal

Logical variable indicating whether normality assumption should be made for the residuals

n.imp

Number of complete datasets required

endponly

Logical variable that indicates whether clinical outcomes not used in calculating the functional outcome are considered as missing and should be imputed. The default is FALSE, indicating that all missing clinical outcomes will be imputed sequentially

update.progress

Parameter reserved for run idem in GUI mode

imputeNone

If TRUE, no imputation will be conducted. The data from subjects that do not need imputation will be returned

...

options to call STAN sampling. These options include chains, iter, warmup, thin, algorithm. See rstan::sampling for details.

seed

Random seed

Examples

Run this code

if (FALSE) {
rst.abc <- imData(abc, trt="TRT", surv="SURV", outcome=c("Y1","Y2"),
                 y0=NULL, endfml="Y2",
                 trt.label = c("UC+SBT", "SAT+SBT"),
                 cov=c("AGE"), duration=365, bounds=c(0,100));
rst.fit  <- imFitModel(rst.abc);
rst.imp <- imImpAll(rst.fit, deltas=c(-0.25,0,0.25),
                    normal=TRUE, chains = 2, iter = 2000, warmup = 1000);}

Run the code above in your browser using DataLab