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
Double Clustering in a Multi-country Data Set upDear Stata Members First, a heartfelt advance New Year Wishes to All. I wish all a prosperous New Ye…
Difference between DiD and two-way fixed effects modelI am currently writing my master thesis, where I analyze the effect of hurricanes on the stock marke…
Interpretation of constant in xtregHello everyone! I am currently writing my master thesis, where I analyze the effect of hurricanes o…
DID estimationhello everyone, how can I treat the problem if I see an error years not nested in countryid or count…
Xtabond2 command system GMM.Hello to everyone, I am searching in terms of the effect of the uncertainty on the saving and in one…
Subscribe to:
Post Comments (Atom)
0 Response to forvalue index included in csv file name
Post a Comment