Greetings,
I have a panel dataset (country/years) for years 1956-2014. I'd like to estimate a regression and save the output for each 10-yr period (e.g. starting with 1956-1955, then 1957-1956, and so). The intent being to explore how the model performs across time. My basic code structure is (I'm using version 13.1):
eststo model_56_65: quietly logit depvar var1 var2 var3 if year >= 1956 & year<= 1965
quietly estadd fitstat
Would I be able to use the foreach command to loop the estimations rather than copying the same block of code 50 times?
Apologies if this is an overly elementary question. I'm reading the online help on the foreach command, but I'm still a bit confused with how it works. Any advice would be much appreciated.
I have a panel dataset (country/years) for years 1956-2014. I'd like to estimate a regression and save the output for each 10-yr period (e.g. starting with 1956-1955, then 1957-1956, and so). The intent being to explore how the model performs across time. My basic code structure is (I'm using version 13.1):
eststo model_56_65: quietly logit depvar var1 var2 var3 if year >= 1956 & year<= 1965
quietly estadd fitstat
Would I be able to use the foreach command to loop the estimations rather than copying the same block of code 50 times?
Apologies if this is an overly elementary question. I'm reading the online help on the foreach command, but I'm still a bit confused with how it works. Any advice would be much appreciated.