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
Decode halfyearly date strings for Panel DataDear Statalist community, I have a problem with my time variable is recognized as a string when I do…
STATA: panel regression, xtset error, CUSIP8-code, string variableDear all, I am trying to complete a panel data regression with the individual and time identifiers:…
spmat import dataDear all, i am unable to import data as a spatial weight matrix into Stata using spmat. The data a…
The use of the symbol $ in Stata commandsHi Statalist In many of the questions posted, the following syntax has been used: e.g. $covariates …
Unintelligible code in Stata 16Dear Stata users, I use community-contributed command -tabout- (SSC, written by Ian Watson) to expor…
Subscribe to:
Post Comments (Atom)
This comment has been removed by the author.
ReplyDelete