#Typical call is %stprop c1 c2 c3 c10 c11 c12, where c1 contains #the stratum population sizes, c2 contains the stratum sample sizes, #c3 the stratum proportions, c10 and c11 a table of descriptive #statistics and c12 the individual stratum standard errors macro stprop subpopsz subsamsz subp labcol descol secol mcolumn subsamsz subp labcol descol secol subpopsz fpcol mconstant npop nlevel stratp stsep i let secol=sqrt(subp*(1-subp)/(subsamsz-1)) let npop=sum(subpopsz) let stratp=sum(subpopsz*subp/npop) let fpcol=(subpopsz-subsamsz)/subpopsz let stsep=sqrt(sum(subpopsz**2*secol**2*fpcol/(npop**2))) set labcol; format(a30). Stratified sample mean Estimated standard error end set descol stratp stsep end name secol 'Stratum standard errors' endmacro