Questions tagged [clustered-standard-errors]

Clustered standard errors represent the version of the general sandwich variance estimator that correct for (potential) grouping of the observations, e.g., repeated measurements clustered within an individual, or individuals clustered within a hierarchy level (geographical region, educational institution, etc.).

Clustered standard errors represent the version of the general sandwich variance estimator that correct for (potential) grouping of the observations, e.g., repeated measurements clustered within an individual, or individuals clustered within a hierarchy level (geographical region, educational institution, etc.).

Clustered standard errors need to be used when a cluster sample was drawn, see cluster-sample. They are also used when correlations between units is suspected, so as to provide robust inference.

239 questions
46
votes
4 answers

Standard error clustering in R (either manually or in plm)

I am trying to understand standard error "clustering" and how to execute in R (it is trivial in Stata). In R I have been unsuccessful using either plm or writing my own function. I'll use the diamonds data from the ggplot2 package. I can do fixed…
44
votes
4 answers

When to use fixed effects vs using cluster SEs?

Suppose you have a single cross-section of data where individuals are located within groups (e.g. students within schools) and you wish to estimate a model of the form Y_i = a + B*X_i where X is a vector of individual level characteristics and a a…
23
votes
3 answers

How to fix the problem in this XKCD comic?

Slope Hypothesis Testing (Randall Munroe, xkcd ) The problem with this comic is obviously that the "measurements" are not independent, violating a key assumption for computing valid p-values. But I see also a possible problem with the fact that the…
lindelof
  • 1,139
20
votes
1 answer

Clustered standard errors vs. multilevel modeling?

I've skimmed through several books (Raudenbush & Bryk, Snijders & Bosker, Gelman & Hill, etc.) and several articles (Gelman, Jusko, Primo & Jacobsmeier, etc.), and I still haven't really wrapped my head around the major differences between using…
16
votes
0 answers

Penalized spline confidence intervals based on cluster-sandwich VCV

This is my first post here, but I've benefited a lot from this forum's results popping up in google search results. I've been teaching myself semi-parametric regression using penalized splines. Basically, $$ \hat{y} = X(X'X + \lambda D)^{-1}X'y $$…
16
votes
1 answer

OLS with clustered standard errors vs. multilevel modeling when the main interest is at the individual level

Possible Duplicate: Under what conditions should one use multilevel/hierarchical analysis? I have been reading various papers dealing with multilevel analysis, and to be honest, I am still confused re: choosing simple OLS regression or multilevel…
11
votes
2 answers

When are cluster robust standard errors a valid "alternative" to mixed models?

Background If we have data with multiple measurements per subject, I understand we must model or correct for the non-independence. I believe there are several approaches to doing this. One is a mixed effect model using subject ID as a random effect.…
10
votes
1 answer

Clustered standard errors and multi-level models

Stata allows estimating clustered standard errors in models with fixed effects but not in models random effects? Why is this? By clustered standard errors, I mean clustering as done by stata's cluster command (and as advocated in Bertrand, Duflo and…
9
votes
1 answer

Bootstrapping clusters in R

I am running a negative binomial regression of clinic counts in each county in the entire country (~3k counties). I'd like to at least partially account for the non-independence of neighboring counties by bootstrapping the confidence intervals in a…
9
votes
0 answers

Should I cluster my standard errors even when using a multilevel model?

I've been reading up on multilevel modeling, and have noticed that many sources seem to frame it as an "alternative" to using cluster-robust standard errors. My question: Are they really alternatives? In particular, let's say you have panel data…
9
votes
3 answers

panel data - within-group estimate - individual fixed effects retrieved

I am analyzing panel data. First, I have to decide whether to use a random or fixed effect estimator. The Hausman test suggests to use the fixed effect estimator (also named within group estimator). Thus, this is what I am using. However, this…
8
votes
1 answer

Are linear mixed effects model robust to unbalanced clusters?

We have fit the following model: m = lmer(y ~ time + event + time_since_event + (time|id), data = df) Some clusters have 1000+ data points, while others have fewer than 10. Does the lmer model take into account such cluster size imbalances? Are the…
8
votes
1 answer

Clustering standard errors in SEM (lavaan package)

I have data from an RCT with one control group and one treatment group and trying to explore mediators for changes in the outcome of interest (i.e. pathways of change). My final model is defined as follows: Pathway_final <- ' # measurement model…
8
votes
1 answer

cluster-robust standard errors are smaller than unclustered ones in fgls with cluster fixed effects

I'm currently working on some experimental data. The experimental design consists of two treatments. In each treatment, 20 subjects are randomly matched in pairs and participate to a simple game. The game is repeated for 20 periods. In each period,…
7
votes
0 answers

Adjusting Standard Error for Imputed/Generated Regressors

This is my first question, so I hope this is a valid question. I am surprised that I have seen only a few questions (and no answer helping me) referring to the adjustment of variance estimators in the case of imputed regressors because this is a…
1
2 3
…
15 16