covrob.lm: Linear model with sandwich robust covariance estimator

View source: R/regression_models.R

Linear model with sandwich robust covariance estimatorR Documentation

Linear model with sandwich robust covariance estimator

Description

Linear model with sandwich robust covariance estimator.

Usage

covrob.lm(y, x)

Arguments

y

A numerical vector with the response variable.

x

The design matrix with the data, where each column refers to a different sample of subjects. You must supply the design matrix, with the column of 1s. This function is the analogue of lm.fit and .lm.fit.

Details

The function performs the usual linear regression model but returns robust standard errors using the sandwich covariance estimator.

Value

A list including:

info

A matrix with the beta coefficients, their robust standard error, their t-test statistic, and their associated p-value.

robcov

The sandwich robust covariance matrix.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Introductory Econometrics. A modern approach. Mason, South-Western Cengage Learning, 5th Edition.

See Also

het.lmfit, cluster.lm, lm.parboot, cor_test, lm.drop1

Examples

x <- matrix( rnorm( 100 * 4), ncol = 4 )
y <- rnorm(100)
a <- covrob.lm(y, x) 
x <- NULL

Rfast2 documentation built on Aug. 8, 2023, 1:11 a.m.