Description Usage Arguments Value Examples
check_fn_args_comp_mms_var_boot_ind
is used to assess whether the arguments
are correctly specified in list
format and returns an error message if
they do not match the correct specification
1 2 3 4 5 6 7 8 9 | check_fn_args_summary(
mod_fit,
sand,
boot_emp,
boot_sub,
boot_mul,
boot_res,
well_specified
)
|
mod_fit |
(maars_lm, lm) A fitted OLS |
sand |
(logical) : |
boot_emp |
(logical) : |
boot_sub |
(logical) : |
boot_mul |
(logical) : |
boot_res |
(logical) : |
well_specified |
(logical) : |
: A character vector of TRUE
if assertions pass, or an
error if there is an assertion failure.
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 | ## Not run:
set.seed(1243434)
# generate data
n <- 1e3
X_1 <- stats::rnorm(n, 0, 1)
X_2 <- stats::rnorm(n, 10, 20)
eps <- stats::rnorm(n, 0, 1)
# OLS data and model
y <- 2 + X_1 * 1 + X_2 * 5 + eps
lm_fit <- stats::lm(y ~ X_1 + X_2)
# Create a maars_lm model with empirical bootstrap, sandwich, and
# well-specified variance estimates
comp_var1 <- comp_var(
mod_fit = lm_fit,
boot_emp = list(B = 20, m = 200),
boot_sub = list(B = 20, m = 100),
boot_res = NULL,
boot_mul = NULL
)
# Let the user request only the empirical bootstrap variance estimates
# This function should return "boot_emp" since the user only requested it
# and it is available in the fitted maars_lm model
check_fn_args_summary(
mod_fit = comp_var1, sand = FALSE,
boot_emp = TRUE, boot_sub = FALSE,
boot_res = FALSE, boot_mul = FALSE,
well_specified = FALSE
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.