Non- Parametric Tests

1,114 views 132 slides Mar 29, 2022
Slide 1
Slide 1 of 132
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118
Slide 119
119
Slide 120
120
Slide 121
121
Slide 122
122
Slide 123
123
Slide 124
124
Slide 125
125
Slide 126
126
Slide 127
127
Slide 128
128
Slide 129
129
Slide 130
130
Slide 131
131
Slide 132
132

About This Presentation

Non-parametric tests are sometimes called distribution-free tests because they are based on fewer assumptions (e.g., they do not assume that the outcome is approximately normally distributed). The cost of fewer assumptions is that non-parametric tests are generally less powerful than their parametri...


Slide Content

NON-PARAMETRIC TESTS

Parameter Data Parameter One Sample Two Samples More than Two Samples     Scale & Normal    Mean    One Sample t test t test for independent samples ANOVA t test for dependent samples ANOVA with repeated measure Standard Deviation Chi-Square test F test Bartlett test    Scale but Non - Normal      Median  Wilcoxon test for single sample or Sign Test for single sample Mann-Whitney U test (Independent samples) Kruskal Wallis test Wilcoxon test for dependent samples or Sign test for dependent samples Friedman test    Nominal (Binary)    Proportion Z test for one sample Z test for two samples Chi-Square test for more than two proportion Sign Test    (Small Sample) Chi-Square test for two proportions  (Small Sample) Chi-Square test for more than two proportion (Small Sample)

Case Study A researcher collected the data for a sample of 100 individuals for heart study. Variable Type of Variable Coding Education Ordinal 1 none, 2 primary, 3 intermediate, 4 senior high, 5 technical school Gender Nominal 0 - Male. 1 - Female Weight in Kgs Scale ----- Height in cms. Scale ----- Smoking Nominal 0 - No , 1 - Yes Physical Activity Nominal 1 – Mostly sitting 2 - Moderate Blood glucose in mg % Scale ------ Serum cholesterol in mg % Scale ------ Systolic Blood Pressure (SBP) in (mmHg) Scale -------

One Sample Binomial Test for Proportion

Research Question Is there a difference between the proportion of Males and Females?

Null & Alternative Hypothesis The hypothesis testing problem is H0 : The proportion of Males and Females is same. (i.e., there is no significant difference between the proportion of Males and Females) H1 : The proportion of Males and Females is different. (i.e., there is significant difference between the proportion of Males and Females)

One Sample Binomial Test for Proportion Click on Analyze menu. Point to Non-parametric Tests. Click on One Sample.

One Sample Binomial Test for Proportion Select the objective as either Automatically compare observed data to hypothesized or Customize analysis.

One Sample Binomial Test for Proportion Select Use custom field assignments. Add Gender variable in Test Fields.

One Sample Binomial Test for Proportion Click on Settings tab. Either choose Automatically choose the test based on the data or choose Customize tests and select

One Sample Binomial Test for Proportion Click on Test Options and select Significance level (Default is = 0.05)

One Sample Binomial Test for Proportion Click on User Missing Values. Select appropriate option. Click on Run button.

Output Decision : The p-value of the test is 0.764 which is not less than 0.05, we fail to reject the null hypothesis. Conclusion : The proportion of Males and Females in this sample do not differ significantly.

Output Double click on Hypothesis Test Summary Table, we can get a new window called Model Viewer.

One Sample Binomial Test for Numeric Variable

Research Question Is the median Blood glucose level of the respondent is 152?

Null & Alternative Hypothesis Let μ be the median blood glucose level. The hypothesis testing problem is H0 : μ = 152 (The median blood glucose level of the respondents is 152) H1 : μ ≠ 152 (The median blood glucose level of the respondents is not 152). Proportion of cases with blood glucose < 152 is same to that of > 152.

One Sample Binomial Test for Numeric Variable Click on Analyze menu. Point to Non-parametric Tests. Click on One Sample.

One Sample Binomial Test for Numeric Variable Select the objective as either Automatically compare observed data to hypothesized or Customize analysis.

One Sample Binomial Test for Numeric Variable Select Fields Select Use custom field assignments. Add Blood Glucose variable in Test Fields.

One Sample Binomial Test for Numeric Variable Click on Settings tab. Either choose Automatically choose the test based on the data or choose Customize tests and select

One Sample Binomial Test for Numeric Variable Select Custom cut point and enter the value of median under null hypothesis as 152. Click on OK button.

One Sample Binomial Test for Numeric Variable In Test options, you can change the significance level.

One Sample Binomial Test for Numeric Variable Click on User Missing Values. Select appropriate option. Click on Run button.

Output Decision : The p-value of the test is 0.089 which is not less than 0.05, we fail to reject the null hypothesis. Conclusion : The median of the blood glucose level of the respondents is 152. (or the proportion of respondents with blood glucose less than or equal to 152 and greater than 152 is same).

Output Double click on Hypothesis Test Summary Table, we can get a new window called Model Viewer.

Chi-Square test for more than two proportions

Research Question Is the observed proportion of Weight status based on BMI is same across the different categories. ? [ Categories : Underweight, Normal Weight, Overweight, Obese]

Null & Alternative Hypothesis H0 : Distribution of Weight status based on BMI is uniform (i.e., with equal probabilities) H1 : Distribution of Weight status based on BMI is not uniform (i.e., with unequal probabilities).

Chi-Square test for more than two proportions Click on Analyze menu. Point to Non-parametric Tests. Click on One Sample.

Chi-Square test for more than two proportions Select the objective as either Automatically compare observed data to hypothesized or Customize analysis.

Chi-Square test for more than two proportions Select Fields Select Use custom field assignments. Add Weight Status variable in Test Fields.

Chi-Square test for more than two proportions Click on Settings tab. Either choose Automatically choose the test based on the data or choose Customize tests and select Compare observed probabilities to hypothesized (Chi-Square test).

Chi-Square test for more than two proportions Select All categories have equal probability. Otherwise click on Customize expected probability and enter the expected probabilities for each category. Click on OK button.

Chi-Square test for more than two proportions In Test options, you can change the significance level.

Chi-Square test for more than two proportions Click on User Missing Values. Select appropriate option. Click on Run button.

Output Decision : The p-value of the test is 0.000 which is less than 0.05, we reject the null hypothesis. Conclusion : Distribution of Weight status based on BMI is not uniform. (Or the observed proportion of respondents for various levels of weight status is different from hypothesized proportions).

Output Double click on Hypothesis Test Summary Table, we can get a new window called Model Viewer.

One-sample Kolmogorov – Smirnov test for Normality

One-sample Kolmogorov – Smirnov test for Normality One sample Kolmogorov-Smirnov test in SPSS is used for testing whether the sample is coming from a population with Normal distribution Uniform distribution Exponential distribution Poisson distribution.

Research Question Is the Blood glucose data coming from a normal population?

Null & Alternative Hypothesis H0 : The distribution of Blood glucose is normal H1 : The distribution of Blood glucose is not normal.

One-sample Kolmogorov – Smirnov test for Normality Click on Analyze menu. Point to Non-parametric Tests. Click on One Sample.

One-sample Kolmogorov – Smirnov test for Normality Select the objective as either Automatically compare observed data to hypothesized or Customize analysis.

One-sample Kolmogorov – Smirnov test for Normality Select Fields Select Use custom field assignments. Add Blood Glucose variable in Test Fields.

One-sample Kolmogorov – Smirnov test for Normality Click on Settings tab. Either choose Automatically choose the test based on the data or choose Customize tests and select Test observed distribution against hypothesized ( Kolmogorov – Smirnov)

One-sample Kolmogorov – Smirnov test for Normality Select Hypothesized Distribution as Normal. Select Distribution parameters as Use sample data Otherwise specify Mean and Std. Dev. Click on OK button.

One-sample Kolmogorov – Smirnov test for Normality In Test options, you can change the significance level.

One-sample Kolmogorov – Smirnov test for Normality Click on User Missing Values. Select appropriate option. Click on Run button.

Output Decision : The p-value of the test is 0.008 which is less than 0.05, we reject the null hypothesis. Conclusion : Distribution of Blood Glucose is not normally distributed.

Output Double click on Hypothesis Test Summary Table, we can get a new window called Model Viewer.

One-sample Wilcoxon – Signed Rank Test

One-sample Wilcoxon – Signed Rank Test One sample Wilcoxon Signed Rank Test is used to test whether the sample median differ significantly from hypothesized median. when the normality assumption about the data is not satisfied. when the data is at least ordinal (i.e., ordinal or scale) It is a non-parametric alternative to one sample t-test.

One-sample Wilcoxon – Signed Rank Test The Wilcoxon Signed Rank test is based on ranking the observations. Let X1,X2, · · · , Xn be a random sample from a continuous distribution. Let μ be the population median. H0 : μ = μ0 (μ0 is the specified value) H1 : μ ≠ μ0 (Two-tailed) or μ < μ0 (Left Tailed) or μ > μ0 (Right tailed)

One-sample Wilcoxon – Signed Rank Test Assumptions The sample data have been randomly selected. The sample observations are mutually independent. The data follows symmetric distribution. The measurement scale is at least ordinal.

Research Question Is the median Blood glucose level 142?

Null & Alternative Hypothesis Let μ = 142 be the hypothesized median blood glucose. The hypothesis testing problem is H0 : μ = 142 (The blood glucose data is coming from a population with median 142) H1 : μ ≠142 (The blood glucose data is not coming from a population with median 142)

One-sample Wilcoxon – Signed Rank Test Click on Analyze menu. Point to Non-parametric Tests. Click on One Sample.

One-sample Wilcoxon – Signed Rank Test Select the objective as either Automatically compare observed data to hypothesized or Customize analysis.

One-sample Wilcoxon – Signed Rank Test Select Fields Select Use custom field assignments. Add Blood Glucose variable in Test Fields.

One-sample Wilcoxon – Signed Rank Test Click on Settings tab. Either choose Automatically choose the test based on the data or choose Customize tests and select Compare median to hypothesized ( Wilcoxon Singed- Rank). Specify Hypothesized median as 142.

One-sample Wilcoxon – Signed Rank Test In Test options, you can change the significance level.

One-sample Wilcoxon – Signed Rank Test Click on User Missing Values. Select appropriate option. Click on Run button.

Output Decision : The p-value of the test is 0.293 which is not less than 0.05, we fail to reject the null hypothesis. Conclusion : The blood glucose data is coming from a population with median 142.

Output Double click on Hypothesis Test Summary Table, we can get a new window called Model Viewer.

Runs Test for Randomness

Runs Test for Randomness Many statistical tests assume that the sample observations are independent (i.e. the order in which the sample data were collected is irrelevant). The Runs test is a non-parametric test used to test randomness of the observations.

Research Question Is the Blood Glucose data randomly distributed?

Null & Alternative Hypothesis H0 : The Blood Glucose data is random H1 : The Blood Glucose data is not random

Runs Test for Randomness Click on Analyze menu. Point to Non-parametric Tests. Click on One Sample.

Runs Test for Randomness Select the objective as either Automatically compare observed data to hypothesized or Customize analysis.

Runs Test for Randomness Select Fields Select Use custom field assignments. Add Blood Glucose variable in Test Fields.

Runs Test for Randomness Click on Settings tab. Either choose Automatically choose the test based on the data or choose Customize tests and select Test sequence for Randomness ( Runs Test).

Runs Test for Randomness Select Sample median or Enter Custom value. Click on OK button.

Runs Test for Randomness In Test options, you can change the significance level.

Runs Test for Randomness Click on User Missing Values. Select appropriate option. Click on Run button.

Output Decision : The p-value of the test is 0.027 which is less than 0.05, we reject the null hypothesis. Conclusion : The blood glucose data is not random about the median.

Output Double click on Hypothesis Test Summary Table, we can get a new window called Model Viewer.

Mann-Whitney –Wilcoxon test (Two Independent samples)

Mann-Whitney –Wilcoxon test (Two Independent samples) Mann-Whitney-Wilcoxon Test is used to test whether the median of two independent groups differ significantly. when the normality assumption about the data is not satisfied. when the data is at least ordinal (i.e., ordinal or interval or ratio) It is a non-parametric alternative to independent sample t-test when the normality assumption is not satisfied.

Mann-Whitney –Wilcoxon test (Two Independent samples) Let X1,X2, · · · ,Xn1 and Y1, Y2, · · · , Yn2 be independent samples taken from two different populations. Let μ1 be the median of X and μ2 be the median of Y . The hypothesis testing problem can be stated as H0 : μ1 = μ2 (i.e. The two population locations are same) H1 : μ1 ≠ μ2 (Two-tailed) or μ1 < μ2 (Left Tailed) or μ1 > μ2 (Right tailed)

Assumptions Both the samples are random samples. The two samples are mutually independent. The two distributions must be identical. The level of measurement is at least ordinal.

Research Question Is there a significant difference between the Systolic Blood Pressure (SBP) of Smokers and Non-smokers? OR Is the median Systolic Blood Pressure (SBP) same for Non-smokers and Smokers?

Null & Alternative Hypothesis X denote the Systolic Blood Pressure (SBP) for Non-smokers and Y denote the Systolic Blood Pressure (SBP) for Smokers. μ1 denote the median Systolic Blood Pressure (SBP) for Non-smokers and μ2 denote the median Systolic Blood Pressure (SBP) for Smokers. H0 : μ1 = μ2, i.e., The two samples are coming from the same population H0 : μ1 ≠ μ2, i.e., The two samples are coming from different population.

Mann-Whitney –Wilcoxon test Click on Analyze menu. Point to Non-parametric Tests. Point to Legacy Dialogs. Click on 2 Independent samples

Mann-Whitney –Wilcoxon test Add SBP in Test Variable List and Smoking in Grouping Variable. Click on Define Groups.

Mann-Whitney –Wilcoxon test Define groups as Group 1: 0 and Group 2: 1 as per value labels. Click on Continue.

Mann-Whitney –Wilcoxon test Click on Options.

Mann-Whitney –Wilcoxon test Select Descriptive and Quartiles. Click Continue. On the main window click OK button.

Output Decision : The p-value of the test is 0.909 which is not less than 0.05, we fail to reject the null hypothesis. Conclusion : There is no significant difference between the median SBP of smokers and Non-smokers.

Dependent samples Sign Test

Assumptions Paired differences are independent. The variable of interest is at least ordinal.

Case Study A new chemotherapy treatment is proposed for patients with breast cancer. Investigators are concerned with patient’s ability to tolerate the treatment and assess their quality of life both before and after receiving the new chemotherapy treatment. Quality of life (QOL) is measured on an ordinal scale and for analysis purposes, numbers are assigned to each response category as follows: 1=Poor, 2= Fair, 3=Good, 4= Very Good, 5 = Excellent.

Case Study Test whether there is a difference in QOL after chemotherapy treatment as compared to before.

Research Question Is there a significant difference in QOL after chemotherapy treatment as compared to before?

Null & Alternative Hypothesis Let μB denote the median of QOL before chemotherapy and μA denote the median of QOL after chemotherapy. H0 : μ B = μ A or μ B − μ A = 0 (i.e., There is no difference in the QOL after treatment as compared to before treatment.) H1 : μ B ≠ μ A or μ B − μ A ≠ 0 (i.e., There is a difference in the QOL after treatment as compared to before treatment)

Data in SPSS

Dependent samples Sign Test Click on Analyze menu. Point to Non-parametric Tests. Point to Legacy Dialogs. Click on 2 Related Samples samples

Dependent samples Sign Test Select Test Pairs as QOL Before and QOL After. Select Sign. Click on the Options.

Dependent samples Sign Test Select Descriptive and Quartiles. Click on Continue button. Click on OK button

Output Decision : The p-value of the test is 0.109 which is not less than 0.05, we fail to reject the null hypothesis. Conclusion : There is no significant difference between the QOL before and after chemotherapy treatment.

Wilcoxon Signed Rank Sum Test

Wilcoxon Signed Rank Sum Test Wilcoxon-Signed Rank Sum test is used for paired (dependent) data. It is an non-parametric alternative for paired t-test. When the assumptions of paired t-test are not satisfied, we can use Wilcoxon Signed Rank Sum Test. Note: The sign test ignores the magnitude and only consider the direction of the difference, whereas Wilcoxon-signed Rank Sum test takes into account the magnitude and the direction of the difference.

Assumptions Paired differences are independent. The variable of interest is at least ordinal.

Case Study A sample of 15 patients suffering from asthma participated in an experiment to study the effect of a new treatment on pulmonary function. Among the various measurements recorded were those of forced expiratory volume (litres) in 1 second (FEV1) before and after application of the treatment. The results were as follows:

Case Study On the basis of these data, can one conclude that the treatment is effective in increasing the FEV1 level?

Research Question Is the treatment effective in increasing the FEV1 level?

Null & Alternative Hypothesis Let μB be the median forced expiratory volume (litres) in 1 second (FEV1) before application of treatment and μA be the median forced expiratory volume (litres) in 1 second (FEV1) after application of treatment. H0 : μB = μA (The treatment is not effective in increasing the FEV1 level) H1 : μB < μA (The treatment is effective in increasing the FEV1 level).

Data in SPSS

Wilcoxon Signed Rank Sum Test Click on Analyze menu. Point to Non-parametric Tests. Point to Legacy Dialogs. Click on 2 related samples

Wilcoxon Signed Rank Sum Test Select Test Pairs as FEV1 Before and FEV1 After. Select Wilcoxon Click on the Options.

Wilcoxon Signed Rank Sum Test Select Descriptive and Quartiles. Click on Continue button. Click on OK button

Output Decision : The p-value of the test is 0.004/2 = 0.002 (As alternative hypothesis is one tailed) which is less than 0.05, we reject the null hypothesis. Conclusion : The treatment is effective in increasing the FEV1 level.

Output Decision : The p-value of the test is 0.004/2 = 0.002 (As alternative hypothesis is one tailed) which is less than 0.05, we reject the null hypothesis. Conclusion : The treatment is effective in increasing the FEV1 level.

Kruskal – Wallis Test

Kruskal – Wallis Test It is an extension of Mann-Whitney test when more than two populations are to be compared. A non-parametric alternative to the ANOVA test. It is recommended when the assumptions of ANOVA are not satisfied.

Assumptions The k samples are independent. Each sample is a random sample. Variable have a continuous distribution. Populations have the same variability. Populations have the same shape.

Case Study Ten chefs were asked to test the quality of four different brands of orange juice. The chefs assigned scores using a 5-point scale where 1 = Bad, 2 = Poor, 3 = Average, 4 = Good, and 5 = Excellent. Can we conclude at the 5% significance level that there are differences in sensory quality between the four brands of orange juice?

Case Study Chef Orange Juice Chef Brand 1 Brand 2 Brand 3 Brand 4 1 3 5 4 3 2 2 3 5 4 3 4 4 3 4 4 3 4 5 2 5 2 4 4 3 6 4 5 5 3 7 3 3 4 4 8 2 3 3 3 9 4 3 5 4 10 2 4 5 3

Research Question Is there differences in sensory quality between the four brands of orange juice?

Null & Alternative Hypothesis H0 : There are no differences in sensory quality between the four brands of orange juice. (i.e., H0 : μ1 = μ2 = μ3 = μ4) H1 : There are differences in sensory quality between the four brands of orange juice. (i.e., H1 : μi ≠ μj for at least one pair.)

Data in SPSS

Data in SPSS

Kruskal – Wallis Test Click on Analyze menu. Point to Non-parametric Tests. Click on Independent samples

Kruskal – Wallis Test Go to Fields tab. Add Quality Rating in Test Fields and Orange Juice Brand in Groups.

Kruskal – Wallis Test Click on Settings tab. Select Customize tests. Select Kruskal Wallis 1-way ANOVA (k samples).

Kruskal – Wallis Test In Test options, you can change the significance level.

Kruskal – Wallis Test Click on User Missing Values. Select appropriate option. Click on Run button.

Output Decision : The p-value of the test is 0.008 which is less than 0.05, we reject the null hypothesis. Conclusion : There are differences in sensory quality between the four brands of orange juice.

Output Double click on Hypothesis Test Summary Table, we can get a new window called Model Viewer.

Output The p-value for the pair (OJ1,OJ3) is less than 0.05. Hence the pair (OJ1,OJ3) shows a significant difference in median rating. There is significant difference in sensory quality between the brands OJ1 and OJ3 of orange juice.

THANK YOU Dr Parag Shah | M.Sc., M.Phil., Ph.D. ( Statistics) [email protected] www.paragstatistics.wordpress.com