capture program drop tabmm
program tabmm
version 12
syntax varlist [if][in][,col]
local varnum : word count `varlist'
local varnumminus1 = `varnum' -1
forvalues i=1/`varnumminus1' {
local x : word `i' of `varlist'
local j=`i'+1
forvalues k=`j'/`varnum' {
local y: word `k' of `varlist'
svy: tabulate `x' `y'
}
}
end
capture program drop tabm
program tabm
version 12
syntax varlist[,cell count column row se ci cv percent proportion]
local varnum : word count `varlist'
local x : word 1 of `varlist'
forvalues i=2/`varnum' {
local y: word `i' of `varlist'
svy:tabulate `x' `y',`col' `cell' `se' `percent' format(%5.1f)
}
end
tabm sex race5grp diabetes,cell se percent
No comments:
Post a Comment