View source: R/clustered-robust.R
robust.summary | R Documentation |
Output summary information using robust or clustered robust standard errors.
## S3 method for class 'robustified' summary(object, ...) robust.summary(x, cluster, type, omega, ...)
object |
An object of class |
x |
A model of class |
cluster |
The variable on which to cluster (if any). If this is not specified,
unclustered robust standard errors using |
type |
A character string specifying the estimation type. The default is to use the
defaults for |
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 |
... |
Any additional arguments to be passed to |
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
.
An object of class summary.robustified
containing
a coefficients
object computed using
coeftest
and the method
attribute
specifying the type of standard errors used.
See Also robustify
, vcovHC
, vcovCR
and coeftest
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.