You are on page 1of 2

School of Health Systems and Public Health

HME 712 Week 4 Fact sheet bos_13

The interpretation of Stata output for single sample sign test, MWW ranksum test and Wilcoxon
signrank test

The single sample sign test


Sign test
Here it is NB to understand the single tail H0/HA
sign observed expected results because these single sample tests are
positive 9 4.5 often one-sided quality checks.
negative 0 4.5
zero 0 0 The H0 does not change, always median=0
all 9 9
If being below the 11.5 is of concern then HA
One-sided tests: (what I accept if I reject H0): median <11.5
Ho: median of haemoglo~n - 11.5 = 0 vs.
Ha: median of haemoglo~n - 11.5 > 0 If being above the 11.5 is of concern then HA
Pr(#positive >= 9) =
Binomial(n = 9, x >= 9, p = 0.5) = 0.0020 (what I accept if I reject H0): median >11.5
Ho: median of haemoglo~n - 11.5 = 0 vs.
Ha: median of haemoglo~n - 11.5 < 0
Pr(#negative >= 0) =
Binomial(n = 9, x >= 0, p = 0.5) = 1.0000
If I want a two-sided test (I am concerned if the
median is too high or too low) then I select the
Two-sided test:
Ho: median of haemoglo~n - 11.5 = 0 vs.
Two-sided p-value.
Ha: median of haemoglo~n - 11.5 != 0
Pr(#positive >= 9 or #negative >= 9) =
min(1, 2*Binomial(n = 9, x >= 9, p = 0.5)) = 0.0039

The MWW rank sum test:

. ranksum depression_score , by(sex)


Refer to the exact p-value as n<200
Two-sample Wilcoxon rank-sum (Mann-Whitney) test Here it is NB to understand how to interpret the
significant result. Which sex has the higher
sex obs rank sum expected depression scores (sex 0 is female; sex 1 is male)?

0 10 105 95 Although in this case the result was not


1 8 66 76 significant, which sex had the higher scores?

combined 18 171 171 Stata assigns ranks from low to high values;

unadjusted variance 126.67 Low values have lower ranks, high values have
adjustment for ties -1.18 higher ranks. If nf > nm then females will have
higher sum of ranks just because they are more
adjusted variance 125.49 numerous. Rather, compare the rank sums to
expected if H0 true. Females are higher than
Ho: depres~e(sex==0) = depres~e(sex==1) expected under H0.
z = 0.893
Prob > |z| = 0.3720 Females have higher depression scores in this
Exact Prob = 0.3944 case (but not statistically significant).

1
School of Health Systems and Public Health

The Wilcoxon signed ranks test:


. signrank quest_1=quest_2
In this case there is a statistically significant
Wilcoxon signed-rank test result (p = 0.0013)

We want to know if quest_1 has higher scores


sign obs sum ranks expected
than quest_2 or vice versa.
positive 14 157.5 84
negative 2 10.5 84
The command used was:
zero 2 3 3
<signrank quest_1=quest_2>
all 18 171 171 Stata uses difference = quest_1 – quest_2
(because quest_1 was typed in first).
unadjusted variance 527.25
adjustment for ties -3.13 There were more positive results, than
adjustment for zeros -1.25
negative, for quest_1 – quest_2.
adjusted variance 522.88 We can conclude therefore that quest_1 scores
were on the whole higher than quest_2 scores.
Ho: quest_1 = quest_2
z = 3.214 Footnote: if n<200, as is the case here, prefer to
Prob > |z| = 0.0013
use the exact p-value rather than 0.0013
Exact Prob = 0.0006

You might also like