Learn R Programming

clusterSEs (version 2.2)

cluster.bs.plm: Pairs Cluster Bootstrapped p-Values For PLM

Description

This software estimates p-values using pairs cluster bootstrapped t-statistics for fixed effects panel linear models (Cameron, Gelbach, and Miller 2008). The data set is repeatedly re-sampled by cluster, a model is estimated, and inference is based on the sampling distribution of the pivotal (t) statistic.

Usage

cluster.bs.plm(mod, dat, cluster = "group", ci.level = 0.95,
  boot.reps = 1000, cluster.se = TRUE, report = TRUE, prog.bar = TRUE)

Arguments

mod
A "within" model estimated using plm.
dat
The data set used to estimate mod.
cluster
Clustering dimension ("group", the default, or "time").
ci.level
What confidence level should CIs reflect?
boot.reps
The number of bootstrap samples to draw.
cluster.se
Use clustered standard errors (= TRUE) or ordinary SEs (= FALSE) for bootstrap replicates.
report
Should a table of results be printed to the console?
prog.bar
Show a progress bar of the bootstrap (= TRUE) or not (= FALSE).

Value

  • A list with the elements
  • p.valuesA matrix of the estimated p-values.
  • ciA matrix of confidence intervals.

References

Cameron, A. Colin, Jonah B. Gelbach, and Douglas L. Miller. 2008. "Bootstrap-Based Improvements for Inference with Clustered Errors." The Review of Economics and Statistics 90(3): 414-427.

Examples

Run this code
# predict employment levels, cluster on group
require(plm)
data(EmplUK)

emp.1 <- plm(emp ~ wage + log(capital+1), data = EmplUK, 
             model = "within", index=c("firm", "year"))
cluster.bs.plm(mod=emp.1, dat=EmplUK, cluster="group", ci.level = 0.95, 
          boot.reps = 1000, cluster.se = TRUE, report = TRUE, 
          prog.bar = TRUE)

# cluster on time

cluster.bs.plm(mod=emp.1, dat=EmplUK, cluster="time", ci.level = 0.95, 
            boot.reps = 1000, cluster.se = TRUE, report = TRUE, 
            prog.bar = TRUE)

Run the code above in your browser using DataLab