Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/mice.impute.hecknorm.R
Imputes univariate missing continuous outcome using Heckman's model with a one-step maximum likelihood estimator.
1  | mice.impute.hecknorm(y, ry, x, JointModelEq, control, ...)
 | 
y | 
 Incomplete data vector of length   | 
ry | 
 Vector of missing data pattern of length   | 
x | 
 Matrix (n x p) of complete covariates.  | 
JointModelEq | 
 Output   | 
control | 
 Output   | 
... | 
 Other named arguments.  | 
Imputation of continuous MNAR outcome using Heckman's model. This imputation model requires to define a selection and an outcome equation for the imputation model. The imputation algorithm consists of the following steps:
Fit the one-step Heckman's model and compute the posterior distribution of parameters
Draw imputation parameters from their posterior distribution
Draw imputed values from their predictive distribution
A vector of length nmis with imputations.
Jacques-Emmanuel Galimard and Matthieu Resche-Rigon
Galimard, J.E., Chevret, S., Curis, E., and Resche-Rigon, M. (2018). Heckman imputation models for binary or continuous MNAR missing outcomes and MAR missing predictors. BMC Medical Research Methodology (In press).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36  | require("GJRM")
require(mvtnorm)
# Generation of a simulated dataset with MNAR mechanism on a continuous outcome
X1 <- rnorm(500,0,1)
X2 <- rbinom(500,1,0.5)
X3 <- rnorm(500,1,0.5)
  
errors <- rmvnorm(500,mean=c(0,0),sigma=matrix(c(1,0.3,0.3,1),nrow=2,byrow=TRUE))
Y <- X1+X2+errors[,1]
Ry <- ifelse(0.66+1*X1-0.5*X2+X3+errors[,2]>0,1,0)
Y[Ry==0] <- NA
  
simul_data <- data.frame(Y,X1,X2,X3)
JointModelEq <- generate_JointModelEq(data=simul_data,varMNAR = "Y")
JointModelEq[,"Y_var_sel"] <- c(0,1,1,1)
JointModelEq[,"Y_var_out"] <- c(0,1,1,0)
arg <- MNARargument(data=simul_data,varMNAR="Y",JointModelEq=JointModelEq)
## Not run: imputation2 <- mice(data = arg$data_mod,
                 method = arg$method,
                 predictorMatrix = arg$predictorMatrix,
                 JointModelEq=arg$JointModelEq,
                 control=arg$control,
                 maxit=1,m=5)
analysis2 <- with(imputation,lm(Y~X1+X2+X3))
result2 <- pool(analysis2)
summary(result2)
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.