13
STAT 3120 Statistical Methods I Lecture Notes 7 Non Parametric Alternative to ANOVA – Kruskal Wallis

STAT 3120 Statistical Methods I

  • Upload
    arvid

  • View
    52

  • Download
    0

Embed Size (px)

DESCRIPTION

STAT 3120 Statistical Methods I. Lecture Notes 7 Non Parametric Alternative to ANOVA – Kruskal Wallis. Testing for Relationships Among Variables. Testing for Relationships Among Variables. Kruskal-Wallis Test. - PowerPoint PPT Presentation

Citation preview

Page 1: STAT 3120  Statistical Methods I

STAT 3120 Statistical Methods I

Lecture Notes 7Non Parametric

Alternative to ANOVA – Kruskal Wallis

Page 2: STAT 3120  Statistical Methods I

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-TESTANOVANon-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 regression-esque model; used to explain, predict or control dependent variable

Page 3: STAT 3120  Statistical Methods I

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

Page 4: STAT 3120  Statistical Methods I

Kruskal-Wallis TestPrior 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.

Page 5: STAT 3120  Statistical Methods I

Kruskal-Wallis TestAs 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 identicalHa: At least one of the distributions is different

Page 6: STAT 3120  Statistical Methods I

Kruskal-Wallis TestThe 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.

Page 7: STAT 3120  Statistical Methods I

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 sampleni = the number of obs in group iTi = the sum of the ranks in group i

Kruskal-Wallis Test

Page 8: STAT 3120  Statistical Methods I

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

Page 9: STAT 3120  Statistical Methods I

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

Page 10: STAT 3120  Statistical Methods I

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

Page 11: STAT 3120  Statistical Methods I

Step Three: Determine the Calculated H- Statistic.

Kruskal-Wallis Test

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 41 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 20 7 30 1581.5 149.5 187.5 95.5 116Σ

Page 12: STAT 3120  Statistical Methods I

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

Page 13: STAT 3120  Statistical Methods I

Kruskal-Wallis TestThe 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.