program define whist, rclass
version 9 /* si chgt version*/
syntax varname [aweight iweight fweight pweight/] [,title(string)] /*pond posssibles*/
di "varname :`varlist'"
tempname varpond
qui su `exp' if `varlist'!=.
qui gen `varpond'=`exp'/r(sum)*100
label variable `varpond' "fréquence"
label variable `varlist' "`varlist'"
graph bar (sum) `varpond', over(`varlist') blabel(bar, format (%4.1f)) title(`title') ytitle(pourcentage) b1title(`varlist')
end

