Session 2: Non-Parametric Tests
Total Page:16
File Type:pdf, Size:1020Kb
WEEK 3: Non-Parametric Tests
What is a non-parametric test ?
Methods of analysis that do not assume a particular family of distributions for the data.
When to use a non-parametric test
The following provides a summary for when to use non-parametric statistics:
Non-parametrics are distribution free; The data may not be put into metric form appropriately, i.e.. unordered qualitative variables (Nominal data); Data may be rank ordered (Ordinal data); Data may be from small samples; There may be non-normal distribution of the variables (Skewed data); Outliers may be present
Non-parametric v Parametric tests
Usually only perform one analysis of a data set choosing between parametric and non-parametric methods.
It is usual to use a parametric method, unless there is a clear indication that it is not valid.
It is important to realise that if we apply different tests to the same data then we do not expect them to give the same answer, but in general two valid methods will give similar answers.
Non-parametric tests are less powerful than the equivalent parametric test (especially in small samples) and will tend to give a less significant (larger) p- value
Dealing with ordinal data Non-parametric tests are usually based on Order Statistics and Ranks.
ORDER STATISTICS : the observations arranged in increasing order of size.
RANKS : their places in this order. Exercise in ranking data data: 7 9 10 12 12 9 12 11 -13 X1 X2 X3 X4 X5 X6 X7 X8 X 9 ordered: ranks: Wilcoxon Signed Rank Test
Non-parametric equivalent for testing or estimating location for a one sample problem (equivalent to one sample t-test) OR for paired samples (equivalent to the paired t-test)
Assumptions
A random sample of n independent observations OR independent random pairs are taken. The variable of interest is the difference (d) : For the one sample problem d = Observed value - Hypothesised value For paired data d = X - Y - where X is value at time 1 and Y is value at time 2. The level of measurement is at least ordinal.
Example 1 - Two Groups of Paired Data Non-parametric equivalent of paired sample t-test
Acne severity scores compared at baseline and 4 weeks following a course of erythromycin 500mg twice daily.
Acne Severity Scores (1-12 scale) following Erythromycin.
Subject Baseline Week 4 Difference (Week 4- Baseline) 1 12 8 2 11 5 3 6 4 4 4.5 1 5 5.5 5 6 7 6 7 3.5 3 8 8 8 9 9 8.5 10 10 6
Question 1: 1. Calculate the difference between week 4 and baseline 2. Rank the differences (If there is tied ranks (=0) ignore this and start from the first number). 3. Calculate the sum of ranks for –ve and +differences. 4. Open the data file: Paired Wilcoxon 5. Use a Wilcoxon test the hypothesis that there been a change in severity scores from baseline to week 4? 6. Undertake a the appropriate t-test and compare the findings.
Example 2 - One independent sample The average daily energy intake (kJ) over 10 days of 11 healthy women is shown in the table below. Open the data file: One sample wilcoxon
Subject Daily energy Difference from Ranks of intake (kJ) 7725 kJ differences 1 5260 2 5470 3 5640 4 6180 5 6390 6 6515 7 6805 8 7515 9 7515 10 8230 11 8770
Question 2:
(NOTE: SPSS treats the data as paired) 1. Calculate the difference between enery intake and the test valve 2. Rank the absolute differences 3. Calculate the sum of ranks for –ve and +differences. 4. Open the data file: Paired Wilcoxon. What can be said about the energy intake compared to the recommended daily intake of 7725 kJ, using the Wilcoxon test the hypothesis. 5. Undertake a the appropriate t-test and compare the findings. Friedman Test
The assumption that the residuals have a Normal distribution cannot be assessed before fitting the model. Sometimes, however, it can be seen from the raw data that the model will not fit well. In particular, wide variation in the standard deviations for each row and column will suggest problems with the parametric ‘two-way ANOVA’.
Therefore, we have a non-parametric equivalent of the two way ANOVA that can be used for data sets which do not fulfill the assumptions of the parametric method. The method, which is sometimes known as Friedman’s two way analysis of variance, is purely a hypothesis test.
Example 3 Acne severity scores compared at baseline and 4 weeks following a course of erythromycin 500mg twice daily.
Acne Severity Scores (1-12 scale) following Erythromycin.
Open data file: Friedman
Subjects Week 0 Week 4 Week 8 Week 12 1 12 8 6 5 2 11 5 5 6 3 6 4 4 5 4 4.5 1 2 1 5 5.5 5 5 5 6 7 6 6 5.5 7 3.5 3 3 3 8 8 8 7 5 9 9 8.5 7 4 10 10 8 6 4 11 12 8 6 5 12 12 7 5 4 Mean 8.375 5.958 5.167 4.375 SD 3.076 2.398 1.528 1.334
Question 3: 1. Open data file: Friedman 2. Is there any variation in acne severity scores over the 12 week period? 3. If the Friedman test shows significance, then undertake paired tests to see where the differences are. Mann Whitney U test
Non-parametric equivalent of two sample t-test.
The Mann-Whitney test is used to compare two sets of data from independent groups. It is the most commonly used alternative to the independent samples t- test. The values from both samples are combined and then the data is ranked from smallest to largest. The rank of 1 is assigned to the smallest value, 2 to the next smallest and so on. If the ranks are tied, then the average rank is used.
Assumptions 1. There are two independent random variables (X and Y), of size n and m. 2. The variable of interest is a continuous random variable. 3. The two populations differ only with respect to location. Example 4 Patients receiving chemotherapy as outpatients were randomized to receive either an active antiemetic treatment or placebo (Williams et al., 1989). The following table shows measurements (in mm) on a 100mm linear analogue self assessment scale for nausea.
Active (n=20) Placebo (n=20) Rank Active Rank Placebo 0 0 0 10 0 12 0 15 0 15 2 30 7 35 8 38 10 42 13 45 15 50 18 50 20 60 20 64 21 68 22 71 25 74 30 82 52 86 76 95 Sum of the ranks ? ?
Question 4:
1. Rank the data, irrespective of group. 2. Calculate the sum of the ranks for the active and placebo group 3. Open data file: Mann Whitney 4. Undertake a Mann Whitney test to determine of there are any differences in nausea levels between the active and placebo groups? Draw a graph to show the differences. 5. Undertake a the appropriate t-test and compare the findings. Kruskal Wallis Test Just as the one way analysis of variance is a more general form of the t-test, there is a one for the non-parametric Mann-Whitney test. The Kruskal-Wallis test is an obvious mathematical extension of the Mann-Whitney test.
Assumptions 1. There are three or more independent random variables (X1 , X2, X3……….Xn, ), of size n1 ,n2, n3……….nn 2. The variable of interest is ordinal or a continuous random variable which is non-normal. 3. The populations differ only with respect to location.
Example 5 – Three Groups of Independent Data (non-parametric equivalent of the one way ANOVA)
Fentress et al (1986) reported the results of a randomized comparison of three groups of six children suffering from frequent and severe migraine. The active treatments given were relaxation response, either with or without biofeedback, and a third group of children was not treated. The frequency and duration of headaches were recorded before and after the study period, and the difference between these measurements was used as a measure of weekly headache activity. Reduction in weekly headache activity for three treatment groups, expressed as a percentage of baseline data (Fentress et al., 1986). Ranks are shown in brackets.
Open data file: Kruskall Wallis
Relaxation response Relaxation Untreated and biofeedback response alone (n=6) (n=6) (n=6) 62 (11) 69 (10) 50 (12) 74 (8.5) 43 (13) -120 (17) 86 (7) 100 (2) 100 (2) 74 (8.5) 94 (5) -288 (18) 91 (6) 100 (2) 4 (15) 37 (14) 98 (4) -76 (16) Rank sum 55 36 80
Reduction in headache activity for each child is expressed as a percentage. Note that a negative value indicates an increase in headache activity. Three children had a complete absence of headaches at the end of the study and thus a reduction of 100%.
Question 5: 1. Rank the data, irrespective of group. 2. Calculate the sum of ranks for each group. What does this indicate? 3. Is there variation in the reduction of headache activity between the 3 groups using a KW test? Draw a graph to show the differences. 4. Compare the findings with ANOVA.
Choosing an appropriate method of analysis
· Number of groups of observations · Independent or dependent groups of observations · The type of data · The distribution of data · The objective of the analysis
Choice of Test
Parametric Test Data Non-Parametric Test Data One sample T-test Interval Wilcoxon Sign Rank Ordinal / Test Interval(skewed) Two sample T-test Interval Mann-Whitney U Test Ordinal / Interval(skewed) Paired T-test Interval Wilcoxon Sign Rank Ordinal / Test Interval(skewed) One-Way ANOVA Interval Kruskall Wallis Test Ordinal / Interval(skewed) Two-Way ANOVA Interval Friedman Test Ordinal / Interva(skewed)l
Additional exercises Using the data from exercises 1-3 from Week 2, compare the findings using the appropriate non-parametric and parametric tests.