*! version 1.0.0. 1 Jan 1997 STB-36 sg69 program define mwstati version 4.0 mac def S_8 /* will be mann-whitney statistic */ local options "pp PRoportion Matched-t Independent-t" parse "`*'", parse(" ,") confirm number `1' confirm number `2' if "`5'" != "" & "`4'" != "," { di in red "cannot use two options at once" exit 198 } if "`3'" == "," { if "`4'" == "pp" { local opt = "pp" } if substr("`4'",1,2) == "pr" { local opt = "pr" } if substr("`4'",1,1) == "m" { local opt = "mt" } } if "`5'" != "" { local opt = "it" } if "`5'" != "" { confirm number `3' } if "`opt'" == "pp" { local mwstat = `1' / `2' } if "`opt'" == "pr" { local mwstat = .5 + .5 * (`1' - `2') } if "`opt'" == "mt" { local mwstat = normprob(`1' / `2') } if "`opt'" == "it" { local mwstat = normprob(`1' / sqrt(`2' + `3')) } di "Mann-Whitney statistic for this situation is: " %5.4f `mwstat' global S_8 = `mwstat' end