imImpSingle {idem} | R Documentation |
Impute missing data for MCMC convergence checking
Description
Call STAN model to impute missing data for an individual subject under benchmark assumption for MCMC convergence checking
Usage
imImpSingle(
dsub,
fit.rst,
normal = TRUE,
chains = 4,
iter = 5000,
warmup = 1000,
control = list(adapt_delta = 0.95),
...,
seed = NULL
)
Arguments
dsub |
original individual subject data |
fit.rst |
A class |
normal |
Logical variable indicating whether normality assumption should be made for the residuals |
chains |
STAN parameter. Number of Markov chainsm |
iter |
STAN parameter. Number of iterations |
warmup |
STAN parameter. Number of burnin. |
control |
STAN parameter. See |
... |
other options to call STAN sampling such as |
seed |
Random seed |
Value
NULL
if there is no missing data in dsub
Otherwise, return a class IDEMSINGLE
object that contains a list with
components
- dsub
original data of the subject
- rst.stan
A
stan.fit
class result returned fromrstan::sampling
- complete
A dataframe with complete data for the selected subject
Examples
im.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));
im.fit <- imFitModel(im.abc);
im.imp <- imImpSingle(abc[1,], im.fit, chains = 4, iter = 200, warmup = 100);