robust_mixed | R Documentation |
Function to compute the CR2/CR0 cluster robust standard errors (SE) with Bell and McCaffrey (2002) degrees of freedom (dof) adjustments. Suitable even with a low number of clusters. The model based (mb) and cluster robust standard errors are shown for comparison purposes.
robust_mixed(m1, digits = 3, type = "CR2", satt = TRUE, Gname = NULL)
m1 |
The |
digits |
Number of decimal places to display. |
type |
Type of cluster robust standard error to use ("CR2" or "CR0"). |
satt |
If Satterthwaite degrees of freedom are to be computed (if not, between-within df are used). |
Gname |
Group/cluster name if more than two levels of clustering (does not work with lme). |
A data frame (results
) with the cluster robust adjustments with p-values.
Estimate |
The regression coefficient. |
mb.se |
The model-based (regular, unadjusted) SE. |
cr.se |
The cluster robust standard error. |
df |
degrees of freedom: Satterthwaite or between-within. |
p.val |
p-value using CR0/CR2 standard error. |
stars |
stars showing statistical significance. |
Francis Huang, huangf@missouri.edu
Bixi Zhang, bixizhang@missouri.edu
Bell, R., & McCaffrey, D. (2002). Bias reduction in standard errors for linear regression with multi-stage samples. Survey Methodology, 28, 169-182. (link)
Liang, K.Y., & Zeger, S. L. (1986). Longitudinal data analysis using generalized linear models. Biometrika, 73(1), 13-22. (link)
require(lme4)
data(sch25, package = 'CR2')
robust_mixed(lmer(math ~ male + minority + mses + mhmwk + (1|schid), data = sch25))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.