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?
Reshape large panel data set with multiple variables and daily dataHi members, I have a large data set with information about 166 bonds, their characteristics, follow…
Time-varying covariates in Cox models, when data has been stset with a date variableI have dataset on legal cases in which there are multiple entries for each case, each entry pertaini…
Oaxaca decomposition:interpretation of insignificant contributionsDear all, I am doing a two-fold Oaxaca-Blinder decomposition in Stata using -oaxaca- command writte…
kernal density normal doesnt appear normalDear All, I am checking for normality for my survey data. The linktest, vif and swilk test all pass…
Meta-Analysis - how to compare 2 Effects: "The effect of A on C is stronger than the effect of B on C."Dear Stata Professionals, i have a question on a meta-analysis problem. I have 38 studies on which…
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