comp_lm_var: Get a list output summary for 'lm', under well specified...

Description Usage Arguments Value Examples

Description

Get a list output summary for lm that is consistent for use in comp_mms_var. This assumes that the linear model is fitted under well specified assumptions. That is, the data is assumed to be generated directly from the linear model under OLS assumptions.

Usage

1
comp_lm_var(mod_fit)

Arguments

mod_fit

A lm (OLS) object.

Value

A list containing the following elements: the type of estimator of of the variance (var_type); the summary statistics of mod_fit based on this estimator of the variance (e.g., standard errors and p-values) (var_summary); the assumptions under which the estimator of the variance is consistent (var_assumptions); the covariance matrix for the coefficients estimates (cov_mat).

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
set.seed(674748)
n <- 1e5
X <- stats::rnorm(n, 0, 1)
y <- 2 + X * 1 + stats::rnorm(n, 0, 10)
lm_fit <- stats::lm(y ~ X)
sandwich_qr_std_err <- comp_sand_var(lm_fit)

## End(Not run)

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