Learn R Programming

clusterSEs (version 1.2)

cluster.im.mlogit: Cluster-Adjusted Confidence Intervals and p-Values for mlogit

Description

Computes p-values and confidence intervals for multinomial logit 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.mlogit(mod, dat, cluster, ci.level = 0.95, report = TRUE,
  truncate = FALSE)

Arguments

mod
A model estimated using mlogit.
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?
truncate
Should outlying cluster-specific beta estimates be excluded?

Value

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

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.

Examples

Run this code
# predict method of hospital admission
require(VGAMdata)
data(vtinpat)

# to save time, take a sample of this data
set.seed(32149)
idx <- sample(1:dim(vtinpat)[1], 5000, replace=F)
vtinpat <- vtinpat[idx,]

vtinpat$hos.num <- as.numeric(vtinpat$hospital)
vtinpat$age <- as.numeric(vtinpat$age.group)
vtinpat.mlogit <- mlogit.data(vtinpat, choice = "admit", shape="wide")
vt.mod <- mlogit(admit ~ 0 | age + sex, data = vtinpat.mlogit)
summary(vt.mod)

# compute cluster-adjusted p-values (takes a while)
clust.p <- cluster.im.mlogit(vt.mod, dat=vtinpat.mlogit, cluster = ~ hos.num,
           ci.level = 0.95, report=TRUE, truncate=TRUE)

Run the code above in your browser using DataLab