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
Oaxaca & diff-in-diff advice (OLS assumtions)Hello, I am doing an oaxaca decomposition of the ethnic pay gap and then doing a diff-in-diff analy…
FMM errorI have the following estimation command using fmm: > fmm 3: regress $Y $T $X where $Y $X and $T…
Stata Export over EXCEL's row limitHi All, 1,048,576 is the max row limit for excel. So if you have STATA data over this limit and wan…
Significant variable in panel regression but not in regression year by yearDear Stata users, I need your point of view about this subject. I run a xtlogit regression with the …
lagged variablesHi, I have a variable for gdp and for survey wave. I have three survey years and for each survey wav…
Subscribe to:
Post Comments (Atom)
0 Response to importing multiple excel files using a loop
Post a Comment