mice.impute.hecknorm: Imputation by Heckman's model for continuous outcome with...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/mice.impute.hecknorm.R

Description

Imputes univariate missing continuous outcome using Heckman's model with a one-step maximum likelihood estimator.

Usage

1
mice.impute.hecknorm(y, ry, x, JointModelEq, control, ...)

Arguments

y

Incomplete data vector of length n.

ry

Vector of missing data pattern of length n (FALSE=missing, TRUE=observed).

x

Matrix (n x p) of complete covariates.

JointModelEq

Output JointModelEq provided by MNARargument() function.

control

Output control provided by MNARargument() function.

...

Other named arguments.

Details

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:

  1. Fit the one-step Heckman's model and compute the posterior distribution of parameters

  2. Draw imputation parameters from their posterior distribution

  3. Draw imputed values from their predictive distribution

Value

A vector of length nmis with imputations.

Author(s)

Jacques-Emmanuel Galimard and Matthieu Resche-Rigon

References

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).

See Also

miceMNAR

Examples

 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)

miceMNAR documentation built on May 2, 2019, 8:31 a.m.