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
Structural Break Tests with an unknown date - Ambiguous information given in STATA output.Hello, I am running a structural break test with an unknown data (command in STATA: estat sbsingle)…
Group IDs for observation-specific date range and a dummyHi, I have data on project teams for a number of different companies. Included in the data is a DAT…
using xtreg for decompositionHello, We have the following dataset: A limited panel in which an establishment is found in the sam…
Cumulative incidence proportions by covariateHi Stata forum, I would like to estimate the cumulative incidence proportions with a competing risk …
Unit-root test for a bounded seriesHi All, I would like to test for unit root for a series that is bounded, i.e., a series which lies …
Subscribe to:
Post Comments (Atom)
0 Response to forvalue index included in csv file name
Post a Comment