Dear Statalist,
I have a basic setup of a cross-sectional sample of individuals nested in regions. I am interested in estimating how, for example, the number of natural disasters in region j is associated with the likelihood of voting against the incumbents (binary outcome).
Problem: In my main model, I had naively run a simple logistic regression including my level two predictor , i.e. the number of natural disasters, and regional dummies, i.e. fixed effects, and Stata presented coefficient estimates for both. I have now found out that the coefficients of my level two variable should be non-estimable when including the fixed effects for the region (Schunk, 2017, p. 8 and McNeish, 2023, p. 8).
Questions: I would like to know if a) I misunderstood something and b) if my understanding is correct, what problem the regional dummies introduce? Since Stata provices estimates of the coefficients, the claim that the effect of level two variables are non-estimable seems wrong. If this were the case, I would expect a . as estimate for my level two coefficient. Is it simply that the estimate of level two predictors, number of natural disasters, is heavily biased with fixed effects? In my original regression, the coefficients for my level two predictor vary substantially between the regression withou (beta = 0.88) and without a fixed effect dummies (beta = 0.07).
Below is an MRE recreating a data-generating process similar to my question. I use the community-contributed esttab for saving the regressions, but I am unsure about the construction of y:
References
McNeish, D. (2023). A practical guide to selecting and blending approaches for clustered data: Clustered errors, multilevel models, and fixed-effect models. Psychological Methods. https://doi.org/10.1037/met0000620
Schunck, R., & Perales, F. (2017). Within- and Between-cluster Effects in Generalized Linear Mixed Models: A Discussion of Approaches and the Xthybrid command. The Stata Journal: Promoting Communications on Statistics and Stata, 17(1), 89–115. https://doi.org/10.1177/1536867X1701700106
I have a basic setup of a cross-sectional sample of individuals nested in regions. I am interested in estimating how, for example, the number of natural disasters in region j is associated with the likelihood of voting against the incumbents (binary outcome).
Problem: In my main model, I had naively run a simple logistic regression including my level two predictor , i.e. the number of natural disasters, and regional dummies, i.e. fixed effects, and Stata presented coefficient estimates for both. I have now found out that the coefficients of my level two variable should be non-estimable when including the fixed effects for the region (Schunk, 2017, p. 8 and McNeish, 2023, p. 8).
Questions: I would like to know if a) I misunderstood something and b) if my understanding is correct, what problem the regional dummies introduce? Since Stata provices estimates of the coefficients, the claim that the effect of level two variables are non-estimable seems wrong. If this were the case, I would expect a . as estimate for my level two coefficient. Is it simply that the estimate of level two predictors, number of natural disasters, is heavily biased with fixed effects? In my original regression, the coefficients for my level two predictor vary substantially between the regression withou (beta = 0.88) and without a fixed effect dummies (beta = 0.07).
Below is an MRE recreating a data-generating process similar to my question. I use the community-contributed esttab for saving the regressions, but I am unsure about the construction of y:
Code:
clear all set seed 56 set obs 1000 gen id = _N gen rand = runiform() * IVs sort rand gen region = ceil(_n/20) bysort region: gen leveltwo = rpoisson(1) if _n == 1 bysort region: replace leveltwo = leveltwo[1] gen age = runiformint(18,60) gen sex = runiformint(0,1) * DVs gen linpred = -0.4+2*leveltwo+0.05*age+1.5*sex gen p = invlogit(linpred) gen y = (runiform() < p) ** Regressions * Run a logistic regression eststo m1: logistic y leveltwo age sex * Run a logistic regression with fixed effects eststo m2: logistic y leveltwo age sex i.region * Run a mulitlevel model eststo m3: melogit y leveltwo age sex || region: * Run a multilevel model with region fixed effects eststo m4: melogit y leveltwo age sex i.region || region: ** Reporting esttab m1 m2 m3 m4, eform
McNeish, D. (2023). A practical guide to selecting and blending approaches for clustered data: Clustered errors, multilevel models, and fixed-effect models. Psychological Methods. https://doi.org/10.1037/met0000620
Schunck, R., & Perales, F. (2017). Within- and Between-cluster Effects in Generalized Linear Mixed Models: A Discussion of Approaches and the Xthybrid command. The Stata Journal: Promoting Communications on Statistics and Stata, 17(1), 89–115. https://doi.org/10.1177/1536867X1701700106

Comment