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
How to count the number of observations at the min and max value?Given the data set, Find the average education level in the sample. What are the lowest and highest …
"Decode" Command on Numeric Variables - Grave IssuesHello, I am appending several rounds/datasets from different demographic and health surveys. The va…
How to interpret goodness of fit for multivariate logistic regression modelDear STATA technicians, I am Hatem Ali, STATA user. Serial number: 301506305680 I am attaching to t…
Comparing median at 2 pointsDear Stata users, I am wondering, is it possible to compare the median of continuous variable (V1-s…
How do I interpret interaction effects in a log-level regression model?My model: log(y)=β0 + β1x1 + β2log(x2) + β3x1log(x2). The x1 variable is endogenous and I instrume…
Subscribe to:
Post Comments (Atom)
0 Response to error r(2001) - insufficient observations
Post a Comment