Just learned about the
Code:
multicat
function in the book by Lawrence C. Hamilton which looks very handy. Then I run the do file command as mentioned:

program define multicat
version 12.1
syntax varlist [if] [in] [aweight fweight iweight] ///
[, MISSing BY(varname) OVER(varname) ]
if "`over'" != "" {
display as error "over() option not allowed with multicat;"
display as error "use by() option or try catplot command instead."
exit 198
}
marksample touse, strok novarlist
if "`weight'" != "" local Weighted_ = "Weighted"
if "`c(os)'"=="Windows" {
local filetype "emf"
}
else if "`c(os)'"=="Unix" {
local filetype "eps"
}
else if "`c(os)'"=="MacOSX" {
local filetype = "pdf"
}
else {
display as error "unknown operating system: `c(os)'"
exit 799
}
capture {
if "`by'" != "" {
foreach var of varlist `varlist' {
local Vlab_: variable label `var'
catplot hbar `var' [`weight' `exp'] if `touse', ///

blabel(bar, format(%3.0f)) ///
percent(`by') ytitle("`Weighted_' Percent") ///
`missing' by(`by', title("`Vlab_'", size(medium)))
graph save -`by'-`var'.gph, replace
graph export -`by'-`var'.`filetype', replace
}
}
else {
foreach var of varlist `varlist' {
quietly tab `var' if `touse', `missing'
local Nofobs_ = r(N)
local Vlab_: variable label `var'
catplot hbar `var' [`weight' `exp'] if `touse', ///
blabel(bar, format(%3.0f)) ///
percent ytitle("`Weighted_' Percent, N = `Nofobs_'") ///
title("`Vlab_'", size(medium)) `missing' `options'
graph save Graph -`var'.gph, replace
graph export -`var'.`filetype', replace
}
}
}
error _rc
end

to make a similar chart as mentioned on the book: Array


but getting this error in Stata 14:
Code:
. multicat fs
invalid syntax
r(111);
Does anyone know if
Code:
multicat
is still functional?