#Typical call is %stsampsm c1 c2 c3 k1 c11 c12 c13, where c1 contains #stratum weights, c2 contains the stratum sizes, c3 contains the #stratum standard deviations, k1 the desired value of D (D=B*B/4), #c11 and c12 a table of descriptive statistics and c13 the sample #sizes. macro stsampsm wtcol sizecol sdcol d labcol descol samszcol mcolumn wtcol sizecol sdcol labcol descol samszcol numcol dencol mconstant d nstrat popsize samtot let nstrat=count(wtcol) let popsize=sum(sizecol) let numcol=sizecol**2*sdcol**2/wtcol let dencol=sizecol*sdcol**2 let samtot=sum(numcol)/(popsize**2*d+sum(dencol)) let samszcol=samtot*wtcol let samtot=round(samtot) let samszcol=round(samszcol) set labcol; format(a30). Total sample size end set descol samtot end name samszcol 'Stratum Sample Sizes' endmacro