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
robustness test in reghdfehello everyone, I am using panel data fixed effect , and in term of the checking the robustness test…
Merging data from two variabelsHi I want to generate a new variable from two numeric continuos variables which both have range from…
Event StudyDear all, to perform my event study, I need not merge to datasets based on an identifier ID and mul…
Standard error of the difference of coefficientsDear Statalist Members I run a regression where I compare the the evolution of a coefficient over a…
Generate a variable to construct a graphHi! I pretend to do in my dissertation a graph similar to the one attached. I have a dummy variabl…
Subscribe to:
Post Comments (Atom)
This comment has been removed by the author.
ReplyDelete