Hello all,
I am working on a project regarding house prices, aggregated by grids and quarter, and I am trying to implement an event-study.
I am following the guidelines from Princeton, https://dss.princeton.edu/online_hel...ventstudy.html, and wrote the following command:
gen predicted_price=.
egen id=group(nid)
forvalues i=1(1)3469{
l id nid if id==`i' & var1==0
reghdfe norm_price x1 x2 x3 if id==`i' & estimation_window==1, a(nid quarter) vce(cluster nid quarter)
predict p if id==`i'
replace predicted_price = p if id==`i' & event_window==1
drop p
}
When I run it, I get the error r(2001) "insufficient observations". This is very puzzling as I have a very large dateset.
I then tried:
gen predicted_price=.
egen id=group(nid)
forvalues i=1(1)3469{
l id nid if id==`i' & var1==0
capture reghdfe norm_price x1 x2 x3 if id==`i' & estimation_window==1, a(nid quarter) vce(cluster nid quarter)
predict p if id==`i'
replace predicted_price = p if id==`i' & event_window==1
drop p
}
and got the error r(301) 'last estimates not found'.
If anyone could help me, I would greatly appreciate.
Thank you!
Related Posts with error r(2001) - insufficient observations
Negative independent valuesHello, For my research I am currently investigating the effect of financial ratios on the initial r…
bootstrap likelihood ratio OR Lo-Mendell-Rubin adjusted likelihood ratio testDear Statalisters, Please I am looking for your help to obtain the syntax in order to calculate boo…
Replacing missing values with the mean by group via a loopHello, I have a large dataset of 59,000,000 observations. There are a 50 variables each beginning …
how to export stata result to excel using table and tabstat command Sex usual_residence registered_place income_1 income_2 Male New York Washington Dc 2000 2112 …
Using rsens for sensitivity analysis after PSM Hi everyone, Just looking for some help carrying out a sensitivity analysis after psm. After carry…
Subscribe to:
Post Comments (Atom)
0 Response to error r(2001) - insufficient observations
Post a Comment