Title: | Inference in Randomized Controlled Trials with Death and Missingness |
---|---|
Description: | In randomized studies involving severely ill patients, functional outcomes are often unobserved due to missed clinic visits, premature withdrawal or death. It is well known that if these unobserved functional outcomes are not handled properly, biased treatment comparisons can be produced. In this package, we implement a procedure for comparing treatments that is based on the composite endpoint of both the functional outcome and survival. The procedure was proposed in Wang et al. (2016) <DOI:10.1111/biom.12594> and Wang et al. (2020) <DOI:10.18637/jss.v093.i12>. It considers missing data imputation with different sensitivity analysis strategies to handle the unobserved functional outcomes not due to death. |
Authors: | Chenguang Wang [aut, cre], Andrew Leroux [aut, cre], Elizabeth Colantuoni [aut], Daniel O Scharfstein [aut], Trustees of Columbia University [cph] (tools/make_cpp.R, R/stanmodels.R) |
Maintainer: | Chenguang Wang <[email protected]> |
License: | GPL (>= 3) |
Version: | 5.2 |
Built: | 2024-11-08 05:16:35 UTC |
Source: | https://github.com/olssol/idem |
This package contains the functions for drawing inference in randomized clinical trials with death and intermittent missingness.
Consider a two-arm randomized study. Let denote outcome measured at
time
and
denote a functional endpoint that is a function of
. Let
denote the survival time. Let
denote the
baseline covariates and
denote the treatment assignment.
If two subject were both alive at the end of the study, they are ranked based
on functional outcome . If at least one subject was dead at the end of
the study, they are ranked based on survival time
.
Treatment effect, is defined as the probability that the outcome
for a random individual randomized to treatment
is less than the
outcome of a random individual randomized to treatment
minus the
probability that the outcome for a random individual randomized to treatment
is greater than the outcome of a random individual randomized to treatment
.
In order to estimate in the presence of missing data, we need to
impute
for subjects alive at the end of the study with
missing
for some
.
The benchmark assumption we consider for the imputation is the complete case missing value (CCMV) restrictions. We then consider exponential tilting models for introducing sensitivity parameters for evaluating the robustness of the findings with regards to different missing data mechanism assumptions. The models are as follows:
where denotes the missingness patterns,
denotes the
completers and
denotes the sensitivity parameter for arm
.
This package provides a web-based GUI. See imShiny
for
details.
Wang C, Scharfstein DO, Colantuoni E, Girard T, Yan Y (2016). Inference in Randomized Trials with Death and Missingness. <DOI:10.1111/biom.12594>
Wang C, Colantuoni E, Leroux A, Scharfstein DO (2020). idem: An R Package for Inferences in Clinical Trials with Death and Missingness. <DOI:10.18637/jss.v093.i12>
The Awakening and Breathing Controlled (ABC) trial randomized critically ill patients receiving mechanical ventilation 1:1 within each study site to management with a paired sedation plus ventilator weaning protocol involving daily interruption of sedative through spontaneous awakening trials (SATs) and spontaneous breathing trials (SBTs) or sedation per usual care (UC) and SBTs.
The example dataset is from a single site substudy in ABC. The researchers assessed differences in cognitive, psychological and functional outcomes at 3 and 12 months after randomization.
A dataframe with 5 variables:
Age
Treatment assignment. 0: UC + SBT, 1: SAT + SBT
Survival days
Cognitive score at 12 months
Cognitive score at 3 months
T. D. Girard, J. P. Kress, B. D. Fuchs, J. W. W. Thomason, W. D. Schweickert, B. T. Pun, D. B. Taichman, J. G. Dunn, A. S. Pohlman, P. A. Kinniry, J. C. Jackson, A. E. Canonico, R. W. Light, A. K. Shintani, J. L. Thompson, S. M. Gordon, J. B. Hall, R. S. Dittus, G. R. Bernard, and E. W. Ely. Efficacy and safety of a paired sedation and ventilator weaning protocol for mechanically ventilated patients in intensive care (awakening and breathing controlled trial): a randomised controlled trial. Lancet, 371:126-134, 2008.
Create a class IDEMDATA
object for IDEM analysis
imData( data, trt = NULL, surv = NULL, outcome = NULL, endfml = NULL, y0 = NULL, cov = NULL, duration = 9999, bounds = NULL, trt.label = NULL, unitTime = "days", err.terminate = TRUE, ... )
imData( data, trt = NULL, surv = NULL, outcome = NULL, endfml = NULL, y0 = NULL, cov = NULL, duration = 9999, bounds = NULL, trt.label = NULL, unitTime = "days", err.terminate = TRUE, ... )
data |
Original dataset |
trt |
Variable name for the Control (0) and Intervention (1) treatment assignments in the dataset |
surv |
Variable name for the survival (time to event) variable in the dataset |
outcome |
Chronologically ordered vector of variable names for clinical outcomes in the dataset excluding baseline |
endfml |
|
y0 |
Variable name of the baseline clinical outcome |
cov |
Vector of variable names for the covariates used in the imputation procedure for missing clinical outcomes |
duration |
Length of the study. This is the time at which subjects' are assumed to be censored |
bounds |
Numeric vector of lower and upper bounds for subjects' imputed clinical outcomes |
trt.label |
label of the treatment arms |
unitTime |
Unit of time measurement for survival and function outcome time points |
err.terminate |
When there is error in the specification, the program should be stopped with an error message if err.terminate is true. Otherwise, the error message will be returned and the program will continue. |
... |
Additional specifications |
When there are errors in the specification, i.e. trt
is not a column
of data
, a class IDEMERROR
object will be returned. The
detailed errors can be checked by calling print
of the
IDEMERROR
object.
When the specifications are correct, a class IDEMDATA
list will be
returned. The list contains
Original dataset
List of the specifications
rst.data <- 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.data <- 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));
Fit linear imputation models to the observed data from complete survivors for each treatment arm at each time point
imFitModel(im.data)
imFitModel(im.data)
im.data |
A class |
A class IDEMFIT
list of modeling fitting results with the following items
Original class IDEMDATA
object
A list of modeling fitting results for each model with
results from function lm
model formula
model coefficients
residuals
bandwidth of residuals for kernel density estimation
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.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);
Conduct imputation under benchmark assumptions or for sensitivity analysis for a given set of subjects using the model fitting results
imImpAll( fit.rst, data.all = NULL, deltas = 0, normal = TRUE, n.imp = 5, endponly = TRUE, update.progress = NULL, imputeNone = FALSE, ..., seed = NULL )
imImpAll( fit.rst, data.all = NULL, deltas = 0, normal = TRUE, n.imp = 5, endponly = TRUE, update.progress = NULL, imputeNone = FALSE, ..., seed = NULL )
fit.rst |
A class |
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 |
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 |
update.progress |
Parameter reserved for run |
imputeNone |
If |
... |
options to call STAN sampling. These options include
|
seed |
Random seed |
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
List of parameters
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.
Number of imputed complete datasets
Imputation sensitivity parameters
Original dataset
Normal assumption for the imputation
STAN options
## Not run: 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); ## End(Not run)
## Not run: 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); ## End(Not run)
Conduct imputation using the NARFCS model implemented in the mice
package
imImpAll_mice( im.data, deltas = 0, n.imp = 5, endponly = TRUE, seed = NULL, ... )
imImpAll_mice( im.data, deltas = 0, n.imp = 5, endponly = TRUE, seed = NULL, ... )
im.data |
A class |
deltas |
Vector of imputation sensitivity parameters |
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 |
seed |
Random seed |
... |
Parameters for |
A class IDEMIMP
list with components
List of parameters
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.
Number of imputed complete datasets
Imputation sensitivity parameters
Original dataset
## Not run: 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.imp <- imImpAll_mice(rst.abc, deltas=c(-0.25,0,0.25)); ## End(Not run)
## Not run: 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.imp <- imImpAll_mice(rst.abc, deltas=c(-0.25,0,0.25)); ## End(Not run)
Call STAN model to impute missing data for an individual subject under benchmark assumption for MCMC convergence checking
imImpSingle( dsub, fit.rst, normal = TRUE, chains = 4, iter = 5000, warmup = 1000, control = list(adapt_delta = 0.95), ..., seed = NULL )
imImpSingle( dsub, fit.rst, normal = TRUE, chains = 4, iter = 5000, warmup = 1000, control = list(adapt_delta = 0.95), ..., seed = NULL )
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 |
NULL
if there is no missing data in dsub
Otherwise, return a class IDEMSINGLE
object that contains a list with
components
original data of the subject
A stan.fit
class result returned from
rstan::sampling
A dataframe with complete data for the selected subject
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);
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);
Estimate treatment effect size. Estimate variation and conduct hypothesis testing by bootstrap analysis.
imInfer( imp.rst, n.boot = 0, n.cores = 1, update.progress = NULL, effect.quantiles = c(0.25, 0.5, 0.75), quant.ci = c(0.025, 0.975), ..., seed = NULL )
imInfer( imp.rst, n.boot = 0, n.cores = 1, update.progress = NULL, effect.quantiles = c(0.25, 0.5, 0.75), quant.ci = c(0.025, 0.975), ..., seed = NULL )
imp.rst |
A class |
n.boot |
Number of bootstrap samples |
n.cores |
Number of cores for parallel computation. Fixed at 1 for Windows. |
update.progress |
Parameter reserved for run |
effect.quantiles |
Composite quantiles of interest for measuring treatment effect |
quant.ci |
Quantiles for extracting bootstrap confidence intervals |
... |
Extra options for ranking subjects using the composite endpoint that include
|
seed |
Random seed |
If n.boot=0
, bootstrap analysis will not be conducted. Instead, only
the treatment effect size will be estimated using the imputed data.
A class IDEMTEST
list containing
List of specification parameters
Vector of sensitivity parameters
A data frame with columns
Delta0
: Sensitivity parameter for control arm
Delta1
: Sensitivity parameter for intervention arm
Theta
: Estimated
SD
: Standard deviation (when n.boot >0
)
PValue
: p-value (when n.boot >0
A data frame with columns
Delta
:Sensitivity parameter
TRT
:Treatment arm
Q
: Quantiles of the composite endpoint to be estimated
QuantY
: Estimated quantiles if the quantiles correspond to
functional outcome (when n.boot >0
)
QuantSurv
: Estimated quantiles if the quantiles correspond to
survival days (when n.boot >0
)
Q
: Boostrap quantiles for the QuantY (when n.boot >0
)
QSurv
: Boostrap quantiles for the QuantSurv (when
n.boot >0
)
A list with length n.boot
. The th item is the
class
IDEMEST
list corresponding to the th bootstrap
sample
## Not run: 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); rst.est <- imInfer(rst.imp, n.boot = 0, effect.quantiles = c(0.25,0.5,0.75)); rst.test <- imInfer(rst.imp, n.boot = 100, effect.quantiles = c(0.25,0.5,0.75)); ## End(Not run)
## Not run: 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); rst.est <- imInfer(rst.imp, n.boot = 0, effect.quantiles = c(0.25,0.5,0.75)); rst.test <- imInfer(rst.imp, n.boot = 100, effect.quantiles = c(0.25,0.5,0.75)); ## End(Not run)
idem
applicationCall Shiny to run idem
as a web-based application.
imShiny()
imShiny()
A web browser will be brought up for users to access the GUI of idem
.
## Not run: run.idem() ## End(Not run)
## Not run: run.idem() ## End(Not run)
Generate different types of plots for class IDEMDATA
objects.
## S3 method for class 'IDEMDATA' plot( x, opt = c("survivor", "missing", "KM"), cols = c("black", "blue"), fname = NULL, ... )
## S3 method for class 'IDEMDATA' plot( x, opt = c("survivor", "missing", "KM"), cols = c("black", "blue"), fname = NULL, ... )
x |
A class |
opt |
Types of the plot
|
cols |
Curve colors of the treatment and control arm for survival plot or colors of the observed and missing data for missingness plot. |
fname |
File name of the result pdf file. If |
... |
Extra arguments for |
rst.data <- 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)); plot(rst.data, opt = "survivor"); plot(rst.data, opt = "missing", cols = c("blue", "gray")); plot(rst.data, opt = "KM");
rst.data <- 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)); plot(rst.data, opt = "survivor"); plot(rst.data, opt = "missing", cols = c("blue", "gray")); plot(rst.data, opt = "KM");
Plot method of the class IDEMFIT
to generate model fitting diagnosis
plots
## S3 method for class 'IDEMFIT' plot(x, trt = NULL, mfrow = NULL, ...)
## S3 method for class 'IDEMFIT' plot(x, trt = NULL, mfrow = NULL, ...)
x |
A class |
trt |
Treatment arm selected for the diagnostic plots. If |
mfrow |
Plot option |
... |
Additional arguments |
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); plot(im.fit, mfrow=c(2,4));
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); plot(im.fit, mfrow=c(2,4));
Generate different types of plots for class IDEMIMP
objects generated
by imImpAll
## S3 method for class 'IDEMIMP' plot(x, opt = c("imputed", "composite"), fname = NULL, ...)
## S3 method for class 'IDEMIMP' plot(x, opt = c("imputed", "composite"), fname = NULL, ...)
x |
A class |
opt |
Types of the plot
|
fname |
File name of the result pdf file. If |
... |
Options for generating the plots.
|
## Not run: 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)); rst.fit <- imFitModel(im.abc); rst.imp <- imImpAll(rst.fit, deltas=c(-0.25,0,0.25), normal=TRUE, chains = 2, iter = 2000, warmup = 1000); plot(rst.imp, opt = "imputed"), plot(rst.imp, opt = "composite") ## End(Not run)
## Not run: 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)); rst.fit <- imFitModel(im.abc); rst.imp <- imImpAll(rst.fit, deltas=c(-0.25,0,0.25), normal=TRUE, chains = 2, iter = 2000, warmup = 1000); plot(rst.imp, opt = "imputed"), plot(rst.imp, opt = "composite") ## End(Not run)
Generate contour plot of p-values or treatment effect theta for sensitivity analysis results
## S3 method for class 'IDEMINFER' plot(x, con.v = 0.05, nlevels = 30, opt = c("pvalue", "effect"), ...)
## S3 method for class 'IDEMINFER' plot(x, con.v = 0.05, nlevels = 30, opt = c("pvalue", "effect"), ...)
x |
A class |
con.v |
Levels of contour plot |
nlevels |
Levels of color scale |
opt |
contour plots of |
... |
Options for |
The plot will only be generated when bootstrap analysis has been conducted.
## Not run: 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); rst.est <- imInfer(rst.imp, n.boot = 100); plot(rst.est); ## End(Not run)
## Not run: 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); rst.est <- imInfer(rst.imp, n.boot = 100); plot(rst.est); ## End(Not run)
Plot method of the class IDEMSINGLE
to generate traceplot of the imputed missing
outcomes
## S3 method for class 'IDEMSINGLE' plot(x, ...)
## S3 method for class 'IDEMSINGLE' plot(x, ...)
x |
A class |
... |
Additional arguments |
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.single <- imImpSingle(abc[1,], im.fit, chains = 4, iter = 200, warmup = 100); plot(im.imp.single);
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.single <- imImpSingle(abc[1,], im.fit, chains = 4, iter = 200, warmup = 100); plot(im.imp.single);
Generate a plot of survivor only and survivor average causal effect values
## S3 method for class 'summary.IDEMINFER' plot( x, opt = c("pvalue", "effect"), by.sace = TRUE, delta0 = 0, delta1 = 0, sace.delta = NULL, ... )
## S3 method for class 'summary.IDEMINFER' plot( x, opt = c("pvalue", "effect"), by.sace = TRUE, delta0 = 0, delta1 = 0, sace.delta = NULL, ... )
x |
A class |
opt |
contour plots of |
by.sace |
Logical value. If True, create a contour plot for given SACE sensitivity parameter. Otherwise, create a plot for treatment effect for given imputation sensitivity parameters |
delta0 |
Selected treatment arm 0 sensitivity parameters |
delta1 |
Selected treatment arm 1 sensitivity parameters |
sace.delta |
Single SACE sensitivity parameter |
... |
Options for |
The plot function will only generate the contour plot of p-values or treatment effects on functional outcomes for survivors only analyses.
For SACE analysis, the plot function generates contour plot of line plot
based on the value of by.sace
.
## Not run: 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); rst.infer <- imInfer(rst.imp, n.boot = 100, effect.quantiles = c(0.25,0.5,0.75)); rst.survivors <- summary(rst.infer, opt="survivor"); plot(rst.survivors); ## End(Not run)
## Not run: 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); rst.infer <- imInfer(rst.imp, n.boot = 100, effect.quantiles = c(0.25,0.5,0.75)); rst.survivors <- summary(rst.infer, opt="survivor"); plot(rst.survivors); ## End(Not run)
Print the specification details of class IDEMDATA
objects generated by
imData
## S3 method for class 'IDEMDATA' print(x, ...)
## S3 method for class 'IDEMDATA' print(x, ...)
x |
A class |
... |
Additional arguments |
Print error messages in the parameter specifications generated by
imData
## S3 method for class 'IDEMERROR' print(x, html = FALSE, ...)
## S3 method for class 'IDEMERROR' print(x, html = FALSE, ...)
x |
A class |
html |
Logical indicator for the format of the error messages. When |
... |
Additional arguments |
## Not run: rst.data <- imData(abc, trt="TRT", outcome=c("Y1","Y2"), y0=NULL, endfml="Y3", bounds=c(10,20), duration=365, err.terminate=FALSE); print(rst.data); ## End(Not run)
## Not run: rst.data <- imData(abc, trt="TRT", outcome=c("Y1","Y2"), y0=NULL, endfml="Y3", bounds=c(10,20), duration=365, err.terminate=FALSE); print(rst.data); ## End(Not run)
Print method of the class IDEMFIT
generated by
imFitModel
## S3 method for class 'IDEMFIT' print(x, ...)
## S3 method for class 'IDEMFIT' print(x, ...)
x |
A class |
... |
Additional arguments |
Print the results from lm
for all the models
Print method for class IDEMIMP
objects generated
by imImpAll
## S3 method for class 'IDEMIMP' print(x, ...)
## S3 method for class 'IDEMIMP' print(x, ...)
x |
A class |
... |
Extra arguments |
Print method of class IDEMINFER
for treatment effect estimation and
hypothesis testing results
## S3 method for class 'IDEMINFER' print(x, delta0 = NULL, delta1 = NULL, ...)
## S3 method for class 'IDEMINFER' print(x, delta0 = NULL, delta1 = NULL, ...)
x |
A class |
delta0 |
Selected treatment arm 0 sensitivity parameters |
delta1 |
Selected treatment arm 1 sensitivity parameters |
... |
Extra arguments |
## Not run: 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); rst.test <- imInfer(rst.imp, n.boot = 100); print(rst.test, delta0 = 0, delta1 = 0.15) ## End(Not run)
## Not run: 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); rst.test <- imInfer(rst.imp, n.boot = 100); print(rst.test, delta0 = 0, delta1 = 0.15) ## End(Not run)
Print method for class IDEMSINGLE
objects generated
by imImpSingle
## S3 method for class 'IDEMSINGLE' print(x, ...)
## S3 method for class 'IDEMSINGLE' print(x, ...)
x |
A class |
... |
Additional arguments |
Print survivors only or SACE analysis results
## S3 method for class 'summary.IDEMINFER' print(x, delta0 = NULL, delta1 = NULL, ...)
## S3 method for class 'summary.IDEMINFER' print(x, delta0 = NULL, delta1 = NULL, ...)
x |
A class |
delta0 |
Selected treatment arm 0 sensitivity parameters |
delta1 |
Selected treatment arm 1 sensitivity parameters |
... |
Extra arguments |
Summarize the missing data information for class IDEMDATA
objects
generated by imData
.
## S3 method for class 'IDEMDATA' summary(object, opt = c("misstable", "missid", "trt"), endponly = FALSE, ...)
## S3 method for class 'IDEMDATA' summary(object, opt = c("misstable", "missid", "trt"), endponly = FALSE, ...)
object |
A class |
opt |
Types of the summarization
|
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 |
... |
Extra arguments |
A dataframe with frequencies of each missing pattern when opt is misstable
.
A vector of indices of subjects that need imputation when opt is missid
.
A vector of treatment arms in the data when opt is trt
.
Summarize survivors only or Survivor Averaged Causal Effect (SACE) based on the imputation and bootstrap analysis
## S3 method for class 'IDEMINFER' summary(object, opt = c("survivor", "SACE"), sace.deltas = NULL, ...)
## S3 method for class 'IDEMINFER' summary(object, opt = c("survivor", "SACE"), sace.deltas = NULL, ...)
object |
A class |
opt |
Types of the summary
|
sace.deltas |
Vector of sensitivity parameters for SACE estimation. If
|
... |
Optional arguments for summary |
For SACE, the default sensitivity parameters will be determined by the standard deviation of the treatment effect size on the functional outcomes.
A class summary.IDEMINFER
list containing
imputation sensitivity parameters
number of bootstrap samples in bootstrap analysis
SACE sensitivity parameters when opt = SACE
A data frame with columns
Delta0
: Imputation sensitivity parameter for control arm,
Delta1
: Imputation sensitivity parameter for intervention arm
SACE_Delta
: SACE sensitivity parameter when opt = SACE
Effect
: SACE estimate
LB
: Lower bound of the 95
UB
: Upper bound of the 95
PValue
: p-value when when n.boot > 0
in the IDEMINFER
object
Chiba Y, VanderWeele TJ (2011). A simple method for principal strata effects when the outcome has been truncated due to death. American Journal of Epidemiology 173(7):745-751.
## Not run: 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); rst.infer <- imInfer(rst.imp, n.boot = 100, effect.quantiles = c(0.25,0.5,0.75)); rst.sace <- summary(rst.infer, opt = "SACE") ## End(Not run)
## Not run: 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); rst.infer <- imInfer(rst.imp, n.boot = 100, effect.quantiles = c(0.25,0.5,0.75)); rst.sace <- summary(rst.infer, opt = "SACE") ## End(Not run)