Learn R Programming

bucky (version 1.0.7)

robust.summary: Robust summary

Description

Output summary information using robust or clustered robust standard errors.

Usage

# S3 method for robustified
summary(object, …)

robust.summary(x, cluster, type, omega, …)

Arguments

object

An object of class robustified, usually generated by robustify.

x

A model of class lm, glm, or any other class which contains a call object and methods for estfun and nobs.

cluster

The variable on which to cluster (if any). If this is not specified, unclustered robust standard errors using vcovHC are used. If this is specified, clustered robust standard errors using vcovCR are used.

type

A character string specifying the estimation type. The default is to use the defaults for vcovHC or vcovCR, depending on whether cluster is specified. For details, see vcovHC or vcovCR.

omega

A vector or a function depending on the arguments `residuals' (the working residuals of the model), `diaghat' (the diagonal of the corresponding hat matrix) and `df' (the residual degrees of freedom). For details, see vcovHC or vcovCR.

Any additional arguments to be passed to coeftest.

Value

An object of class summary.robustified containing a coefficients object computed using coeftest and the method attribute specifying the type of standard errors used.

Details

Both functions provide summary output with robust (Huber-White) or clustered robust standard errors based on vcovHC or vcovCR, respectively. The summary method works on objects where the type of the standard errors has already been set by robustify. The robust.summary function works on unadjusted objects. Thus, robust.summary(x, ...) is a shorthand for summary(robustify(x, ...)).

For robust.summary, if the cluster option is specified, clustered robust standard errors are used based on the variance-covariance matrix from vcovCR with clustering on cluster. If not, robust standard errors are used based on the variance-covariance matrix from vcovHC.

See Also

See Also robustify, vcovHC, vcovCR and coeftest.

Examples

Run this code
# NOT RUN {
## With clustering
clotting <- data.frame(
    cl = 1:9,
    u = c(5,10,15,20,30,40,60,80,100),
    lot = c(118,58,42,35,27,25,21,19,18,
            69,35,26,21,18,16,13,12,12))
clot.model <- glm(lot ~ log(u), data = clotting, family = Gamma)
robust.summary(clot.model, cluster=cl)

## Without clustering
data(swiss)
model1 <- lm(Fertility ~ ., data = swiss)
robust.summary(model1)
model1r <- robustify(model1)
summary(model1r)
# }

Run the code above in your browser using DataLab