Description Usage Arguments Details Value Author(s) References See Also Examples
This function is used to multiply impute missing values using quantile regression imputation models.
1 2 3 4 | mice.impute.rq(y, ry, x, tsf = "none", symm = TRUE, dbounded = FALSE,
lambda = NULL, 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", ...)
|
y |
numeric vector of length |
ry |
missing data indicator. Logical vector of length |
x |
matrix |
tsf |
transformation to be used. Possible options are |
symm |
logical flag. If |
dbounded |
logical flag. If |
lambda |
a numerical value for the transformation parameter. This is provided by the user or set to zero if not specified. |
epsilon |
constant used to trim the values of the sample space. |
method.rq |
linear programming algorithm (see |
... |
additional arguments. |
This function implements the methods proposed by Geraci (2013) 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 2013 for details).
A vector of length nmis
with imputations.
Marco Geraci
Bottai M, Zhen H. Multiple imputation based on conditional quantile estimation. Epidemiology, Biostatistics and Public Health 2013;10(1):e8758-1.
Geraci M. Estimation of regression quantiles in complex surveys with data missing at random: An application to birthweight determinants. Statistical Methods in Medical Research 2013. doi:10.1177/0962280213484401
Geraci M and Jones MC. Improved transformation-based quantile regression. Canadian Journal of Statistics 2015;43(1):118-132.
van Buuren S and Groothuis-Oudshoorn K (2011). mice: Multivariate Imputation by Chained Equations in R. Journal of Statistical Software, 45(3), 1-67. URL http://www.jstatsoft.org/v45/i03/.
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 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.