Hi statalists, I have the following code but I always get the error message
local dpto AMAZONAS ANCASH APURIMAC
foreach x in local dpto {
import excel using "Z:\HigherEducation_Inequality\INEI\`x'_t.xls" , sheet(`x') clear
keep A B C
keep if A=="18"|A=="19"
xpose,clear
drop in 1
rename v1 pob18
rename v2 pob19
gen Name=`x'
gen id=_n
gen Year=1998 if id==1
replace Year=1999 if id==2
drop id
save data_`x',replace
}
file Z:/HigherEducation_Inequality/INEI`x'_t.xls not found
r(601);
Does anyone has any thoughts about what am I doing wrong?
Related Posts with importing multiple excel files using a loop
corresponding commands for manually adjusting graph Dear All, As requested by Nick Cox, I start this new thread. The original one is here (https://www.…
multivariate analysis of intervention effect with unpaired dataDear all, I want to test the effectiveness of a educational videogame to increase protective factor…
Unexpected IPO dealsDear Statalists, I am doing the research on some unexpected Initial Public Offering (IPO) events. Ba…
DOLS in time seriesHi, I have found cointegration in my save and investment variables, and I have found some things on…
testDear all, I want to test the effectiveness of a educational videogame to increase protective factor…
Subscribe to:
Post Comments (Atom)
0 Response to importing multiple excel files using a loop
Post a Comment