mice.impute.rq {Qtools}R Documentation

QR-based Multiple Imputation

Description

This function is used to multiply impute missing values using quantile regression imputation models.

Usage

mice.impute.rq(y, ry, x, tsf = "none", symm = TRUE, dbounded = FALSE,
	lambda = NULL, x.r = NULL, par = NULL, conditional = TRUE,
	epsilon = 0.001, method.rq = "fn", ...)
mice.impute.rrq(y, ry, x, tsf = "none", symm = TRUE, dbounded = FALSE,
	lambda = NULL, epsilon = 0.001, method.rq = "fn", ...)

Arguments

y

numeric vector of length n with nmis missing values.

ry

missing data indicator. Logical vector of length n: FALSE if y is missing, TRUE if y is observed.

x

matrix n x p of completely observed covariates.

tsf

transformation to be used. Possible options are mcjI for Proposal I, bc for Box-Cox and ao for Aranda-Ordaz transformation models. No transformation is used by default.

symm

logical flag. If TRUE (default) a symmetric transformation is used.

dbounded

logical flag. If TRUE the response y is assumed to be bounded between 0 and 1.

lambda

if conditional = TRUE, a numerical value for the transformation parameter. This is provided by the user or set to zero if not specified. If conditional = FALSE, this argument is ignored.

x.r

range of the mapping for doubly bounded variables.

par

if conditional = FALSE, starting values for nlrq1 can be provided via this argument. See argument start in nlrq1 for details.

conditional

logical flag. If TRUE (default), the transformation parameter is assumed to be known and this must be provided via the argument lambda. Otherwise, it is estimated via nlrq1.

epsilon

constant used to trim the values of the sample space.

method.rq

linear programming algorithm (see rq).

...

additional arguments.

Details

This function implements the methods proposed by Geraci (2016) and Geraci and McLain (2018) to impute missing values using quantile regression models. Uniform values are sampled from [epsilon, 1 - epsilon], therefore allowing the interval to be bounded away from 0 and 1 (default is 0.001). It is possible to specify a quantile regression transformation model with parameter lambda (Geraci and Jones). The function mice.impute.rrq performs imputation based on restricted regression quantiles to avoid quantile crossing (see Geraci 2016 for details).

Value

A vector of length nmis with imputations.

Author(s)

Marco Geraci

References

Bottai, M., & Zhen, H. (2013). Multiple imputation based on conditional quantile estimation. Epidemiology, Biostatistics, and Public Health, 10(1), e8758.

Geraci, M. (2016). Estimation of regression quantiles in complex surveys with data missing at random: An application to birthweight determinants. Statistical Methods in Medical Research, 25(4), 1393-1421.

Geraci, M., and Jones, M. C. (2015). Improved transformation-based quantile regression. Canadian Journal of Statistics, 43(1), 118-132.

Geraci, M., and McLain, A. (2018). Multiple imputation for bounded variables. Psychometrika, 83(4), 919-940.

van Buuren, S., and Groothuis-Oudshoorn, K. (2011). mice: Multivariate imputation by chained equations in R. Journal of Statistical Software, 45(3), 1–67.

See Also

ao, tsrq

Examples


## Not run: 

# Load package 'mice'
require(mice)

# Load data nhanes
data(nhanes)
nhanes2 <- nhanes
nhanes2$hyp <- as.factor(nhanes2$hyp)

# Impute continuous variables using quantile regression
set.seed(199)
imp <- mice(nhanes2, meth = c("polyreg", "rq", "logreg", "rq"), m = 5)

# estimate linear regression and pool results
fit <- lm.mids(bmi ~ hyp + chl, data = imp)
pool(fit)

# Impute using restricted quantile regression
set.seed(199)
imp <- mice(nhanes2, meth = c("polyreg", "rrq", "logreg", "rrq"), m = 5)
fit <- lm.mids(bmi ~ hyp + chl, data = imp)
pool(fit)

# Impute using quantile regression + Box-Cox transformation with parameter
# lambda = 0 (ie, log transformation)

set.seed(199)
imp <- mice(nhanes2, meth = c("polyreg", "rq", "logreg", "rq"), m = 5, tsf = "bc", lambda = 0)
fit <- lm.mids(bmi ~ hyp + chl, data = imp)
pool(fit)



## End(Not run)


[Package Qtools version 1.5.9 Index]