Slide 1 Shakeel Nouman M.Phil Statistics Nonparametric Methods and Chi-Square Tests (1) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman.

Slides:



Advertisements
Similar presentations
Prepared by Lloyd R. Jaisingh
Advertisements

Hypothesis Testing Steps in Hypothesis Testing:
COMPLETE BUSINESS STATISTICS
Chapter 16 Introduction to Nonparametric Statistics
Hypothesis: It is an assumption of population parameter ( mean, proportion, variance) There are two types of hypothesis : 1) Simple hypothesis :A statistical.
Economics 105: Statistics Go over GH 11 & 12 GH 13 & 14 due Thursday.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Nonparametric Methods Chapter 15.
INTRODUCTION TO NON-PARAMETRIC ANALYSES CHI SQUARE ANALYSIS.
Chapter 12 Chi-Square Tests and Nonparametric Tests
Chapter 14 Analysis of Categorical Data
Chapter 12 Chi-Square Tests and Nonparametric Tests
Chapter Goals After completing this chapter, you should be able to:
Test statistic: Group Comparison Jobayer Hossain Larry Holmes, Jr Research Statistics, Lecture 5 October 30,2008.
Final Review Session.
Statistics for Managers Using Microsoft® Excel 5th Edition
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 14 Goodness-of-Fit Tests and Categorical Data Analysis.
1 Pertemuan 25 Metode Non Parametrik-1 Matakuliah: A0064 / Statistik Ekonomi Tahun: 2005 Versi: 1/1.
Student’s t statistic Use Test for equality of two means
15-1 Introduction Most of the hypothesis-testing and confidence interval procedures discussed in previous chapters are based on the assumption that.
BCOR 1020 Business Statistics
Chapter 12 Chi-Square Tests and Nonparametric Tests
Chi-Square Tests and the F-Distribution
1 Nominal Data Greg C Elvers. 2 Parametric Statistics The inferential statistics that we have discussed, such as t and ANOVA, are parametric statistics.
Nonparametrics and goodness of fit Petter Mostad
Chapter 15 Nonparametric Statistics
Nonparametric or Distribution-free Tests
Chapter 9 Title and Outline 1 9 Tests of Hypotheses for a Single Sample 9-1 Hypothesis Testing Statistical Hypotheses Tests of Statistical.
AM Recitation 2/10/11.
Aaker, Kumar, Day Ninth Edition Instructor’s Presentation Slides
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.Chap 12-1 Statistics for Managers Using Microsoft® Excel 5th Edition Chapter.
Chapter 11 Nonparametric Tests Larson/Farber 4th ed.
11 Chapter Nonparametric Tests © 2012 Pearson Education, Inc.
Chapter 14: Nonparametric Statistics
Hypothesis Testing.
Copyright © 2010, 2007, 2004 Pearson Education, Inc Lecture Slides Elementary Statistics Eleventh Edition and the Triola Statistics Series by.
NONPARAMETRIC STATISTICS
Chapter 14 Nonparametric Statistics. 2 Introduction: Distribution-Free Tests Distribution-free tests – statistical tests that don’t rely on assumptions.
Chapter 11 Nonparametric Tests.
Chapter 9: Non-parametric Tests n Parametric vs Non-parametric n Chi-Square –1 way –2 way.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests and Nonparametric Tests Statistics for.
Biostatistics, statistical software VII. Non-parametric tests: Wilcoxon’s signed rank test, Mann-Whitney U-test, Kruskal- Wallis test, Spearman’ rank correlation.
1 Nonparametric Statistical Techniques Chapter 17.
Lesson 15 - R Chapter 15 Review. Objectives Summarize the chapter Define the vocabulary used Complete all objectives Successfully answer any of the review.
Learning Objectives Copyright © 2002 South-Western/Thomson Learning Statistical Testing of Differences CHAPTER fifteen.
STATISTICAL ANALYSIS FOR THE MATHEMATICALLY-CHALLENGED Associate Professor Phua Kai Lit School of Medicine & Health Sciences Monash University (Sunway.
Section 10.2 Independence. Section 10.2 Objectives Use a chi-square distribution to test whether two variables are independent Use a contingency table.
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-1 Chapter 12 Chi-Square Tests and Nonparametric Tests Statistics for Managers using.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests and Nonparametric Tests Statistics for.
© Copyright McGraw-Hill CHAPTER 11 Other Chi-Square Tests.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Nonparametric Methods and Chi-Square Tests Session 5.
Chapter Outline Goodness of Fit test Test of Independence.
Statistics in Applied Science and Technology Chapter14. Nonparametric Methods.
CD-ROM Chap 16-1 A Course In Business Statistics, 4th © 2006 Prentice-Hall, Inc. A Course In Business Statistics 4 th Edition CD-ROM Chapter 16 Introduction.
NON-PARAMETRIC STATISTICS
© Copyright McGraw-Hill 2004
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical.
Biostatistics Nonparametric Statistics Class 8 March 14, 2000.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Chapter 14 Nonparametric Methods and Chi-Square Tests
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 12 Tests of Goodness of Fit and Independence n Goodness of Fit Test: A Multinomial.
Copyright © 2010, 2007, 2004 Pearson Education, Inc Lecture Slides Elementary Statistics Eleventh Edition and the Triola Statistics Series by.
Chapter 10 Section 5 Chi-squared Test for a Variance or Standard Deviation.
Hypothesis Tests u Structure of hypothesis tests 1. choose the appropriate test »based on: data characteristics, study objectives »parametric or nonparametric.
Section 10.2 Objectives Use a contingency table to find expected frequencies Use a chi-square distribution to test whether two variables are independent.
CHI SQUARE DISTRIBUTION. The Chi-Square (  2 ) Distribution The chi-square distribution is the probability distribution of the sum of several independent,
1 Pertemuan 26 Metode Non Parametrik-2 Matakuliah: A0064 / Statistik Ekonomi Tahun: 2005 Versi: 1/1.
Chapter 12 Chi-Square Tests and Nonparametric Tests
Hypothesis testing. Chi-square test
Nonparametric Statistics
Presentation transcript:

Slide 1 Shakeel Nouman M.Phil Statistics Nonparametric Methods and Chi-Square Tests (1) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 2 Using Statistics The Sign Test The Runs Test - A Test for Randomness The Mann-Whitney U Test The Wilcoxon Signed-Rank Test The Kruskal-Wallis Test - A Nonparametric Alternative to One-Way ANOVA Nonparametric Methods and Chi-Square Tests (1)  Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 3 The Friedman Test for a Randomized Block Design The Spearman Rank Correlation Coefficient A Chi-Square Test for Goodness of Fit Contingency Table Analysis - A Chi- Square Test for Independence A Chi-Square Test for Equality of Proportions Summary and Review of Terms Nonparametric Methods and Chi-Square Tests (2)  Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 4 Parametric Methods Inferences based on assumptions about the nature of the population distribution » Usually: population is normal Types of tests » z-test or t-test » Comparing two population means or proportions » Testing value of population mean or proportion » ANOVA » Testing equality of several population means Parametric Methods Inferences based on assumptions about the nature of the population distribution » Usually: population is normal Types of tests » z-test or t-test » Comparing two population means or proportions » Testing value of population mean or proportion » ANOVA » Testing equality of several population means 14-1 Using Statistics (Parametric Tests) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 5 Nonparametric Tests Distribution-free methods making no assumptions about the population distribution Types of tests » Sign tests » Sign Test: Comparing paired observations » McNemar Test: Comparing qualitative variables » Cox and Stuart Test: Detecting trend » Runs tests » Runs Test: Detecting randomness » Wald-Wolfowitz Test: Comparing two distributions Nonparametric Tests Distribution-free methods making no assumptions about the population distribution Types of tests » Sign tests » Sign Test: Comparing paired observations » McNemar Test: Comparing qualitative variables » Cox and Stuart Test: Detecting trend » Runs tests » Runs Test: Detecting randomness » Wald-Wolfowitz Test: Comparing two distributions Nonparametric Tests Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 6 Nonparametric Tests Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks – Kruskal-Wallis Test – Friedman Test: Repeated measures Spearman Rank Correlation Coefficient Chi-Square Tests Goodness of Fit Testing for independence: Contingency Table Analysis Equality of Proportions Nonparametric Tests Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks – Kruskal-Wallis Test – Friedman Test: Repeated measures Spearman Rank Correlation Coefficient Chi-Square Tests Goodness of Fit Testing for independence: Contingency Table Analysis Equality of Proportions Nonparametric Tests (Continued) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 7 Deal with enumerative (frequency counts) data. Do not deal with specific population parameters, such as the mean or standard deviation. Do not require assumptions about specific population distributions (in particular, the normality assumption). Deal with enumerative (frequency counts) data. Do not deal with specific population parameters, such as the mean or standard deviation. Do not require assumptions about specific population distributions (in particular, the normality assumption). Nonparametric Tests (Continued) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 8 Comparing paired observations Paired observations: X and Y p = P(X>Y) » Two-tailed test H 0 : p = 0.50 H 1 : p  0.50 » Right-tailed testH 0 : p  0.50 H 1 : p  0.50 » Left-tailed testH 0 : p  0.50 H 1 : p  0.50 » Test statistic: T = Number of + signs Comparing paired observations Paired observations: X and Y p = P(X>Y) » Two-tailed test H 0 : p = 0.50 H 1 : p  0.50 » Right-tailed testH 0 : p  0.50 H 1 : p  0.50 » Left-tailed testH 0 : p  0.50 H 1 : p  0.50 » Test statistic: T = Number of + signs 14-2 Sign Test Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 9 Small Sample: Binomial Test For a two-tailed test, find a critical point corresponding as closely as possible to  /2 (C 1 ) and define C 2 as n-C 1. Reject null hypothesis if T  C 1 or T  C 2. For a right-tailed test, reject H 0 if T  C, where C is the value of the binomial distribution with parameters n and p = 0.50 such that the sum of the probabilities of all values less than or equal to C is as close as possible to the chosen level of significance, . For a left-tailed test, reject H 0 if T  C, where C is defined as above. Small Sample: Binomial Test For a two-tailed test, find a critical point corresponding as closely as possible to  /2 (C 1 ) and define C 2 as n-C 1. Reject null hypothesis if T  C 1 or T  C 2. For a right-tailed test, reject H 0 if T  C, where C is the value of the binomial distribution with parameters n and p = 0.50 such that the sum of the probabilities of all values less than or equal to C is as close as possible to the chosen level of significance, . For a left-tailed test, reject H 0 if T  C, where C is defined as above. Sign Test Decision Rule Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 10 Cumulative Binomial Probabilities (n=15, p=0.5) x F(x) CEO Before After Sign CEO Before After Sign n = 15 T = 12  C1=3 C2 = 15-3 = 12 H 0 rejected, since T  C2 C1 Example 14-1 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 11 Example Using the Template H 0 : p = 0.5 H 1 : p  0.5 Test Statistic: T = 12 p-value = For a = 0.05, the null hypothesis is rejected since < Thus one can conclude that there is a change in attitude toward a CEO following the award of an MBA degree. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 12 A run is a sequence of like elements that are preceded and followed by different elements or no element at all. Case 1: S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E : R = 20 Apparently nonrandom Case 2: SSSSSSSSSS|EEEEEEEEEE : R = 2 Apparently nonrandom Case 3: S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E : R = 12 Perhaps random Case 1: S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E : R = 20 Apparently nonrandom Case 2: SSSSSSSSSS|EEEEEEEEEE : R = 2 Apparently nonrandom Case 3: S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E : R = 12 Perhaps random A two-tailed hypothesis test for randomness: H 0 : Observations are generated randomly H 1 : Observations are not generated randomly Test Statistic: R=Number of Runs Reject H 0 at level  if R  C1 or R  C2, as given in Table 8, with total tail probability P(R  C 1 ) + P(R  C 2 ) =   A two-tailed hypothesis test for randomness: H 0 : Observations are generated randomly H 1 : Observations are not generated randomly Test Statistic: R=Number of Runs Reject H 0 at level  if R  C1 or R  C2, as given in Table 8, with total tail probability P(R  C 1 ) + P(R  C 2 ) =   14-3 The Runs Test - A Test for Randomness Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 13 Table 8: Number of Runs (r) (n 1,n 2 ) (10,10) Table 8: Number of Runs (r) (n 1,n 2 ) (10,10) Case 1: n 1 = 10 n 2 = 10 R= 20 p-value  0 Case 2: n 1 = 10 n 2 = 10 R = 2 p-value  0 Case 3: n 1 = 10 n 2 = 10 R= 12 p-value    PR          F(11)] = (2)( ) = (2)(0.414) = H 0 not rejected Case 1: n 1 = 10 n 2 = 10 R= 20 p-value  0 Case 2: n 1 = 10 n 2 = 10 R = 2 p-value  0 Case 3: n 1 = 10 n 2 = 10 R= 12 p-value    PR          F(11)] = (2)( ) = (2)(0.414) = H 0 not rejected Runs Test: Examples Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 14 Large-Sample Runs Test: Using the Normal Approximation Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 15 Example 14-2: n 1 = 27 n 2 = 26 R = 15 H 0 should be rejected at any common level of significance. Large-Sample Runs Test: Example 14-2 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 16 Large-Sample Runs Test: Example 14-2 – Using the Template Note:The computed p-value using the template is as compared to the manually computed value of The value of is more accurate. Note: The computed p-value using the template is as compared to the manually computed value of The value of is more accurate. Reject the null hypothesis that the residuals are random. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 17 The null and alternative hypotheses for the Wald-Wolfowitz test: H 0 : The two populations have the same distribution H 1 : The two populations have different distributions The test statistic: R = Number of Runs in the sequence of samples, when the data from both samples have been sorted The null and alternative hypotheses for the Wald-Wolfowitz test: H 0 : The two populations have the same distribution H 1 : The two populations have different distributions The test statistic: R = Number of Runs in the sequence of samples, when the data from both samples have been sorted Salesperson A: Salesperson B: Salesperson A: Salesperson B: Using the Runs Test to Compare Two Population Distributions (Means): the Wald-Wolfowitz Test Example 14-3: Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 18 Table Number of Runs (r) (n 1,n 2 )2345. (9,10) Table Number of Runs (r) (n 1,n 2 )2345. (9,10) Sales SalesSalesPerson SalesPerson(Sorted)(Sorted)Runs 35A13 B 44A16 B 39A17 B 48A21 B 60A24 B 1 75A29 A 2 49A32 B 66A33 B 3 17B35 A 23B39 A 13B44 A 24B48 A 33B49 A 21B50 A 18B60 A 16B66 A 32B75 A 4 Sales SalesSalesPerson SalesPerson(Sorted)(Sorted)Runs 35A13 B 44A16 B 39A17 B 48A21 B 60A24 B 1 75A29 A 2 49A32 B 66A33 B 3 17B35 A 23B39 A 13B44 A 24B48 A 33B49 A 21B50 A 18B60 A 16B66 A 32B75 A 4 n 1 = 10 n 2 = 9 R= 4 p-value  P   H 0 may be rejected n 1 = 10 n 2 = 9 R= 4 p-value  P   H 0 may be rejected The Wald-Wolfowitz Test: Example 14-3 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 19 Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks Kruskal-Wallis Test Friedman Test: Repeated measures Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks Kruskal-Wallis Test Friedman Test: Repeated measures Ranks Tests Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 20 The null and alternative hypotheses: H 0 : The distributions of two populations are identical H 1 : The two population distributions are not identical The Mann-Whitney U statistic: where n 1 is the sample size from population 1 and n 2 is the sample size from population 2. The null and alternative hypotheses: H 0 : The distributions of two populations are identical H 1 : The two population distributions are not identical The Mann-Whitney U statistic: where n 1 is the sample size from population 1 and n 2 is the sample size from population The Mann-Whitney U Test (Comparing Two Populations) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 21 Cumulative Distribution Function of the Mann-Whitney U Statistic n 2 =6 n 1 =6 u Rank ModelTimeRankSum A35 5 A38 8 A4010 A4212 A4111 A B29 2 B27 1 B30 3 B33 4 B39 9 B Rank ModelTimeRankSum A35 5 A38 8 A4010 A4212 A4111 A B29 2 B27 1 B30 3 B33 4 B39 9 B P( u  5) The Mann-Whitney U Test: Example 14-4 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 22 Example 14-5: Large-Sample Mann-Whitney U Test Score Rank Score Program Rank Sum Score Rank Score Program Rank Sum Score Rank Score Program Rank Sum Score Rank Score Program Rank Sum Since the test statistic is z = -3.32, the p-value  , and H 0 is rejected. Since the test statistic is z = -3.32, the p-value  , and H 0 is rejected. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 23 Example 14-5: Large-Sample Mann-Whitney U Test – Using the Template Since the test statistic is z = , the p-value  , and H 0 is rejected. That is, the LC (Learning Curve) program is more effective. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 24 The null and alternative hypotheses: H 0 : The median difference between populations are 1 and 2 is zero H 1 : The median difference between populations are 1 and 2 is not zero Find the difference between the ranks for each pair, D = x 1 -x 2, and then rank the absolute values of the differences. The Wilcoxon T statistic is the smaller of the sums of the positive ranks and the sum of the negative ranks: For small samples, a left-tailed test is used, using the values in Appendix C, Table 10. The large-sample test statistic: The null and alternative hypotheses: H 0 : The median difference between populations are 1 and 2 is zero H 1 : The median difference between populations are 1 and 2 is not zero Find the difference between the ranks for each pair, D = x 1 -x 2, and then rank the absolute values of the differences. The Wilcoxon T statistic is the smaller of the sums of the positive ranks and the sum of the negative ranks: For small samples, a left-tailed test is used, using the values in Appendix C, Table 10. The large-sample test statistic: 14-5 The Wilcoxon Signed- Ranks Test (Paired Ranks) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 25 Sold Sold Rank Rank Rank (1) (2) D=x 1 -x 2 ABS(D) ABS(D)(D>0) (D<0) **** Sum:8634 Sold Sold Rank Rank Rank (1) (2) D=x 1 -x 2 ABS(D) ABS(D)(D>0) (D<0) **** Sum:8634 T=34 n=15 P= P= P= P= H 0 is not rejected (Note the arithmetic error in the text for store 13) T=34 n=15 P= P= P= P= H 0 is not rejected (Note the arithmetic error in the text for store 13) Example 14-6 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 26 Hourly Rank Rank Rank Messages Md 0 D=x 1 -x 2 ABS(D) ABS(D) (D>0) (D<0) Sum: Hourly Rank Rank Rank Messages Md 0 D=x 1 -x 2 ABS(D) ABS(D) (D>0) (D<0) Sum: Example 14-7 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 27 Example 14-7 using the Template Note 1: Note 1: You should enter the claimed value of the mean (median) in every used row of the second column of data. In this case it is 149. Note 2: Note 2: In order for the large sample approximations to be computed you will need to change n > 25 to n >= 25 in cells M13 and M14. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 28 The Kruskal-Wallis hypothesis test: H 0 : All k populations have the same distribution H 1 : Not all k populations have the same distribution The Kruskal-Wallis test statistic: If each n j > 5, then H is approximately distributed as a  2. The Kruskal-Wallis hypothesis test: H 0 : All k populations have the same distribution H 1 : Not all k populations have the same distribution The Kruskal-Wallis test statistic: If each n j > 5, then H is approximately distributed as a  The Kruskal-Wallis Test - A Nonparametric Alternative to One-Way ANOVA Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 29 SoftwareTimeRank Group RankSum SoftwareTimeRank Group RankSum  2 (2,0.005) = , so H 0 is rejected. Example 14-8: The Kruskal- Wallis Test Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 30 Example 14-8: The Kruskal-Wallis Test – Using the Template Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 31 If the null hypothesis in the Kruskal-Wallis test is rejected, then we may wish, in addition, compare each pair of populations to determine which are different and which are the same. Further Analysis (Pairwise Comparisons of Average Ranks) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 32 Pairwise Comparisons: Example 14-8 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 33 The Friedman test is a nonparametric version of the randomized block design ANOVA. Sometimes this design is referred to as a two-way ANOVA with one item per cell because it is possible to view the blocks as one factor and the treatment levels as the other factor. The test is based on ranks The Friedman Test for a Randomized Block Design The Friedman hypothesis test: H 0 : The distributions of the k treatment populations are identical H 1 : Not all k distribution are identical The Friedman test statistic: The degrees of freedom for the chi-square distribution is (k – 1). The Friedman hypothesis test: H 0 : The distributions of the k treatment populations are identical H 1 : Not all k distribution are identical The Friedman test statistic: The degrees of freedom for the chi-square distribution is (k – 1). Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 34 Example – using the Template Note: Note: The p-value is small relative to a significance level of a = 0.05, so one should conclude that there is evidence that not all three low- budget cruise lines are equally preferred by the frequent cruiser population Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 35 The Spearman Rank Correlation Coefficient is the simple correlation coefficient calculated from variables converted to ranks from their original values The Spearman Rank Correlation Coefficient Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 36 Using Statistics The Sign Test The Runs Test - A Test for Randomness The Mann-Whitney U Test The Wilcoxon Signed-Rank Test The Kruskal-Wallis Test - A Nonparametric Alternative to One-Way ANOVA Nonparametric Methods and Chi-Square Tests (1)  Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 37 The Friedman Test for a Randomized Block Design The Spearman Rank Correlation Coefficient A Chi-Square Test for Goodness of Fit Contingency Table Analysis - A Chi- Square Test for Independence A Chi-Square Test for Equality of Proportions Summary and Review of Terms Nonparametric Methods and Chi-Square Tests (2)  Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 38 Parametric Methods Inferences based on assumptions about the nature of the population distribution » Usually: population is normal Types of tests » z-test or t-test » Comparing two population means or proportions » Testing value of population mean or proportion » ANOVA » Testing equality of several population means Parametric Methods Inferences based on assumptions about the nature of the population distribution » Usually: population is normal Types of tests » z-test or t-test » Comparing two population means or proportions » Testing value of population mean or proportion » ANOVA » Testing equality of several population means 14-1 Using Statistics (Parametric Tests) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 39 Nonparametric Tests Distribution-free methods making no assumptions about the population distribution Types of tests » Sign tests » Sign Test: Comparing paired observations » McNemar Test: Comparing qualitative variables » Cox and Stuart Test: Detecting trend » Runs tests » Runs Test: Detecting randomness » Wald-Wolfowitz Test: Comparing two distributions Nonparametric Tests Distribution-free methods making no assumptions about the population distribution Types of tests » Sign tests » Sign Test: Comparing paired observations » McNemar Test: Comparing qualitative variables » Cox and Stuart Test: Detecting trend » Runs tests » Runs Test: Detecting randomness » Wald-Wolfowitz Test: Comparing two distributions Nonparametric Tests Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 40 Nonparametric Tests Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks – Kruskal-Wallis Test – Friedman Test: Repeated measures Spearman Rank Correlation Coefficient Chi-Square Tests Goodness of Fit Testing for independence: Contingency Table Analysis Equality of Proportions Nonparametric Tests Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks – Kruskal-Wallis Test – Friedman Test: Repeated measures Spearman Rank Correlation Coefficient Chi-Square Tests Goodness of Fit Testing for independence: Contingency Table Analysis Equality of Proportions Nonparametric Tests (Continued) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 41 Deal with enumerative (frequency counts) data. Do not deal with specific population parameters, such as the mean or standard deviation. Do not require assumptions about specific population distributions (in particular, the normality assumption). Deal with enumerative (frequency counts) data. Do not deal with specific population parameters, such as the mean or standard deviation. Do not require assumptions about specific population distributions (in particular, the normality assumption). Nonparametric Tests (Continued) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 42 Comparing paired observations Paired observations: X and Y p = P(X>Y) » Two-tailed test H 0 : p = 0.50 H 1 : p  0.50 » Right-tailed testH 0 : p  0.50 H 1 : p  0.50 » Left-tailed testH 0 : p  0.50 H 1 : p  0.50 » Test statistic: T = Number of + signs Comparing paired observations Paired observations: X and Y p = P(X>Y) » Two-tailed test H 0 : p = 0.50 H 1 : p  0.50 » Right-tailed testH 0 : p  0.50 H 1 : p  0.50 » Left-tailed testH 0 : p  0.50 H 1 : p  0.50 » Test statistic: T = Number of + signs 14-2 Sign Test Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 43 Small Sample: Binomial Test For a two-tailed test, find a critical point corresponding as closely as possible to  /2 (C 1 ) and define C 2 as n-C 1. Reject null hypothesis if T  C 1 or T  C 2. For a right-tailed test, reject H 0 if T  C, where C is the value of the binomial distribution with parameters n and p = 0.50 such that the sum of the probabilities of all values less than or equal to C is as close as possible to the chosen level of significance, . For a left-tailed test, reject H 0 if T  C, where C is defined as above. Small Sample: Binomial Test For a two-tailed test, find a critical point corresponding as closely as possible to  /2 (C 1 ) and define C 2 as n-C 1. Reject null hypothesis if T  C 1 or T  C 2. For a right-tailed test, reject H 0 if T  C, where C is the value of the binomial distribution with parameters n and p = 0.50 such that the sum of the probabilities of all values less than or equal to C is as close as possible to the chosen level of significance, . For a left-tailed test, reject H 0 if T  C, where C is defined as above. Sign Test Decision Rule Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 44 Cumulative Binomial Probabilities (n=15, p=0.5) x F(x) Cumulative Binomial Probabilities (n=15, p=0.5) x F(x) CEO Before After Sign CEO Before After Sign n = 15 T = 12  C1=3 C2 = 15-3 = 12 H 0 rejected, since T  C2 n = 15 T = 12  C1=3 C2 = 15-3 = 12 H 0 rejected, since T  C2 C1 Example 14-1 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 45 Example Using the Template H 0 : p = 0.5 H 1 : p  Test Statistic: T = 12 p-value = For  = 0.05, the null hypothesis is rejected since < Thus one can conclude that there is a change in attitude toward a CEO following the award of an MBA degree. H 0 : p = 0.5 H 1 : p  Test Statistic: T = 12 p-value = For  = 0.05, the null hypothesis is rejected since < Thus one can conclude that there is a change in attitude toward a CEO following the award of an MBA degree. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 46 A run is a sequence of like elements that are preceded and followed by different elements or no element at all. Case 1: S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E : R = 20 Apparently nonrandom Case 2: SSSSSSSSSS|EEEEEEEEEE : R = 2 Apparently nonrandom Case 3: S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E : R = 12 Perhaps random Case 1: S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E : R = 20 Apparently nonrandom Case 2: SSSSSSSSSS|EEEEEEEEEE : R = 2 Apparently nonrandom Case 3: S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E : R = 12 Perhaps random A two-tailed hypothesis test for randomness: H 0 : Observations are generated randomly H 1 : Observations are not generated randomly Test Statistic: R=Number of Runs Reject H 0 at level  if R  C1 or R  C2, as given in Table 8, with total tail probability P(R  C 1 ) + P(R  C 2 ) =  A two-tailed hypothesis test for randomness: H 0 : Observations are generated randomly H 1 : Observations are not generated randomly Test Statistic: R=Number of Runs Reject H 0 at level  if R  C1 or R  C2, as given in Table 8, with total tail probability P(R  C 1 ) + P(R  C 2 ) =  14-3 The Runs Test - A Test for Randomness Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 47 Table 8: Number of Runs (r) (n 1,n 2 ) (10,10) Table 8: Number of Runs (r) (n 1,n 2 ) (10,10) Case 1: n 1 = 10 n 2 = 10 R= 20 p-value  0 Case 2: n 1 = 10 n 2 = 10 R = 2 p-value  0 Case 3: n 1 = 10 n 2 = 10 R= 12 p-value  P  R  F(11)] = (2)( ) = (2)(0.414) = H 0 not rejected Case 1: n 1 = 10 n 2 = 10 R= 20 p-value  0 Case 2: n 1 = 10 n 2 = 10 R = 2 p-value  0 Case 3: n 1 = 10 n 2 = 10 R= 12 p-value  P  R  F(11)] = (2)( ) = (2)(0.414) = H 0 not rejected Runs Test: Examples Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 48 Large-Sample Runs Test: Using the Normal Approximation Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 49 Example 14-2: n 1 = 27 n 2 = 26 R = 15 H 0 should be rejected at any common level of significance. Large-Sample Runs Test: Example 14-2 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 50 Large-Sample Runs Test: Example 14-2 – Using the Template Note:The computed p- value using the template is as compared to the manually computed value of The value of is more accurate. Note: The computed p- value using the template is as compared to the manually computed value of The value of is more accurate. Reject the null hypothesis that the residuals are random. Note:The computed p- value using the template is as compared to the manually computed value of The value of is more accurate. Note: The computed p- value using the template is as compared to the manually computed value of The value of is more accurate. Reject the null hypothesis that the residuals are random. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 51 The null and alternative hypotheses for the Wald-Wolfowitz test: H 0 : The two populations have the same distribution H 1 : The two populations have different distributions The test statistic: R = Number of Runs in the sequence of samples, when the data from both samples have been sorted The null and alternative hypotheses for the Wald-Wolfowitz test: H 0 : The two populations have the same distribution H 1 : The two populations have different distributions The test statistic: R = Number of Runs in the sequence of samples, when the data from both samples have been sorted Salesperson A: Salesperson B: Salesperson A: Salesperson B: Using the Runs Test to Compare Two Population Distributions (Means): the Wald-Wolfowitz Test Example 14-3: Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 52 Table Number of Runs (r) (n 1,n 2 )2345. (9,10) Table Number of Runs (r) (n 1,n 2 )2345. (9,10) Sales SalesSalesPerson SalesPerson(Sorted)(Sorted)Runs 35A13 B 44A16 B 39A17 B 48A21 B 60A24 B 1 75A29 A 2 49A32 B 66A33 B 3 17B35 A 23B39 A 13B44 A 24B48 A 33B49 A 21B50 A 18B60 A 16B66 A 32B75 A 4 Sales SalesSalesPerson SalesPerson(Sorted)(Sorted)Runs 35A13 B 44A16 B 39A17 B 48A21 B 60A24 B 1 75A29 A 2 49A32 B 66A33 B 3 17B35 A 23B39 A 13B44 A 24B48 A 33B49 A 21B50 A 18B60 A 16B66 A 32B75 A 4 n 1 = 10 n 2 = 9 R= 4 p-value  P  R  H 0 may be rejected n 1 = 10 n 2 = 9 R= 4 p-value  P  R  H 0 may be rejected The Wald-Wolfowitz Test: Example 14-3 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 53 Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks Kruskal-Wallis Test Friedman Test: Repeated measures Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks Kruskal-Wallis Test Friedman Test: Repeated measures Ranks Tests Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 54 The null and alternative hypotheses: H 0 : The distributions of two populations are identical H 1 : The two population distributions are not identical The Mann-Whitney U statistic: where n 1 is the sample size from population 1 and n 2 is the sample size from population 2. The null and alternative hypotheses: H 0 : The distributions of two populations are identical H 1 : The two population distributions are not identical The Mann-Whitney U statistic: where n 1 is the sample size from population 1 and n 2 is the sample size from population The Mann-Whitney U Test (Comparing Two Populations) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 55 Cumulative Distribution Function of the Mann-Whitney U Statistic n 2 =6 n 1 =6 u Rank ModelTimeRankSum A35 5 A38 8 A4010 A4212 A4111 A B29 2 B27 1 B30 3 B33 4 B39 9 B Rank ModelTimeRankSum A35 5 A38 8 A4010 A4212 A4111 A B29 2 B27 1 B30 3 B33 4 B39 9 B  The Mann-Whitney U Test: Example 14-4 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 56 Example 14-5: Large-Sample Mann-Whitney U Test Score Rank Score Program Rank Sum Score Rank Score Program Rank Sum Score Rank Score Program Rank Sum Score Rank Score Program Rank Sum Since the test statistic is z = -3.32, the p-value  , and H 0 is rejected. Since the test statistic is z = -3.32, the p-value  , and H 0 is rejected. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 57 Example 14-5: Large-Sample Mann-Whitney U Test – Using the Template Since the test statistic is z = , the p-value  , and H 0 is rejected. That is, the LC (Learning Curve) program is more effective. Since the test statistic is z = , the p-value  , and H 0 is rejected. That is, the LC (Learning Curve) program is more effective. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 58 The null and alternative hypotheses: H 0 : The median difference between populations are 1 and 2 is zero H 1 : The median difference between populations are 1 and 2 is not zero Find the difference between the ranks for each pair, D = x 1 -x 2, and then rank the absolute values of the differences. The Wilcoxon T statistic is the smaller of the sums of the positive ranks and the sum of the negative ranks: For small samples, a left-tailed test is used, using the values in Appendix C, Table 10. The large-sample test statistic: The null and alternative hypotheses: H 0 : The median difference between populations are 1 and 2 is zero H 1 : The median difference between populations are 1 and 2 is not zero Find the difference between the ranks for each pair, D = x 1 -x 2, and then rank the absolute values of the differences. The Wilcoxon T statistic is the smaller of the sums of the positive ranks and the sum of the negative ranks: For small samples, a left-tailed test is used, using the values in Appendix C, Table 10. The large-sample test statistic: 14-5 The Wilcoxon Signed- Ranks Test (Paired Ranks) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 59 Sold Sold Rank Rank Rank (1) (2) D=x 1 -x 2 ABS(D) ABS(D)(D>0) (D<0) **** Sum:8634 Sold Sold Rank Rank Rank (1) (2) D=x 1 -x 2 ABS(D) ABS(D)(D>0) (D<0) **** Sum:8634 T=34 n=15 P= P= P= P= H 0 is not rejected (Note the arithmetic error in the text for store 13) T=34 n=15 P= P= P= P= H 0 is not rejected (Note the arithmetic error in the text for store 13) Example 14-6 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 60 Hourly Rank Rank Rank Messages Md 0 D=x 1 -x 2 ABS(D) ABS(D) (D>0) (D<0) Sum: Hourly Rank Rank Rank Messages Md 0 D=x 1 -x 2 ABS(D) ABS(D) (D>0) (D<0) Sum: Example 14-7 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 61 Example 14-7 using the Template Note 1: Note 1: You should enter the claimed value of the mean (median) in every used row of the second column of data. In this case it is 149. Note 2: Note 2: In order for the large sample approximations to be computed you will need to change n > 25 to n >= 25 in cells M13 and M14. Note 1: Note 1: You should enter the claimed value of the mean (median) in every used row of the second column of data. In this case it is 149. Note 2: Note 2: In order for the large sample approximations to be computed you will need to change n > 25 to n >= 25 in cells M13 and M14. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 62 The Kruskal-Wallis hypothesis test: H 0 : All k populations have the same distribution H 1 : Not all k populations have the same distribution The Kruskal-Wallis test statistic: If each n j > 5, then H is approximately distributed as a  2. The Kruskal-Wallis hypothesis test: H 0 : All k populations have the same distribution H 1 : Not all k populations have the same distribution The Kruskal-Wallis test statistic: If each n j > 5, then H is approximately distributed as a  The Kruskal-Wallis Test - A Nonparametric Alternative to One-Way ANOVA Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 63 SoftwareTimeRank Group RankSum SoftwareTimeRank Group RankSum  2 (2,0.005) = , so H 0 is rejected. Example 14-8: The Kruskal- Wallis Test Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 64 Example 14-8: The Kruskal-Wallis Test – Using the Template Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 65 If the null hypothesis in the Kruskal-Wallis test is rejected, then we may wish, in addition, compare each pair of populations to determine which are different and which are the same. Further Analysis (Pairwise Comparisons of Average Ranks) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 66 Pairwise Comparisons: Example 14-8 Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 67 The Friedman test is a nonparametric version of the randomized block design ANOVA. Sometimes this design is referred to as a two-way ANOVA with one item per cell because it is possible to view the blocks as one factor and the treatment levels as the other factor. The test is based on ranks The Friedman Test for a Randomized Block Design The Friedman hypothesis test: H 0 : The distributions of the k treatment populations are identical H 1 : Not all k distribution are identical The Friedman test statistic: The degrees of freedom for the chi-square distribution is (k – 1). The Friedman hypothesis test: H 0 : The distributions of the k treatment populations are identical H 1 : Not all k distribution are identical The Friedman test statistic: The degrees of freedom for the chi-square distribution is (k – 1). Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 68 Example – using the Template Note: Note: The p- value is small relative to a significance level of  = 0.05, so one should conclude that there is evidence that not all three low-budget cruise lines are equally preferred by the frequent cruiser population Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 69 The Spearman Rank Correlation Coefficient is the simple correlation coefficient calculated from variables converted to ranks from their original values The Spearman Rank Correlation Coefficient Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 70 Table 11:  =0.005 n Table 11:  =0.005 n                            rejected  MMIS&P100R-MMIR-S&PDiffDiffsq Sum:4 MMIS&P100R-MMIR-S&PDiffDiffsq Sum:4 Spearman Rank Correlation Coefficient: Example Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 71 Spearman Rank Correlation Coefficient: Example Using the Template Note:The p- values in the range J15:J17 will appear only if the sample size is large (n > 30) Note: The p- values in the range J15:J17 will appear only if the sample size is large (n > 30) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 72 l Steps in a chi-square analysis: Formulate null and alternative hypotheses Compute frequencies of occurrence that would be expected if the null hypothesis were true - expected cell counts Note actual, observed cell counts Use differences between expected and actual cell counts to find chi-square statistic: Compare chi-statistic with critical values from the chi- square distribution (with k-1 degrees of freedom) to test the null hypothesis l Steps in a chi-square analysis: Formulate null and alternative hypotheses Compute frequencies of occurrence that would be expected if the null hypothesis were true - expected cell counts Note actual, observed cell counts Use differences between expected and actual cell counts to find chi-square statistic: Compare chi-statistic with critical values from the chi- square distribution (with k-1 degrees of freedom) to test the null hypothesis 14-9 A Chi-Square Test for Goodness of Fit Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 73 The null and alternative hypotheses: H 0 : The probabilities of occurrence of events E 1, E 2...,E k are given by p 1,p 2,...,p k H 1 : The probabilities of the k events are not as specified in the null hypothesis The null and alternative hypotheses: H 0 : The probabilities of occurrence of events E 1, E 2...,E k are given by p 1,p 2,...,p k H 1 : The probabilities of the k events are not as specified in the null hypothesis Assuming equal probabilities, p 1 = p 2 = p 3 = p 4 =0.25 and n=80 PreferenceTanBrownMaroonBlackTotal Observed Expected(np) (O-E) Assuming equal probabilities, p 1 = p 2 = p 3 = p 4 =0.25 and n=80 PreferenceTanBrownMaroonBlackTotal Observed Expected(np) (O-E) Example 14-12: Goodness-of-Fit Test for the Multinomial Distribution Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 74 Example 14-12: Goodness-of-Fit Test for the Multinomial Distribution using the Template Note: the p- value is , so we can reject the null hypothesis at any a level. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide z f ( z ) Partitioning the Standard Normal Distribution Use the table of the standard normal distribution to determine an appropriate partition of the standard normal distribution which gives ranges with approximately equal percentages. p(z<-1) = p(-1<z<-0.44)= p(-0.44<z<0)= p(0<z<0.44)= p(0.44<z<14)= p(z>1) = Use the table of the standard normal distribution to determine an appropriate partition of the standard normal distribution which gives ranges with approximately equal percentages. p(z<-1) = p(-1<z<-0.44)= p(-0.44<z<0)= p(0<z<0.44)= p(0.44<z<14)= p(z>1) = Given z boundaries, x boundaries can be determined from the inverse standard normal transformation: x =  +  z = z. 3. Compare with the critical value of the  2 distribution with k-3 degrees of freedom. 2. Given z boundaries, x boundaries can be determined from the inverse standard normal transformation: x =  +  z = z. 3. Compare with the critical value of the  2 distribution with k-3 degrees of freedom. Goodness-of-Fit for the Normal Distribution: Example Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 76 iO i E i O i - E i (O i - E i ) 2 (O i - E i ) 2 / E i  2 : iO i E i O i - E i (O i - E i ) 2 (O i - E i ) 2 / E i  2 :  2 (0.10,k-3) = >  H 0 is not rejected at the 0.10 level Example 14-13: Solution Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 77 Example 14-13: Solution using the Template Note: p-value = > 0.01  H 0 is not rejected at the 0.10 level Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide Contingency Table Analysis: A Chi-Square Test for Independence Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 79 Null and alternative hypotheses: H 0 : The two classification variables are independent of each other H 1 : The two classification variables are not independent Chi-square test statistic for independence: Degrees of freedom: df=(r-1)(c-1) Expected cell count: Null and alternative hypotheses: H 0 : The two classification variables are independent of each other H 1 : The two classification variables are not independent Chi-square test statistic for independence: Degrees of freedom: df=(r-1)(c-1) Expected cell count: A and B are independent if:P(AUB) = P(A)P(B). If the first and second classification categories are independent:E ij = (R i )(C j )/n A and B are independent if:P(AUB) = P(A)P(B). If the first and second classification categories are independent:E ij = (R i )(C j )/n Contingency Table Analysis: A Chi-Square Test for Independence Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 80 ijOEO-E(O-E) 2 (O-E) 2 /E  2 : ijOEO-E(O-E) 2 (O-E) 2 /E  2 :  2 (0.01,(2-1)(2- 1)) = H 0 is rejected at the 0.01 level and it is concluded that the two variables are not independent.  2 (0.01,(2-1)(2- 1)) = H 0 is rejected at the 0.01 level and it is concluded that the two variables are not independent. Contingency Table Analysis: Example Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 81 Since p-value = 0.000, H 0 is rejected at the 0.01 level and it is concluded that the two variables are not independent. Contingency Table Analysis: Example using the Template Note: When the contingenc y table is a 2x2, one should use the Yates correction. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide Chi-Square Test for Equality of Proportions tests of homogeneity. Tests of equality of proportions across several populations are also called tests of homogeneity. In general, when we compare c populations (or r populations if they are arranged as rows rather than columns in the table), then the Null and alternative hypotheses: H 0 : p 1 = p 2 = p 3 = … = p c H 1 : Not all p i, I = 1, 2, …, c, are equal Chi-square test statistic for equal proportions: Degrees of freedom: df = (r-1)(c-1) Expected cell count: In general, when we compare c populations (or r populations if they are arranged as rows rather than columns in the table), then the Null and alternative hypotheses: H 0 : p 1 = p 2 = p 3 = … = p c H 1 : Not all p i, I = 1, 2, …, c, are equal Chi-square test statistic for equal proportions: Degrees of freedom: df = (r-1)(c-1) Expected cell count: Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide Chi-Square Test for Equality of Proportions - Extension The Median Test Here, the Null and alternative hypotheses are: H 0 : The c populations have the same median H 1 : Not all c populations have the same median Here, the Null and alternative hypotheses are: H 0 : The c populations have the same median H 1 : Not all c populations have the same median Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 84 Chi-Square Test for the Median: Example Using the Template Note:The template was used to help compute the test statistic and the p-value for the median test. First you must manually compute the number of values that are above the grand median and the number that is less than or equal to the grand median. Use these values in the template. See Table in the text. Note: The template was used to help compute the test statistic and the p-value for the median test. First you must manually compute the number of values that are above the grand median and the number that is less than or equal to the grand median. Use these values in the template. See Table in the text. Since the p-value = is very large there is no evidence to reject the null hypothesis. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 85 Table 11:  =0.005 n Table 11:  =0.005 n                            rejected  MMIS&P100R-MMIR-S&PDiffDiffsq Sum:4 MMIS&P100R-MMIR-S&PDiffDiffsq Sum:4 Spearman Rank Correlation Coefficient: Example Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 86 Spearman Rank Correlation Coefficient: Example Using the Template Note:The p- values in the range J15:J17 will appear only if the sample size is large (n > 30) Note: The p- values in the range J15:J17 will appear only if the sample size is large (n > 30) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 87 l Steps in a chi-square analysis: Formulate null and alternative hypotheses Compute frequencies of occurrence that would be expected if the null hypothesis were true - expected cell counts Note actual, observed cell counts Use differences between expected and actual cell counts to find chi-square statistic: Compare chi-statistic with critical values from the chi- square distribution (with k-1 degrees of freedom) to test the null hypothesis l Steps in a chi-square analysis: Formulate null and alternative hypotheses Compute frequencies of occurrence that would be expected if the null hypothesis were true - expected cell counts Note actual, observed cell counts Use differences between expected and actual cell counts to find chi-square statistic: Compare chi-statistic with critical values from the chi- square distribution (with k-1 degrees of freedom) to test the null hypothesis 14-9 A Chi-Square Test for Goodness of Fit Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 88 The null and alternative hypotheses: H 0 : The probabilities of occurrence of events E 1, E 2...,E k are given by p 1,p 2,...,p k H 1 : The probabilities of the k events are not as specified in the null hypothesis The null and alternative hypotheses: H 0 : The probabilities of occurrence of events E 1, E 2...,E k are given by p 1,p 2,...,p k H 1 : The probabilities of the k events are not as specified in the null hypothesis Assuming equal probabilities, p 1 = p 2 = p 3 = p 4 =0.25 and n=80 PreferenceTanBrownMaroonBlackTotal Observed Expected(np) (O-E) Assuming equal probabilities, p 1 = p 2 = p 3 = p 4 =0.25 and n=80 PreferenceTanBrownMaroonBlackTotal Observed Expected(np) (O-E) Example 14-12: Goodness-of-Fit Test for the Multinomial Distribution Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 89 Example 14-12: Goodness-of-Fit Test for the Multinomial Distribution using the Template Note: the p- value is , so we can reject the null hypothesis at any  level. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide z f ( z ) Partitioning the Standard Normal Distribution Use the table of the standard normal distribution to determine an appropriate partition of the standard normal distribution which gives ranges with approximately equal percentages. p(z<-1) = p(-1<z<-0.44)= p(-0.44<z<0)= p(0<z<0.44)= p(0.44<z<14)= p(z>1) = Use the table of the standard normal distribution to determine an appropriate partition of the standard normal distribution which gives ranges with approximately equal percentages. p(z<-1) = p(-1<z<-0.44)= p(-0.44<z<0)= p(0<z<0.44)= p(0.44<z<14)= p(z>1) = Given z boundaries, x boundaries can be determined from the inverse standard normal transformation: x =  +  z = z. 3. Compare with the critical value of the  2 distribution with k-3 degrees of freedom. 2. Given z boundaries, x boundaries can be determined from the inverse standard normal transformation: x =  +  z = z. 3. Compare with the critical value of the  2 distribution with k-3 degrees of freedom. Goodness-of-Fit for the Normal Distribution: Example Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 91 iO i E i O i - E i (O i - E i ) 2 (O i - E i ) 2 / E i  2 : iO i E i O i - E i (O i - E i ) 2 (O i - E i ) 2 / E i  2 :  2 (0.10,k-3) = >  H 0 is not rejected at the 0.10 level Example 14-13: Solution Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 92 Example 14-13: Solution using the Template Note: p-value = > 0.01  H 0 is not rejected at the 0.10 level Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide Contingency Table Analysis: A Chi-Square Test for Independence Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 94 Null and alternative hypotheses: H 0 : The two classification variables are independent of each other H 1 : The two classification variables are not independent Chi-square test statistic for independence: Degrees of freedom: df=(r-1)(c-1) Expected cell count: Null and alternative hypotheses: H 0 : The two classification variables are independent of each other H 1 : The two classification variables are not independent Chi-square test statistic for independence: Degrees of freedom: df=(r-1)(c-1) Expected cell count: A and B are independent if:P(AUB) = P(A)P(B). If the first and second classification categories are independent:E ij = (R i )(C j )/n A and B are independent if:P(AUB) = P(A)P(B). If the first and second classification categories are independent:E ij = (R i )(C j )/n Contingency Table Analysis: A Chi-Square Test for Independence Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 95 ijOEO-E(O-E) 2 (O-E) 2 /E  2 : ijOEO-E(O-E) 2 (O-E) 2 /E  2 :  2 (0.01,(2-1)(2- 1)) = H 0 is rejected at the 0.01 level and it is concluded that the two variables are not independent.  2 (0.01,(2-1)(2- 1)) = H 0 is rejected at the 0.01 level and it is concluded that the two variables are not independent. Contingency Table Analysis: Example Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 96 Since p-value = 0.000, H 0 is rejected at the 0.01 level and it is concluded that the two variables are not independent. Contingency Table Analysis: Example using the Template Note: When the contingenc y table is a 2x2, one should use the Yates correction. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide Chi-Square Test for Equality of Proportions tests of homogeneity. Tests of equality of proportions across several populations are also called tests of homogeneity. In general, when we compare c populations (or r populations if they are arranged as rows rather than columns in the table), then the Null and alternative hypotheses: H 0 : p 1 = p 2 = p 3 = … = p c H 1 : Not all p i, I = 1, 2, …, c, are equal Chi-square test statistic for equal proportions: Degrees of freedom: df = (r-1)(c-1) Expected cell count: In general, when we compare c populations (or r populations if they are arranged as rows rather than columns in the table), then the Null and alternative hypotheses: H 0 : p 1 = p 2 = p 3 = … = p c H 1 : Not all p i, I = 1, 2, …, c, are equal Chi-square test statistic for equal proportions: Degrees of freedom: df = (r-1)(c-1) Expected cell count: Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide Chi-Square Test for Equality of Proportions - Extension The Median Test Here, the Null and alternative hypotheses are: H 0 : The c populations have the same median H 1 : Not all c populations have the same median Here, the Null and alternative hypotheses are: H 0 : The c populations have the same median H 1 : Not all c populations have the same median Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 99 Chi-Square Test for the Median: Example Using the Template Note:The template was used to help compute the test statistic and the p-value for the median test. First you must manually compute the number of values that are above the grand median and the number that is less than or equal to the grand median. Use these values in the template. See Table in the text. Note: The template was used to help compute the test statistic and the p-value for the median test. First you must manually compute the number of values that are above the grand median and the number that is less than or equal to the grand median. Use these values in the template. See Table in the text. Since the p-value = is very large there is no evidence to reject the null hypothesis. Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer

Slide 100 M.Phil (Statistics) GC University,. (Degree awarded by GC University) M.Sc (Statistics) GC University,. (Degree awarded by GC University) Statitical Officer (BS-17) (Economics & Marketing Division) Livestock Production Research Institute Bahadurnagar (Okara), Livestock & Dairy Development Department, Govt. of Punjab Name Shakeel Nouman Religion Christian Domicile Punjab (Lahore) Contact # E.Mail Name Shakeel Nouman Religion Christian Domicile Punjab (Lahore) Contact # E.Mail Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer