Dear Stata users,
I have trouble to run the command “reg” for a model with thousands of dummies. Would really appreciate if you can help me out. Thank you in advance for your help. Below are more details,
Task: generate school value-added measures with standard errors for an education project
Commands:
Num. of obs. in my sample: about 887,000
Thank you again for your help!
Best,
Lihan Liu
I have trouble to run the command “reg” for a model with thousands of dummies. Would really appreciate if you can help me out. Thank you in advance for your help. Below are more details,
Task: generate school value-added measures with standard errors for an education project
Commands:
- codes: reg posttest pretest i.year_sch [pw=weight]
- year_sch represents school/year. It produces school value-added measures with standard errors.
- “too many variables specified”
- There’re in total 6400 unique school/year in my sample. “Reg” does work when I cut my sample and reduce the number of unique school/year to 5000. So I think the problem seems very clear. Stata does not allow “reg” to run with so many dummies.
- My current coding strategies involve two steps. First, I use “reg” to estimate school value-added measures. However, “reg” computes fixed effects relative to some arbitrary holdout unit (e.g. a school/year), which can produce incorrect standard errors. Thus, in the second step, I use “Contrast” to normalize fixed-effects to grand mean and computes their standard errors.
- For the estimation stage, I considered other stata commands but failed to find anyone worked. “Areg” does not produce standard errors. More importantly, areg does not work with contrast, because areg treats school/year as a factor variable. xtreg does not work neither because it requires constant weight within panel (school/year), which is not true in our case.
- For the normalization stage, I considered command “Felsdvregdm”. But it does not allow for weights, which are important to our project.
- Is my understanding of the error report correct? “Reg” does work when I cut my sample and reduce the number of unique school/year to 5000. So I think the problem seems very clear. Stata does not allow “reg” to run with so many dummies.
- The online stata guide says that the Maximum right-hand-side variables for stata MP is 10,998. In my sample, there are only 6400 unique school/years. Why doesn’t “reg” work? FYI: http://www.stata.com/products/which-...-right-for-me/
- How can I fix the problem using “reg”?
- Or are there other commands I should consider?
Num. of obs. in my sample: about 887,000
Thank you again for your help!
Best,
Lihan Liu
Comment