mice.impute.heckprob: Imputation by bivariate probit sample selection model for...

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

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

Description

Imputes univariate binary Missing Not At Random (MNAR) outcome using the bivariate probit sample selection model.

Usage

1
mice.impute.heckprob(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 binary MNAR outcome using the bivariate probit sample selection model. This imputation model requires defining a selection and an outcome equation for the bivariate probit model. The imputation algorithm consists of the following steps:

  1. Fit the bivariate probit model and compute the posterior distribution of parameters

  2. Draw imputation parameters from their posterior distributions

  3. Draw imputed values from their predictive distribution

Value

A vector of length nmis with imputations (0 or 1).

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
37
38
39
40
41
42
# Import dataset with a suspected MNAR mechanism
require("GJRM")
require(mvtnorm)
require(pbivnorm)
data("hiv") 

# We select only one region (lusuka) and 5 variables
lusuka <- hiv[hiv$region==5,c("hiv", "age", "marital", "condom", "smoke")]

# Categorical variables have to be recoded as factor
lusuka$hiv <- as.factor(lusuka$hiv)

# Specify a selection (missing data mechanism) and an outcome equation (analyse model)

# Generate an empty matrix

JointModelEq <- generate_JointModelEq(data=lusuka,varMNAR = "hiv")

# Fill in with 1 for variable included in equations
JointModelEq[,"hiv_var_sel"] <- c(0,1,1,1,1)
JointModelEq[,"hiv_var_out"] <- c(0,1,1,1,0)

# Generation of argument for MNAR imputation model in "mice()" function
arg <- MNARargument(data=lusuka,varMNAR="hiv",JointModelEq=JointModelEq)

# Imputation using mice() function
# Values returned have to be included in the "mice()" function as argument:

## Not run: imputation <- mice(data = arg$data_mod,
                 method = arg$method,
                 predictorMatrix = arg$predictorMatrix,
                 JointModelEq=arg$JointModelEq,
                 control=arg$control,
                 maxit=1,m=5)

# Because of missing data only on one variable, fix maxit=1

# Estimation on each imputed dataset and pooling               
analysis <- with(imputation,glm(hiv~age+condom+marital,family=binomial(link="probit")))
result <- pool(analysis)
summary(result)
## End(Not run)

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