Hello.
I am trying to generate graphs from some variables. I do not have all possible combinations of v iv p s. I want Stata to generate graphs with all combinations I have but without stopping and returning error.
This is the code I am using:
foreach v in bi y fi w ti {
foreach s in qe nqe {
foreach pi in t3m t6m t1y t2y t3y t5y t7y t10y {
foreach iv in ed1 ed2 ed3 ed4 ff1 ff2 ff3 ff4 mp1 mp2 mp3 mp4 pc1 {
qui: twoway (rarea min_`v'_`pi'_`iv'_`s'_68 max_`v'_`pi'_`iv'_`s'_68 horizon , pstyle(ci)) ///
(line max_`v'_`pi'_`iv'_`s'_90 horizon, lcolor(black) lpattern(dash) lstyle(ci) ) ///
(line min_`v'_`pi'_`iv'_`s'_90 horizon, lcolor(black) lpattern(dash) lstyle(ci) ) ///
(line b_`v'_`pi'_`iv'_`s'_90 horizon, lcolor(red) lpattern(solid)), ///
title("`v'", color(black) size(medium)) ///
ytitle("Percent", size(medsmall)) xtitle("Horizon", size(medsmall)) ///
graphregion(color(white)) plotregion(color(white)) ///
legend(off) ///
title("GK shocks: `v'_`pi'_`iv'_`s'")
graph save "C:\****\irf_`pi'_`iv'_`v'_`s'.gph", replace
}
}
}
}
Thank you for your help.
Related Posts with How to make a loop continue working if a variable it is not found?
How to regreee the variables with different coefficientHi community, My equation is attached. A, B, C, D is dummy variables and i already solve them. May …
Create variables econometricsHi, i have few question on generating new variables and calculating. I am new to stata and I dont kn…
Results are not reproducibleI am trying to select 20 controls from a community database for each case and do conditional logisti…
Oaxaca decomposition in OLS and unconditional quantile regressionDear all, I'm actually performing an Oaxaca-Blinder decomposition to test wether the returns of ind…
Industry-based distribution of dependent and independent variableHi, I am using Stata 16, and I am trying to summarize data similar to the way I saw in this paper, …
Subscribe to:
Post Comments (Atom)
0 Response to How to make a loop continue working if a variable it is not found?
Post a Comment