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
Fixed effects on panel dataHi there, I have a panel dataset on conflict events, rainfall deviation, GDP and some more variable…
The GEE and regression with robust error varianceHi Statisticians, Is any one known the difference of GEE and regression with robust error variance? …
Reporting Adjusted R2 on StataHello Everyone! I am new to STATA and I am having trouble reporting the Adjusted R2 When I run a re…
Unique Identifier for Time SeriesHi Everyone, I am not sure if I need to create a unique ID for time series data. I have annual data…
WLS methodDear Statalist, I have a project with cross-sectional data, but my data have problem with heterosced…
Subscribe to:
Post Comments (Atom)
0 Response to forvalue index included in csv file name
Post a Comment