#Typical call is %ppsmean c1 c2 c11 c12. c1 contains the sample, #c2 the cluster sizes, and c11 and c12 #contain a table of descriptive statistics. The subcommand total #requires specification of the number of clusters in the population. macro ppsmean y m labcol descol; total npop. mcolumn y m labcol descol ybar mconstant mtot muhat nsam sdhat npop let nsam=count(y) let ybar=y/m let muhat=sum(ybar)/nsam let sdhat=sqrt(sum((ybar-muhat)**2)/(nsam*(nsam-1))) if total=1 let muhat=npop*muhat let sdhat=npop*sdhat set labcol; format(a30). Estimated population total Estimated standard error end else set labcol; format(a30). Estimated population mean Estimated standard error end endif set descol muhat sdhat endmacro