foreach x of varlist V39 V40 V41 {
// Recode each variable:
recode `x' (1/5 = 2 "Valid answer") ///
( .c = 1 "Can't choose") ///
( .n = 0 "No answer") ///
, gen(`x'_mis)
label var `x'_mis "Recode of `x'"
// Plot each variable:
catplot `x'_mis, over(C_ALPHAN, label(ang(v)))
stack asyvars perc(C_ALPHAN) ///
legend(pos(1) row(1)) recast(bar) ///
ytitle("Percentage") b1title("") ///
title("Recode of `x'") ///
name(`x'_mis, replace)
}
grc1leg V39_mis V40_mis V41_mis, col(1) name(combined, replace)
graph display combined, ysize(11) xsize(7)