Learn R Programming

idem (version 2.2)

imImpAll: Impute missing data

Description

Impute missing data for all the subjects or a small sample of the subjects

Usage

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

Arguments

data.all

Original dataset

fit.rst

A class IDEM.FIT results of linear regression. See imFitModel.

normal

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

n.imp

Number of complete datasets required

endponly

Logical variable indicating whether clinical outcomes not used in calculating the final clinical outcome will be imputed. The default is FALSE, indicating that all missing clinical outcomes will be imputed sequentially

deltas

Vector of imputation sensitivity parameters

update.progress

Parameter reserved for run idem in GUI mode

imputeNone

If TRUE, return subjects that do not need imputation

...

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

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 IDEM.IMP 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

parameters in ...

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
lst.var <- list(trt="TRT", surv="SURV", outcome=c("Y1","Y2"), y0=NULL,
                endp=c("Y2"), unitTime="days",
                trt.label = c("UC+SBT", "SAT+SBT"),
                cov=c("AGE"), endfml="Y2", duration=365, bounds=c(0,100));
rst.fit <- imFitModel(abc, lst.var);
rst.imp <- imImpAll(abc, rst.fit, deltas=c(-0.25,0,0.25),
                    normal=TRUE, chains = 2, iter = 2000, warmup = 1000);
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab