Hello all, would appreciate an advise on how i can fix the following line of commands to import/read multiple SPSS files in a directory and save each as .dta file. The commands below do not produce any output or give an error message --
global dir "C:\Users\mydesktop"
local fls: dir "$dir" files "*.sav"
global save "$dir/STATA"
foreach f of local fls{
usespss `"`fls'"' , clear
save "$save/`"`f'"'.dta", replace
}
Related Posts with Forloop to import multiple .sav files not working
search if a value is present in tableHello all, How can I search if a particular value is present in a table. if the value is present in…
Reshaping a both long and wide dataset into only long formHi. I have medical prescription data ranging from 2007-2012 in the format below. The two identifying…
State by Year Fixed Effects and Annual State ControlsIn my econometric model the identifying variation is at the state, year, and factory level. When I i…
Did I set up my panel data (with restrictions) correctly?Hi all, I would like to seek your advice regarding my analysis sample. Specifically, I have a three…
Using MarginsPlot to visualize Quadratics in Panel DataDear Statalist community, I need help with two things: One, I want to use the margins and marginsp…
Subscribe to:
Post Comments (Atom)
0 Response to Forloop to import multiple .sav files not working
Post a Comment