Imputation function to be used with the mice packe
mice.impute.qs(
y,
ry,
x,
wy = NULL,
quantiles = c(0.1, 0.25, 0.5, 0.75, 0.9),
baseline_quantile = 0.5,
algorithm = "sfn",
tails = "gaussian",
parallel = F,
calc_se = F,
weights = NULL,
control = qs_control(),
std_err_control = se_control(se_method = "weighted_bootstrap"),
...
)
Arguments
y |
vector to be imputed |
ry |
indicator for complete cases |
x |
independent variables |
wy |
cases to be imputed |
quantiles |
vector of quantiles to be estimated |
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. |
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 quantreg_spacing ,
the lower-level function called by qs . This is set via the function qs_control ,
which returns a named list, with elements including:
trunc : whether to truncate residual values below the argument "small"
small : level of "small" values to guarentee numerical stability. If not specified, set dynamically based on the standard deviation of the outcome variable.
lambda : For penalized regression, you can specify a level of lambda which will weight the penalty. If not set, will be determined based on 10-fold cross-validation.
output_quantiles : whether to save fitted quantiles as part of the function output
calc_avg_me : whether to return average marginal effects as part of the fitted object
lambda : the penalization factor to be passed to penalized regression algorithms
|
std_err_control |
control parameters to pass to the control arguments of quantreg_spacing ,
the lower-level function called by standard_errors . Constructed via the se_control function.
Possible arguments include:
se_method : Method to use for standard errors, either "weighted_bootstrap",
"subsample", "bootstrap" or "custom" along with a specified subsampling method and
subsample percent. If specifying "custom", must also specify subsampling_percent and
draw_weights . If you specify "subsample", subsampling percent defaults to 0.2, but can be
changed. See details for details.
num_bs : Number of bootstrap iterations to use, defaults to 100.
subsample_percent : A number between 0 and one, specifying the percent of the data to subsample for standard error calculations
draw_weights : Whether to use random exponential weights for bootstrap, either TRUE or FALSE
sampling_method One of "leaveRows", "subsampleRows", or "bootstrapRows".
leaveRows doesn't resample rows at all. subsampleRows samples without replacement
given some percentage of the data (specified via subsample_percent), and bootstrapRows
samples with replacement.`
|
... |
other arguments to be passed to quantreg_spacing |
cluster_formula |
formula (e.g. ~X1 + X2) giving the clustering formula |
seed |
what seed to use for replicable RNG |
Examples