cluster.robust.se: cluster.robust.se

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

Description

Computes cluster robust standard errors for a two-stage least squares instrumental variable analysis.

Usage

1
cluster.robust.se(ivmodel, clusterid)

Arguments

ivmodel

A model object fit using the ivreg command from the AER package.

clusterid

A vector that contains an identifier for the cluster of each subject.

Details

The standard errors are computed using the method of White (1982) that assumes observations within a cluster may be dependent but the clusters are independent.

Value

Coeffient estimates, cluster robust standard errors and p-values using cluster robust standard errors.

Author(s)

Dylan Small

References

White, H. (1982), Instrumental Variables Regression with Independent Observations, Econometrica, 50, 483-499.

See Also

ivreg

Examples

1
2
3
4
5
6
7
8
# For Card's data, fit an IV model of log wage on the treatment variable (education) 
# using the IV nearc4, with measured covariates (included exogenous variables) 
# exper, expersq, black, south, smsa, smsa66
data(card.data)
ivmodel=ivreg(lwage ~ educ + exper + expersq + black + south + smsa + smsa66, 
~ nearc4 + exper + expersq + black + south + smsa + smsa66, x=TRUE, data=card.data)
# Compute cluster robust standard errors when the clustering is by region
cluster.robust.se(ivmodel, card.data$region)

Example output

Loading required package: AER
Loading required package: car
Loading required package: carData
Loading required package: lmtest
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: sandwich
Loading required package: survival
[1] "Cluster Robust Standard Errors"

t test of coefficients:

               Estimate  Std. Error t value  Pr(>|t|)    
(Intercept)  3.97684608  0.83943970  4.7375 2.264e-06 ***
educ         0.11877444  0.05022730  2.3647  0.018106 *  
exper        0.10194549  0.01850452  5.5092 3.909e-08 ***
expersq     -0.00227778  0.00041633 -5.4711 4.840e-08 ***
black       -0.14290368  0.04585875 -3.1162  0.001849 ** 
south       -0.10836674  0.04309316 -2.5147  0.011965 *  
smsa         0.12666726  0.02848766  4.4464 9.049e-06 ***
smsa66       0.01739923  0.02062639  0.8435  0.398993    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

ivpack documentation built on May 2, 2019, 7:28 a.m.