Learn R Programming

clusterSEs (version 1.0)

cluster.wild: Wild Cluster Bootstrapped p-Values for Linear Family GLM

Description

This software estimates p-values using wild cluster bootstrapped t-statistics for linear family GLM models (Cameron, Gelbach, and Miller 2008). Residuals are repeatedly re-sampled by cluster to form a pseudo-dependent variable, a model is estimated for each re-sampled data set, and inference is based on the sampling distribution of the pivotal (t) statistic.

Usage

cluster.wild(mod, dat, cluster, boot.reps = 1000, report = TRUE,
  prog.bar = TRUE)

Arguments

mod
A linear (identity link) model estimated using glm.
dat
The data set used to estimate mod.
cluster
A formula of the clustering variable.
boot.reps
The number of bootstrap samples to draw.
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.

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 prestige score of occupation
require(effects)
data(BEPS)
linear.model <- glm(Europe ~ age + gender + economic.cond.national, data=BEPS)
summary(linear.model)

# compute wild cluster bootstrapped p-values
clust.wd.p <- cluster.wild(linear.model, BEPS, ~ vote, report = T)

Run the code above in your browser using DataLab