Summarize: Modified Functions for Summarizing Linear Models

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

car package replacements for the summary, vcov and confint functions for lm objects, with additional arguments and different defaults. Default methods that call the standard R functions are provided for the Summarize, Vcov, and Confint generics, so the car functions should be safe to use in general.

Usage

 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
Summarize(object, ...)

## S3 method for class 'lm'
Summarize(object, correlation = FALSE, symbolic.cor = FALSE, 
  vcov. = Vcov, conf.intervals = FALSE, ...)

## S3 method for class 'Summarize.lm'
print(x, digits = max(3, getOption("digits") - 3), 
  symbolic.cor = x$symbolic.cor, 
  signif.stars = getOption("show.signif.stars"), 
  header=TRUE, resid.summary=FALSE, adj.r.squared=FALSE, brief=FALSE, ...)
 
## Default S3 method:
Summarize(object, ...)

Vcov(object, ...)

## S3 method for class 'lm'
Vcov(object, ...)

## Default S3 method:
Vcov(object, ...)

Confint(object, ...)

## S3 method for class 'lm'
Confint(object, parm, level = 0.95, vcov.=Vcov, ...)

## Default S3 method:
Confint(object, ...)

Arguments

object

an object of class "lm", usually, a result of a call to lm.

correlation, symbolic.cor

see summary.lm

x,digits,signif.stars

see summary.lm

parm,level

see confint

vcov.

either a function for estimating the covariance matrix of the regression coefficients, e.g., hccm, or an estimated covariance matrix for the coefficients. See discussion below.

conf.intervals

if TRUE, then the output of confint is appended to the summary output. His option is added for use when vcov. = Boot; see discussion below.

header

if TRUE, print the header for the summary output

resid.summary

if TRUE, print the five-number summary of the residuals in the summary

adj.r.squared

if TRUE, print the adjusted r-squared in the summary

brief

if TRUE, set header, resid.summary and adj.r.squared to FALSE

...

additional arguments, for consistency with other summary methods

Details

All these functions mimic functions in the stats package for summarizing aspects of a linear model.

The Summarize and Confint functions add support for the vcov. argument, which allows specifying a covariance matrix for the regression coefficients other than the usual covariance matrix returned by the function vcov. This argument may be either the name of a function, so that the call to vcov.(object) returns a covariance matrix, or else vcov. is set equal to a covariance matrix. Setting vcov.=hccm uses 'proposal 3' described by Long and Ervin (2000) for a sandwich coefficient-variance estimator that may be robust against nonconstant variance. Setting vcov. = hccm(object, type = "hc2") would use the matrix returned by the hccm function using proposal 2. If vcov. = Boot, with a required capital 'B', then the covariance matrix is computed using a case-resampling bootstrap by the call cov(Boot(object)$t); see Boot and hccm.

When using vcov. = Boot, we recommend setting conf.intervals = TRUE, so confidence intervals based on the Bca method will be based on the same bootstrap as used in the summary. Alternatively, users may prefer to save the bootstrap, and this can be accomplished by first setting b1 <- Boot(object), and then calling Summarize(object, vcov. = cov(b1$t)).

The overall F-test in the Summarize output uses the supplied covariance matrix in a call to the linearHypothesis function.

The print method has additional arguments to customize the standard summary output. Standard output is obtained by setting residual.summary=TRUE, adjusted.r.squared=TRUE with vcov. = vcov.

Value

The Summarize.lm function returns a list with all the elements shown at summary.lm plus two additional items:

vcov.

The name of the method used to estimate the covariance matrix

conf.intervals

if these were requested, the confidence intervals for coefficient estimates

The Vcov.lm function returns the usual covariance matrix returned by vcov.

The Confint.lm function returns either (1) the output from confint.lm if vcov. = vcov; (2) the output from confint(Boot(object)) if vcov. = Boot; or (3) Wald-type confidence intervals using the supplied covariance matrix for any other choice of vcov..

Author(s)

Sanford Weisberg sandy@umn.edu

References

Long, J. S. and Ervin, L. H. (2000) Using heteroscedasity consistent standard errors in the linear regression model. The American Statistician 54, 217–224.

White, H. (1980) A heteroskedastic consistent covariance matrix estimator and a direct test of heteroskedasticity. Econometrica 48, 817–838.

See Also

summary.lm, confint, vcov.lm, hccm, Boot, linearHypothesis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
mod.prestige <- lm(prestige ~ education + income + type, Prestige)
Summarize(mod.prestige, vcov.=hccm)
print(Summarize(mod.prestige, conf.intervals=TRUE), brief=TRUE)
## Not run: 
Summarize(mod.prestige, vcov.=Boot)

## End(Not run)
Confint(mod.prestige, vcov.=hccm)
## Not run: 
Confint(mod.prestige, vcov.=Boot)

## End(Not run)

jonathon-love/car3 documentation built on May 19, 2019, 7:28 p.m.