make_penalized_blots | R Documentation |
Imputation function to be used with the mice package
make_penalized_blots(
data,
quantiles = c(0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99),
...
)
mice.impute.qs(
y,
ry,
x,
wy = NULL,
quantiles = c(0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99),
baseline_quantile = 0.5,
algorithm = "two_pass",
tails = "gaussian",
parallel = F,
calc_se = F,
weights = NULL,
control = qs_control(calc_r2 = F, calc_avg_me = F),
std_err_control = se_control(),
...
)
data |
data to be interpolated by mice |
quantiles |
vector of quantiles to be estimated |
... |
other arguments to be passed to quantreg_spacing |
y |
vector to be imputed |
ry |
indicator for complete cases |
x |
independent variables |
wy |
cases to be imputed |
baseline_quantile |
baseline quantile to measure spacings from (defaults to 0.5) |
algorithm |
What algorithm to use for fitting underlying regressions. Either one of "sfn", "br", "lasso", "post_lasso", or a function name which estimates quantiles. Defaults to sfn for now. |
tails |
what distribution to use when fitting the tails, either "gaussian" or "exponential" |
parallel |
whether to run bootstrap in parallel |
calc_se |
boolean, whether or not to calculate standard errors. Defaults to FALSE. |
weights |
optional vector of weights for weighted quantile regression |
control |
control parameters to pass to the control arguments of
|
std_err_control |
control parameters to pass to the control arguments of
|
## Not run:
library(mice)
x <- rnorm(10000)
x[sample(1:length(x), 100)] <- NA
x <- matrix(x, ncol = 10)
# get optimal lambdas from CV search based on complete data
bl <- make_penalized_blots(x)
# pass those to the lasso and get imputations
imputations = mice::mice(x, m = 10,
defaultMethod = c("qs", "logreg", "polyreg", "polr"),
blots = bl, algorithm = "lasso")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.