#Typical call is "%ratiomn c1 c2 c3 c4; mean k1 k2." where c1 contains the y #column, c2 contains the x column, c3 a column of descriptive labels and c4 a #column of descriptive statistics. If the mean subcommand is used, k1 contains #the population mean of x and k2 contains the population total. If the total #subcommand is used, k1 contains the population total of x and k2 contains the #population total. If the ratio subcommand is used, k1 contains the population #total. The standard error has been modified by the factor mux/xbar macro ratiomn y x labcol descol; rmean mux nmpop; rtotal taux ntpop; rratio nrpop. mconstant mcon r nsam std sdy mux taux npop my nmpop ntpop nrpop mcolumn y x labcol descol dcol let nsam=count(y) let r=sum(y)/sum(x) let dcol=y-r*x if rmean=1 let npop=nmpop elseif rtotal=1 let npop=ntpop else let npop=nrpop endif let std=stan(dcol)*sqrt((npop-nsam)/(npop*nsam)) if rmean > 0 let npop=nmpop let my=r*mux let sdy=std*mux/mean(x) set labcol; format(a30). Ratio estimate of mean Standard Error end endif if rtotal=1 let npop=ntpop let my=r*taux let sdy=taux*std/mean(x) set labcol; format(a30). Ratio estimate of total Standard error end endif if rratio=1 let npop=nrpop let my=r let sdy=std/mean(x) set labcol; format(a30). Ratio estimate Standard Error end endif set descol my sdy end endmacro