Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

summarySandwich

Linear Model Summary with Sandwich Standard Errors


Description

summarySandwich creates a summary of a "lm" object similar to the standard one, with sandwich estimates of the coefficient standard errors in the place of the usual OLS standard errors, also modifying as a consequence the reported t-tests and p-values for the coefficients. Standard errors may be computed from a heteroscedasticity-consistent ("HC") covariance matrix for the coefficients (of several varieties), or from a heteroscedasticity-and-autocorrelation-consistent ("HAC") covariance matrix.

Usage

summarySandwich(model, ...)
    
## S3 method for class 'lm'
summarySandwich(model, 
  type=c("hc3", "hc0", "hc1", "hc2", "hc4", "hac"), ...)

Arguments

model

a linear-model object.

type

type of sandwich standard errors to be computed; see hccm in the car package, and vcovHAC in the sandwich package, for details.

...

arguments to be passed to hccm or vcovHAC

Value

an object of class "summary.lm", with sandwich standard errors substituted for the usual OLS standard errors; the omnibus F-test is similarly adjusted.

Author(s)

See Also

Examples

mod <- lm(prestige ~ income + education + type, data=Prestige)
    summary(mod)
    summarySandwich(mod)

RcmdrMisc

R Commander Miscellaneous Functions

v2.7-1
GPL (>= 2)
Authors
John Fox [aut, cre], Robert Muenchen [ctb], Dan Putler [ctb]
Initial release
2020-08-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.