cluster.im.ivreg: Cluster-Adjusted Confidence Intervals And p-Values For GLM

Description Usage Arguments Value Note Author(s) References Examples

View source: R/clusterIM.ivreg.R

Description

Computes p-values and confidence intervals for GLM models based on cluster-specific model estimation (Ibragimov and Muller 2010). A separate model is estimated in each cluster, and then p-values and confidence intervals are computed based on a t/normal distribution of the cluster-specific estimates.

Usage

1
2
3
4
5
6
7
8
9
cluster.im.ivreg(
  mod,
  dat,
  cluster,
  ci.level = 0.95,
  report = TRUE,
  drop = FALSE,
  return.vcv = FALSE
)

Arguments

mod

A model estimated using ivreg.

dat

The data set used to estimate mod.

cluster

A formula of the clustering variable.

ci.level

What confidence level should CIs reflect?

report

Should a table of results be printed to the console?

drop

Should clusters within which a model cannot be estimated be dropped?

return.vcv

Should a VCV matrix and the means of cluster-specific coefficient estimates be returned?

Value

A list with the elements

p.values

A matrix of the estimated p-values.

ci

A matrix of confidence intervals.

Note

Confidence intervals are centered on the cluster averaged estimate, which can diverge from original model estimates under several circumstances (e.g., if clusters have different numbers of observations). Consequently, confidence intervals may not be centered on original model estimates. If drop = TRUE, any cluster for which all coefficients cannot be estimated will be automatically dropped from the analysis.

Author(s)

Justin Esarey

References

Esarey, Justin, and Andrew Menger. 2017. "Practical and Effective Approaches to Dealing with Clustered Data." Political Science Research and Methods forthcoming: 1-35. <URL:http://jee3.web.rice.edu/cluster-paper.pdf>.

Ibragimov, Rustam, and Ulrich K. Muller. 2010. "t-Statistic Based Correlation and Heterogeneity Robust Inference." Journal of Business & Economic Statistics 28(4): 453-468. <DOI:10.1198/jbes.2009.08046>.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

# example: pooled IV analysis of employment
require(plm)
require(AER)
data(EmplUK)
EmplUK$lag.wage <- lag(EmplUK$wage)
emp.iv <- ivreg(emp ~ wage + log(capital+1) | output + lag.wage + log(capital+1), data = EmplUK)

# compute cluster-adjusted p-values
cluster.im.e <- cluster.im.ivreg(mod=emp.iv, dat=EmplUK, cluster = ~firm)


## End(Not run)

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
Loading required package: Formula
Loading required package: plm

 When using this package, cite: 
 
 Justin Esarey and Andrew Menger (2017). 
 "Practical and Effective Approaches to Dealing with Clustered Data." 
 Political Science Research and Methods, FirstView, 1-35. 
 URL: https://doi.org/10.1017/psrm.2017.42. 


 Cluster-Adjusted p-values:  
 
           variable name   cluster-adjusted p-value
             (Intercept)                       0.55
                    wage                      0.318
        log(capital + 1)                          0

 Confidence Intervals (centered on cluster-averaged results): 
 
sh: 1: rm: Permission denied
     variable name             CI lower            CI higher
       (Intercept)    -9.47841536907413     5.06769443757235
              wage   -0.143569243198717   0.0470149264137484
  log(capital + 1)     5.21678510104133     10.6217303912767

clusterSEs documentation built on April 6, 2021, 1:06 a.m.