Description Usage Arguments Value References Examples
MR.quantile()
is used to estimate the marginal quantile of a variable which is subject to missingness. Multiple missingness probability models and imputation models are allowed.
1 2 3 |
response |
The response variable of interest whose marginal quantile is to be estimated. |
tau |
A numeric value in (0,1). The quantile to be estimated. |
imp.model |
A list of imputation models defined by |
mis.model |
A list of missingness probability models defined by |
moment |
A vector of auxiliary variables whose moments are to be calibrated. |
order |
A numeric value. The order of moments up to which to be calibrated. |
L |
Number of imputations. |
data |
A data frame with missing data encoded as |
bootstrap |
Logical. If |
bootstrap.size |
A numeric value. Number of bootstrap resamples generated if |
alpha |
Significance level used to construct the 100(1 - |
|
The estimated value of the marginal quantile. |
|
The bootstrap standard error of |
|
A Wald-type confidence interval based on |
|
The calibration weights if any |
Han, P., Kong, L., Zhao, J. and Zhou, X. (2019). A general framework for quantile estimation with incomplete data. Journal of the Royal Statistical Society: Series B (Statistical Methodology). 81(2), 305–333.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Simulated data set
set.seed(123)
n <- 400
gamma0 <- c(1, 2, 3)
alpha0 <- c(-0.8, -0.5, 0.3)
X <- runif(n, min = -2.5, max = 2.5)
p.mis <- 1 / (1 + exp(alpha0[1] + alpha0[2] * X + alpha0[3] * X ^ 2))
R <- rbinom(n, size = 1, prob = 1 - p.mis)
a.x <- gamma0[1] + gamma0[2] * X + gamma0[3] * exp(X)
Y <- rnorm(n, a.x, sd = sqrt(4 * X ^ 2 + 2))
dat <- data.frame(X, Y)
dat[R == 0, 2] <- NA
# Define the outcome regression models and missingness probability models
imp1 <- glm.work(formula = Y ~ X + exp(X), family = gaussian)
imp2 <- glm.work(formula = Y ~ X + I(X ^ 2), family = gaussian)
mis1 <- glm.work(formula = R ~ X + I(X ^ 2), family = binomial(link = logit))
mis2 <- glm.work(formula = R ~ X + exp(X), family = binomial(link = cloglog))
MR.quantile(response = Y, tau = 0.25, imp.model = list(imp1, imp2),
mis.model = list(mis1, mis2), L = 10, data = dat)
MR.quantile(response = Y, tau = 0.25, moment = c(X), order = 2, data = dat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.