I've been working on the data over the past few months but I am back to this same set of issues with the regressions.
To clarify, I am attempting to complete a fractional regression that contains fixed-effects on an unbalanced panel of districts (N: 5480) within states (N: 48) over years (N: 126).
I tried looking at glm for this case but it appears that it does logit for the binary outcome variable, but not fractional as proportions - is that right? I did find another fracglm but I can't see that it does anything different from fracreg in my case.
I've tried subsampling to see if I can get to equivalent results various ways and they don't seem to line up. I'm not quite sure what I'm missing. Here are results from a 3-year subsample so I can run the effects as dummies and compare:
1. Using CRE to absorb district and state-by-year variables which I understood from previous notes should produce iteratively demeaned results equivalent to fixed-effects (reghdfe does work for the linear case and my understanding was cre just runs reghdfe in the background?):
Which gets me:
2. Just adding these as categorical dummies:
gets me:
What am I missing?
To clarify, I am attempting to complete a fractional regression that contains fixed-effects on an unbalanced panel of districts (N: 5480) within states (N: 48) over years (N: 126).
I tried looking at glm for this case but it appears that it does logit for the binary outcome variable, but not fractional as proportions - is that right? I did find another fracglm but I can't see that it does anything different from fracreg in my case.
I've tried subsampling to see if I can get to equivalent results various ways and they don't seem to line up. I'm not quite sure what I'm missing. Here are results from a 3-year subsample so I can run the effects as dummies and compare:
1. Using CRE to absorb district and state-by-year variables which I understood from previous notes should produce iteratively demeaned results equivalent to fixed-effects (reghdfe does work for the linear case and my understanding was cre just runs reghdfe in the background?):
Code:
egen state_year = group (state yr) cre, abs (dist state_year) prefix(fixed) keep keepsingletons: regress y x, cluster(dist) fracreg logit y x fixed*, vce(cl dist) margins, dydx(*) post
Code:
Average marginal effects Number of obs = 1,213 Model VCE: Robust Expression: Conditional mean of y, predict() dy/dx wrt: x fixed1_x fixed2_x ------------------------------------------------------------------------------ | Delta-method | dy/dx std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- x | -.0092139 .0296722 -0.31 0.756 -.0673703 .0489426 fixed1_x | .0021522 .029974 0.07 0.943 -.0565957 .0609001 fixed2_x | -.0069721 .030177 -0.23 0.817 -.066118 .0521738 ------------------------------------------------------------------------------
Code:
fracreg logit y x i.dist i.state#i.yr, vce(cl dist) margins, dydx(*) post
Code:
Average marginal effects Number of obs = 1,213 Model VCE: Robust Expression: Conditional mean of y, predict() dy/dx wrt: (I have omitted this for brevity) --------------------------------------------------------------------------------- | Delta-method | dy/dx std. err. z P>|z| [95% conf. interval] ----------------+---------------------------------------------------------------- x | -.0037571 .0295284 -0.13 0.899 -.0616317 .0541175
Comment