get_assumptions: Retrieve the assumptions for the variance estimators to be...

Description Usage Arguments Value Examples

Description

Retrieve the assumptions for the variance estimators to be consistent for a a fitted OLS maars_lm, lm class object.

Usage

1
2
3
4
5
6
7
8
9
get_assumptions(
  mod_fit,
  sand = NULL,
  boot_emp = NULL,
  boot_sub = NULL,
  boot_mul = NULL,
  boot_res = NULL,
  well_specified = NULL
)

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 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

(vector) : Vectors containing the assumptions under which each estimator of the variance is consistent.

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
## 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)

# DEFINE common column names - these stay the same across all
# reported error types
common_vars <- c("term", "estimate")

# Empirical Bootstrap check
set.seed(454354534)
comp_var1 <- comp_var(
  mod_fit = lm_fit,
  boot_emp = list(B = 20, m = 200),
  boot_res = list(B = 30)
)

# This returns everything but boot_mul, since we didn't run it in the original
# original maars_lm model
get_assumptions(
  mod_fit = comp_var1)

## End(Not run)

shamindras/maar documentation built on Sept. 19, 2021, 10:21 p.m.