Last data update: 2014.03.03

R: Cluster-Adjusted Confidence Intervals And p-Values For GLM
cluster.im.glmR Documentation

Cluster-Adjusted Confidence Intervals And p-Values For GLM

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

cluster.im.glm(mod, dat, cluster, ci.level = 0.95, report = TRUE,
  drop = FALSE, truncate = FALSE)

Arguments

mod

A model estimated using glm.

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?

truncate

Should outlying cluster-specific beta estimates be excluded?

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 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. If truncate = TRUE, any cluster for which any coefficient is more than 6 times the interquartile range from the cross-cluster mean will also be dropped as an outlier.

Author(s)

Justin Esarey

References

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

## Not run: 

# example: predict whether respondent has a university degree
require(effects)
data(WVS)
logit.model <- glm(degree ~ religion + gender + age, data=WVS, family=binomial(link="logit"))
summary(logit.model)

# compute cluster-adjusted p-values
clust.im.p <- cluster.im.glm(logit.model, WVS, ~ country, report = T)


## End(Not run)

Results