Hello I am new to Stata and I am trying to write a foreach loop code, My code is
use "/Users/elenacalifano/Desktop/DATASETS/BankFocus+Lookup"
levelsof filename , local(cnt)
local i=0
foreach c of local cnt {
clear
import delimited "/Users/elenacalifano/Desktop/DATASETS/RISK.WORLDFIN-MR.GMES/RISK.WORLDFIN-MR.GMES //`c'"', varnames(1)
gen filename="`c'"
local i=`i'+1
save "/Users/elenacalifano/Desktop/DATASETS/2023.04.07.RISK.WORLDFIN-MR.GMES/RISK.WORLDFIN-MR.GMES//bank`i'.dta", replace
}
and gives the error r(100) using required. Could anybody help me with this ? Thankyou in advance
Related Posts with foreach loop error r(100) using required
Should I make inferences on the Pseudo R-square given by fracreg?Hi all, I have a dependent variable which varies between 0 and 1 so I decided to use fracreg. Howev…
Iteratively intersecting global and local listsIn my analysis, I am using district-month panel data. I want to do the following many times: (1) sel…
Not able to get inverted parabola for data (though theory says so)Hi all, can someone please help me understand the nature of the data and the unexpected results I ha…
excel file too big.Dear All, I tried to import many excel files but encountered the following error message. Any sugges…
xtrc + outreg2Dear All, I ran the following regression: Code: webuse grunfeld, clear xtset company year xtrc i…
Subscribe to:
Post Comments (Atom)
0 Response to foreach loop error r(100) using required
Post a Comment