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
stset with multiple failure per subject dataHi everyone, I would like to ask for some advice on stset-ing my dataset with multiple failures per…
Creating funnel plots in meta-analyses of proportion studiesHi all, Hunter et al (https://doi.org/10.1016/j.jclinepi.2014.03.003) suggested that conventional fu…
Adding variables with partial common namesHi, I have variables such as fac_tot30_outpatient and prof_tot30_outpatient, which I want to sum by…
Calculating weight for age z-scores in stataDear colleagues am trying to calculate weight for age z-score in stata but am just getting value 99 …
Ranking means from highest to lowest after bysort occupation: sumDear all, I would like to know how to rank means from highest to lowest after the following command…
Subscribe to:
Post Comments (Atom)
0 Response to Forloop to import multiple .sav files not working
Post a Comment