Dear All,
I need to estimate a model using a cross-sectional regression for each industry and year over the period 2009 to 2014. The data is a panel data.
I used the following code:
bysort year industry: gen nobs = _N
forval y = 2009(1)2014 {
forval i = 1(1)50 {
di "year = `y' and industry = `i'"
reg part1 part2 part3 part4 part5 if industry== `i' & year==`y' & nobs>10, noconstant
predict r if industry== `i' & year==`y' & nobs>10, resid
}
}
However, every time I run this regression I have an error (although I have few missing observations) :
no observations
r(2000);
I would really appreciate any advice regarding the code.
Many thanks,
Nour
Related Posts with Cross-sectional regression for each ind and year
unbalanced panelHi everyone I'm running a regression with fixed effects of individuals: reg y x i.firm i.year i.indi…
lincom value meaning?Hi, I have just run some post estimations , on an ordered logit model, Checking out changes in proba…
Lagged dependent variable in mixed models?Hi everyone, I have some questions. I have a dataset of about political parties in 30 countries and …
Finding max and min of a numbers' list stored in macroDear All, I am looking for a solution to find maximum and minimum numbers stored in a local/global …
Using suest to compare coefficientsHi statalist, I am running an ordinal regression model separately for each sex because I expect that…
Subscribe to:
Post Comments (Atom)
This comment has been removed by the author.
ReplyDelete