experiment_missing_data.frame {mi} | R Documentation |
Class "experiment_missing_data.frame"
Description
This class inherits from the missing_data.frame-class
but is customized for the situation
where the sample is a randomized experiment.
Details
The fit_model-methods
for the experiment_missing_data.frame class take into account the
special nature of a randomized experiment. At the moment, the treatment variable must be binary and
fully observed.
Objects from the Class
Objects can be created by calls of the form new("experiment_missing_data.frame", ...)
.
However, its users almost always will pass a data.frame
to the
missing_data.frame
function and specify the subclass
and concept
arguments.
Slots
The experiment_missing_data.frame class inherits from the missing_data.frame-class
and
has two additional slots
- concept
Object of class
factor
whose length is equal to the number of variables and whose levels are"treatment"
,"covariate"
and"outcome"
- case
Object of class
character
of length one, indicating whether the missingness is in the outcomes only, in the covariates only, or in both the outcomes and covariates. This slot is filled automatically by theinitialize
method
Author(s)
Ben Goodrich and Jonathan Kropko, for this version, based on earlier versions written by Yu-Sung Su, Masanao Yajima, Maria Grazia Pittau, Jennifer Hill, and Andrew Gelman.
See Also
Examples
rdf <- rdata.frame(n_full = 2, n_partial = 2,
restrictions = "stratified", experiment = TRUE,
types = c("t", "ord", "con", "pos"),
treatment_cor = c(0, 0, NA, 0, NA))
Sigma <- tcrossprod(rdf$L)
rownames(Sigma) <- colnames(Sigma) <- c("treatment", "X_2", "y_1", "Y_2",
"missing_y_1", "missing_Y_2")
print(round(Sigma, 3))
concept <- as.factor(c("treatment", "covariate", "covariate", "outcome"))
mdf <- missing_data.frame(rdf$obs, subclass = "experiment", concept = concept)