Hypothesis Testing – The 7

Download Report

Transcript Hypothesis Testing – The 7

STAT 3120
Statistical Methods I
Lecture Notes 7
Non Parametric Alternative to
ANOVA – Kruskal Wallis
Testing for Relationships Among Variables
Dependent
Variable
Independent
(predictor)
Variable
Hypothesis Test
Comments
Categorical
(Qualitative)
Categorical
(Qualitative)
Chi-Square
Tests if variables are statistically
independent (i.e. are they related
or not?)
Quantitative
Categorical
(Qualitative)
T-TEST
ANOVA
Non-Parametric
Determines if categorical variable
(factor) affects dependent
variable; typically used for
experimental or planned change
studies
Quantitative
Quantitative
Regression Analysis
Test establishes a regression
model; used to explain, predict or
control dependent variable
Qualitative
Quantitative
Logistic Regression
(binary dependent)
or Discriminant
Analysis (3+ values
for the dependent)
Test establishes a regressionesque model; used to explain,
predict or control dependent
variable
Testing for Relationships Among Variables
Hypothesis Test – parametric
(preferred)
Hypothesis Test – Non-Parametric (Not
preferred)
Two sample ttest
Wilcoxon Rank Sum Test
Paired ttest
Wilcoxon Signed Rank Test
ANOVA
Kruskal-Wallis Test
Kruskal-Wallis Test
Prior to executing an ANOVA, we should test
the distribution of each group. If the groups
are not normal or there are less than 10 in
each group, a non- parametric alternative
should be used – the Kruskal-Wallis Test.
Kruskal-Wallis Test
As with the Wilcoxon Rank Sum test, we are
testing to determine if the distributions are
identical or if one (or more) of the distributions
are shifted to the right or to the left.
The Hypothesis statements are:
Ho: All of the distributions are identical
Ha: At least one of the distributions is different
Kruskal-Wallis Test
The test statistic for the K-W test is the H-stat.
The result of this statistic is compared to a Χ2
statistic – which can be found in Table 7 of
your book.
Kruskal-Wallis Test
The H statistic is calculated as:
H=12/(nT*(nT+1)Σ(Ti2/ni)-3(nT+1)
Where,
nT = the total number of obs in the sample
ni = the number of obs in group i
Ti = the sum of the ranks in group i
Kruskal-Wallis Test
Lets do Exercise # 8.6 as a K-W test.
A team of researchers wants to compare the
yields of five different varieties of orange trees in
a single orchard. They obtain a random sample
of 7 trees from each variety.
Kruskal-Wallis Test
Step One: Determine the Hypothesis Statements
and the testing matrix.
Ho: All of the varieties have the same
distribution (and the same median yield)
Ha: At least one of the varieties is different
Kruskal-Wallis Test
Step Two: Determine the Critical Value for testing.
We have 5 groups, which translates into k-1 or 5-1 = 4
degrees of freedom. The problem requests that the
test is run at alpha = .01. From Table 7 on Page 1101,
we can see that the Χ2 Statistic is 13.28.
Therefore, if the calculated H-stat is greater than
13.28, we will reject the Null Hypothesis and
conclude that at least one of the distributions is
different from the others.
Kruskal-Wallis Test
Step Three: Determine the Calculated H- Statistic.
Σ
A
RANK
B
RANK
C
RANK
D
RANK
E
RANK
13
2.5
27
11
40
29
17
5
36
23
19
6
31
16.5 44
32.5 28
12
32
18.5
39
28
36
23
30.5 41
30.5 34
20
38
26.5 29
13.5 37
25
45
34.5 29
13.5
22
8
45
34.5 36
23
15
4
25
9.5
25
9.5
32
18.5 38
26.5 13
2.5
31
16.5
10
1
44
32.5 35
21
7
30
15
149.5
187.5
81.5
41
20
95.5
116
Kruskal-Wallis Test
Step Three: Determine the Calculated H- Statistic.
H=(12/(35*36))*(((81.5)2/7)+((149.5)2/7)+((187.5)2/7)+(
(95.5)2/7)+((116)2/7)))-(3*(35+1))
H=9.97.
Since the Calculated statistic of 9.97 is less than the
critical statistic of 13.28, we would fail to reject the
Null Hypothesis. In other words, we cannot
conclude that any of the distributions are different.
Kruskal-Wallis Test
The same SAS Code that we used for the
Wilcoxon Signed Rank Test can be used for the
KW test:
Proc Npar1way wilcoxon data=KW;
Class Group;
Var Score;
Run;
Note that the term “wilcoxon” is really
synonymous with non-parametric.