check_fn_args_summary: Assertion Checks for individual 'get_boot_summary' function...

Description Usage Arguments Value Examples

View source: R/ols-summary.R

Description

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

Usage

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
)

Arguments

mod_fit

(maars_lm, lm) A fitted OLS maars_lm, lm class object

sand

(logical) : TRUE if sandwich estimator output is required, FALSE to exclude this output from the request

boot_emp

(logical) : TRUE if empirical bootstrap standard error output is required, FALSE to exclude this output from the request

boot_sub

(logical) : TRUE if subsampling bootstrap standard error output is required, FALSE to exclude this output from the request

boot_mul

(logical) : TRUE if multiplier bootstrap standard error output is required, FALSE to exclude this output from the request

boot_res

(logical) : TRUE if residual bootstrap standard error output is required, FALSE to exclude this output from the request

well_specified

(logical) : TRUE if lm standard errors (well specified) output is required, FALSE to exclude this output from the request

Value

: A character vector of TRUE if assertions pass, or an error if there is an assertion failure.

Examples

 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)

shamindras/maars documentation built on Sept. 21, 2021, 2:50 a.m.