Hey everyone,
I'm attempting to assemble a panel dataset using a handful of CSV files each of which correspond to a single year. Each file has the same name ending in the year the data corresponds to. That is my csv files are "data1992.csv", "data1993.csv", eta. I just want to import them, generate a variable corresponding to the year, and then save the file as .dta. My current attempt is
forvalues i = 1992(1)2000 {
import delimited "hd'i'.csv"
gen year='i'
save tem'i'.dta, replace
}
Thanks for anyone's help or advice!
Related Posts with forvalue index included in csv file name
How to remove Autocorrelation and Hereroskedasticity detected in my FEM modelI used Hausman test and as my prob < 5%. I choose to use FEM. But after testing I found out that …
Moving average with panel dataHello all, Below is an example of the data I am working with: Code: input float(year quarter mile…
Xtset and string variablesHi Everyone, I am trying to set my data as a panel by using xtset command. I have uasid as identifi…
Direct effect switches sign when moderator is added - what does this mean?Hello! I have examined a panel and performed various analyses in STATA, whose results you can see …
Display point estimates for multiple regressions of covariates in one column with outreg2.I am trying to create a balance table that compares differences between groups for multiple covariat…
Subscribe to:
Post Comments (Atom)
0 Response to forvalue index included in csv file name
Post a Comment