Hi. I am new at trying to loop files so, my question may be trivial but I have tried to search for answers and not found much help. I appreciate your help and feedback.
I have 60 countries dta file that look like this:
Angola_2006_2010_Panel.dta
Colombia_2006_2010_Panel.dta
India_2007_2012_Panel.dta
.
.
And, I want to try to estimate the levpet in-built stata command and know how to do it individually for each country. This is the code for that after cleaning some data, replacing zeros, creating logs and so on.
tsset id year
keep id year lnr lnv lnm lnl lnk lni lne lna M R V L K I E A
levpet lnv , free( lnl ) proxy( lne ) capital( lnk ) valueadded
I am really lost on how to create a simple code that let me read all these files with a loop instead of having to do all the countries individually. I have tried to append files but for some countries, I get error messages. Is there a way that will allow me to do so?
Thanks for your help.
-Sara
I have 60 countries dta file that look like this:
Angola_2006_2010_Panel.dta
Colombia_2006_2010_Panel.dta
India_2007_2012_Panel.dta
.
.
And, I want to try to estimate the levpet in-built stata command and know how to do it individually for each country. This is the code for that after cleaning some data, replacing zeros, creating logs and so on.
tsset id year
keep id year lnr lnv lnm lnl lnk lni lne lna M R V L K I E A
levpet lnv , free( lnl ) proxy( lne ) capital( lnk ) valueadded
I am really lost on how to create a simple code that let me read all these files with a loop instead of having to do all the countries individually. I have tried to append files but for some countries, I get error messages. Is there a way that will allow me to do so?
Thanks for your help.
-Sara
Comment