ivpack (version 1.2)

cluster.robust.se: cluster.robust.se

Description

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

Usage

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.

Value

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

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.

References

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

See Also

ivreg

Examples

Run this code
# 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)

Run the code above in your browser using DataLab