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
New package -checkipaddresses- on SSC : identify IP addresses behind VPN/VPSThanks to Kit Baum, my checkipaddresses is available from SSC. checkipaddresses queries an IP addre…
Interpretation of grand mean centered versus original form level-2 variables in multilevel logistic regressionHello, I have a random intercept multilevel logistic regression model with cross-level interactions…
2SLS estimationHello, I would like to estimate the following 2SLS panel regression: First stage: Zit = α Wit*Fit +…
Merging two data sets: weighting help?Hi All, I am working to merge two separate data sets, each with their own sampling method and weight…
Is there an arbitrary scaling factor in logistic regression in Stata?Hi, Norton et al state in a recent JAMA guide that the magnitude of the odds ratio from a logistic …
Subscribe to:
Post Comments (Atom)
0 Response to importing multiple excel files using a loop
Post a Comment