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

Filter by
Sorted by
Tagged with
1
vote
0answers
8 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 ...
0
votes
0answers
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 ...
1
vote
1answer
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 ...
0
votes
0answers
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 ...
3
votes
1answer
197 views

Clustered standard errors and time dummies in panel data

Assume a simple linear regression model, I have $i$ firms and $t=17$ periods $$Y_{it}=\alpha + \beta_2 T_2 + \beta_3 T_3 + \cdots + \beta_{16} T_{16} + \gamma_i + \varepsilon_{it}$$ In this case, $t=...
0
votes
1answer
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 ...
0
votes
0answers
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 ...
0
votes
0answers
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; ...
1
vote
0answers
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 ...
1
vote
1answer
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 ...
1
vote
1answer
344 views

Fixed effect and clustering with 3 dimensional data

I have a sample of banks. These vary across time, rating agency and across countries. UPDATE: I trying to capture the effect of a regulatory change (dummy variable, 0/1) on a banks credit rating. I ...
1
vote
1answer
53 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 ...
0
votes
1answer
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 ...
2
votes
1answer
57 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 ...
0
votes
1answer
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 ...
1
vote
0answers
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. ...
1
vote
0answers
130 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 ...
0
votes
1answer
96 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 ...
0
votes
1answer
60 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 ...
0
votes
0answers
54 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 ...
2
votes
1answer
228 views

How to block bootstrap in stata with set of dummy variables as controls

I want to estimate a Multiple multivariate regression of the type $$y_1=a_1+b_1*x+c_1*\text{countrydummies}+e_1 \\ y_2=a_2+b_2*x+c_2*\text{countrydummies}+e_2 \\ ... \\ y_N=a_N+b_N*x+c_N*\text{...
0
votes
0answers
15 views

performing a multilevel logistic regression: data naturally clustered but small clusters, singletons and limited number of 2nd level clusters: help?

I am looking to perform a binomial regression calculating the reselection chances of parliamentarians in the European Parliament based on their activity levels. DV= reselection: 0/1. My data is ...
0
votes
0answers
16 views

Adjusting standard errors for *both* heteroskedasticity and clusters in MATLAB?

My data is not exactly a panel, so I can't use the Panel Data Toolbox. It is over time (years) but not for the same industries. For example I have multiple rows with same industry in one year, and ...
0
votes
1answer
242 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$ ...
0
votes
0answers
14 views

How to decide SE clustering unit?

I am working with survey panel data. I believe I should be clustering standard error, but I am confused as to which would be the right dimension. Is there a way to make an informed choice (by looking ...
1
vote
1answer
58 views

Strange looking funnel plot after computing cluster robust standard errors

I fitted the following hierarchical mixed-effects meta-analytic model using rma.mv() in the metafor R package. mod<-rma.mv(yi=yi, V=vi, mods=~ region + subtype, random = ~ 1 |study/id, data = es, ...
0
votes
1answer
84 views

difference in difference fixed effect vs clustered standard error

I am trying to run a difference-in-difference regression. I have one country in the treatment group and two countries in the control group. I believe there is a need to account for fixed effects to ...
1
vote
2answers
184 views

Does it make sense to use clustered standard errors outside of a regression framework?

I am unsure about how to proceed in the following context. Here is some toy data from R: ...
3
votes
1answer
1k views

Clustered (grouped) standard errors MLE in R

I'm doing the following maximum likelihood estimation using mle2 function from bbmle package: ...
3
votes
1answer
170 views

How to cluster standard errors when fitting a model using maximum likelihood estimation in R?

I am estimating several parameters using the mle() function with the L-BFGS-B method in R to data from an experiment in which participants had to make multiple choices. My goal is to obtain population ...
0
votes
0answers
31 views

Cluster Standard errors with plm at higher level than group

my model suffers from autocorrelation, thus I wanted to cluster the SEs. I have firm level, industry level and country level observations in my model. A paper that I am following clustered the Ses at ...
0
votes
0answers
80 views

How to deal with overlapping observations in a regression?

I estimate model $Y_{i,(t+1)\rightarrow (t+6)} = \alpha + \beta \cdot X_{i,(t-11)\rightarrow t} + \epsilon_{i,(t+1)\rightarrow (t+6)},$ where $i$ is a firm, and $t$ is a month. Since the dependent ...
1
vote
1answer
44 views

One sample t-test with Groups?

I wish to find the mean dollar value in my data while properly accounting for different groups. Say for example I have a set of data as follows: ...
0
votes
0answers
16 views

Multilevel versus clusteredness in the sample

does anyone can explain to me the main differences between multilevel estimations and clustering correction? I think with HLM technique we can get estimation to the random parameters (the group level ...
0
votes
1answer
137 views

Comparing Polynomial and Linear Model

I have a panel data with unbalanced panel. I am testing a non-linear relationship. I tested a polynomial(quadratic) model for this purpose with following codes in stata. ...
2
votes
1answer
173 views

How can the clustered robust standard errors be smaller than the model based ones?

I ran a GEE model and I used it to check the difference between the empirical standard errors and the model-based one. For almost the variables, the empirical standard error was greater than the OLS ...
2
votes
1answer
80 views

Replicate Stata 'variance' and 'robust' in R for mixed effects methods [closed]

I am working with a small dataset of clustered data. The experiment is on mice, testing the efficacy of a substance for neurons cells within mice, and delivery of a fatty acid substance between mice. ...
0
votes
0answers
63 views
1
vote
1answer
1k views

Double-clustered standard errors and large panel

I have a large panel data set featuring the purchases of 5000+ individuals over 2000+ time periods (days). I am looking to estimate pooled OLS regressions featuring double-clustered standard errors (...
0
votes
1answer
11 views

multilevel modeling or clustered SE when there is only one group

I am having a hard time deciding which modeling approach I should take. I have a survey data from a random sample from New York City. I want to explore the effect of NYC's number of crime incidence (...
2
votes
0answers
24 views

Standard error clustering: Does it depend on the variable of interest?

Suppose I am interested in whether a students age affects their performance, and I run the following regression: $performance(i) = \beta_1 age(i) + \beta_2 Female(i)+\beta_3 classsize(i)+\varepsilon(...
1
vote
2answers
3k views

R | Robust standard errors in panel regression clustered at level != Group Fixed Effects

I want to run a regression on a panel data set in R, where robust standard errors are clustered at a level that is not equal to the level of fixed effects. That is, I have a firm-year panel and I want ...
0
votes
1answer
880 views

Test for serial correlation in fixed effects model

I am currently studying panel data. I am using fixed effects estimators with cluster robust standard errors to account for the possibility of heteroskedasticity/serial correlation in the error terms. ...
2
votes
0answers
74 views

Variance-covariance matrix of individual fixed-effects seems to be biased by clustering

For some reasons, I am interested in the variance-covariance matrix of the individual fixed-effects when regressing wages on personal characteristics: $Y_{i,t} = X_{i,t} \times \beta + c_i + \epsilon_{...
5
votes
2answers
136 views

A Simple Formula for Clustered Standard Errors for a Univariate Regression with a Dummy Regressor

Suppose I have a simple cross-sectional regression like: $$y_i = \alpha + \beta \cdot D_i + \varepsilon_i,$$ where $D_i$ is a binary treatment flag and $i$ indexes individuals. $\beta$ is the ...
0
votes
1answer
409 views

Correct standard error and p-values for Bradley-Terry model applied to ranking data (“rank-breaking”)

One way to analyze ranking data is to use the Bradley-Terry data by converting ranks to pairwise comparisons (e.g. a>b>c becomes a>b, b>c, a>c) This is called "rank-breaking" in the machine learning ...
1
vote
0answers
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 ...
2
votes
1answer
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 ...
2
votes
1answer
471 views

Does “coeftest” correctly use weights from “svydesign” in “svyglm” object

I am using data from the European Social Survey (ESS) and I would like to calculate country-level cluster-robust standard errors for a regression model in R that includes country fixed effects and ...
24
votes
3answers
44k views

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