# 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.).

155 questions
Filter by
Sorted by
Tagged with
9 views

### r quantreg - quantile regression with clustered standard errors

I fit a quantile regression using quantreg:::rq on clustered data. I use the Huber sandwich estimator to obtain cluster-corrected standard errors, which is ...
21 views

### Obtaining clustered standard errors with speedglm package (Using speedglm with multiwayvcov + lmtest + broom)

I would like to use speedglm::speedglm() provided it is much faster than stats::glm(). Here's a MWE limited to 1000 rows of the ...
52 views

### calculate Standard Error of mean of (means over distinct distributions)?

As a motivating example, I want to pick the best racecar. The best racecar is the one that has the highest mean speed across 3 different racetracks (each racetrack is weighted equally). If I take ...
23 views

### Random effects and cluster-robust standard errors

I have read that when one adopts Random Effects (RE) there is no need to include cluster-robust standard errors because of the structure and functioning of the RE model itself. Could anyone please ...
32 views

### Combining Error Terms into a General Error Term

Lets say I have 4 error terms: $$e_1,e_2,e_3,e_4$$ Each of these error terms come from different simulations of data using different classification methods. Let $\gamma$ be the number of empirical ...
17 views

### Cluster standard errors at the individual level in a panel

I am replicating findings of a paper that uses a panel of US counties. The baseline specification is a regression like this: $$Y_{zit} = T_{zit} + X_{zt} + a_{t} + b_{i} + u_{zit}$$ Where Y is an ...
34 views

### R package: Quantile regression with multiple group fixed effects and clustered standard error for more than 1 million data points [closed]

Could you please suggest R package for quantile regression that can include group fixed effects and clustered standard error for more than 1 million data points? I am afraid that ...
26 views

### Cluster issues for treatment effects analysis

I'm doing a Difference in Differences exercises on 32 regions within a country to test for the effect of a policy intervention. However, only 1 of those regions has been subject to the intervention; ...
37 views

### Intuition behind clustering standard errors

Intuitively, why does a lack of clustering standard errors lead to erroneously smaller standard errors? Looking at the calculations and seeing the difference between SEs that are clustered and not ...
54 views

### If fixed effects and robust standard errors both necessary, do they have to be at the same level, and why?

I am working on an empirical paper using repeated cross-sectional data, and a reviewer has asked that we cluster our standard errors at the same level as our geographic fixed effects. Given the ...
31 views

### Fixed-effects using demeaned data: Why different standard errors when using xt/reg?

My question is equivalent to this post: Fixed-effects using demeaned data: why different standard errors when using -plm-? which asks for getting the same SE in time demeaned regression as in fixed ...
65 views

### How to cluster standard errors (which unit to cluster over?)

I'm working on a cross-country study where I look at the impact of different regulatory variables on bank stability (so the dependent variable is at the country-bank-year level and the variable of ...
22 views

### Difference-in-difference: standard errors in nonparametric estimation and linear regression

It is well known that we can use a linear regression model to calculate the DiD estimate. I followed this website and created a simulation dataset. ...
61 views

### How are clustered standard errors and Newey-West errors related

As the question says, how are the two concepts related? As far as I understand, both approaches correct for heteroscedasticity and autocorrelation. Yet, they are different. Would applying one of the ...
136 views

### R plm cluster robust standard errors with multiple imputations

I am looking for a way to implement (country) clustered standard errors on a panel regression with individual fixed effects. That is, in plm() I want to define some ...
97 views

### Comparing clustering of standard errors between felm and feols functions

I'm using the lfe and fixest packages to run regressions with high-dimensional fixed effects. For these regressions, I would ...
62 views

### Variance Inflation Factors for a glm with clustered standard errors

I am using the glm.cluster function in R package miceadds and I would like to calculate the variance inflation factors (VIF), much as the vif function in R package car does. If I try to use car::vif I ...
56 views

### Replicating results with multiway clustering

I am trying to replicate table 2 of Nunn and Wantchekon (2011) (the paper data is available online). It involves a linear regression with fixed effects and adjusting for two-way clustering. The code ...
231 views

23 views

### Is it a problem if cluster sizes vary wildly in a cluster-randomized experiment?

Consider a cluster-randomized experiment. There are 4,000 clusters and 2,000,000 observations. The dependent variable y is dichotomous, $Y \in \{0, 1\}$, and ...
68 views

### Clustering without test set and evaluation

I have to classify some data without any futher prediction (I just need the best clusters on the data). Do I still have to train-test-split my data or do a kfoldCV? And how do I evaluate my ...
154 views

### FE and clustered standard errors for a panel with firms, industries and years

I have an unbalanced panel of firms, years and industries. (1) At the moment I am running a panel regression with years and industries FE. My understanding is that I am counting for any omitted ...
178 views

### Adjusting for clustering and overdispersion in count models

My question is specific to the estimation of glm's and correcting for 'clustering' in a quasi-experiment (difference-in-differences). My outcome is counts of crimes....
105 views

### Replication of Stata commnad in R

I am not very good at working in R, usually I am working with stata. I just need to replicate one study in R. The command, which I need to replicate from Stata is : ...
20 views

### (How) can “de-meaning” help me solve this “clustering” issue?

I'm not particularly advanced when it comes to statistics and data analysis and have a problem I can't seem to solve. Basically, suppose you're doing school research and have three groups (to which ...
244 views

### Rearranging a Regression equation

I have what is probably a simple regression question but I thought I should ask since I don't have anywhere to verify it. I have an equation similar to as follows: $x_t = x_{t-1} + \alpha.Price_t$ ...
1k views

### Clustered standard errors - Why are SE smaller or bigger than OLS depending on cluster level?

I am analyzing some data using an OLS model. Data represent managers working for US cities. Within each city, we surveyed more than one manager (max 5). Multiple cities per state were surveyed. I'd ...
102 views

### Are Poisson Regressions with Serial Correlation Biased or Inconsistent? (No Fixed Effects)

Let's say I've got panel data where a count outcome $y$ and continuous independent variable $x$ observed each time period $t=(1,2,...T)$ for each individual $i$. I am interested in how $x_{it}$ ...
508 views

### Cluster-robust standard errors in panel data analysis

In a simple panel data analysis with data on 64 firms over 8 years, I use cluster-robust standard errors (at the firm level) to evaluate significance of coefficients. I observe important differences ...
2k views

### How should clustering be accounted for in logistic regression, when there are very few clusters?

I have survey data from 1000 patients. This is a convenience venue-based sample. In a specific city, at 9 hospitals that happen to have a psychosocial program, patients can opt into the program if ...