Chapte The McGraw-Hill Companies, Inc. All rights reserved.

Similar documents
Chapter 10. Chapter 10. Multinomial Experiments and. Multinomial Experiments and Contingency Tables. Contingency Tables.

CHAPTER 17 CHI-SQUARE AND OTHER NONPARAMETRIC TESTS FROM: PAGANO, R. R. (2007)

11-2 Multinomial Experiment

Recall the Basics of Hypothesis Testing

The goodness-of-fit test Having discussed how to make comparisons between two proportions, we now consider comparisons of multiple proportions.

Dr. Maddah ENMG 617 EM Statistics 10/15/12. Nonparametric Statistics (2) (Goodness of fit tests)

Chapte The McGraw-Hill Companies, Inc. All rights reserved.

Chap The McGraw-Hill Companies, Inc. All rights reserved.

Hypothesis testing:power, test statistic CMS:

Statistical Analysis for QBIC Genetics Adapted by Ellen G. Dow 2017

H 2 : otherwise. that is simply the proportion of the sample points below level x. For any fixed point x the law of large numbers gives that

Asymptotic Statistics-VI. Changliang Zou

CPSC 531: Random Numbers. Jonathan Hudson Department of Computer Science University of Calgary

Chi-Squared Tests. Semester 1. Chi-Squared Tests

Glossary. The ISI glossary of statistical terms provides definitions in a number of different languages:

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

HYPOTHESIS TESTING: THE CHI-SQUARE STATISTIC

B.N.Bandodkar College of Science, Thane. Random-Number Generation. Mrs M.J.Gholba

10: Crosstabs & Independent Proportions

Parametric versus Nonparametric Statistics-when to use them and which is more powerful? Dr Mahmoud Alhussami

12.10 (STUDENT CD-ROM TOPIC) CHI-SQUARE GOODNESS- OF-FIT TESTS

Random Number Generation. CS1538: Introduction to simulations

" M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2

Stochastic Simulation

Practical Statistics for the Analytical Scientist Table of Contents

Contents Kruskal-Wallis Test Friedman s Two-way Analysis of Variance by Ranks... 47

Joseph O. Marker Marker Actuarial a Services, LLC and University of Michigan CLRS 2010 Meeting. J. Marker, LSMWP, CLRS 1

HYPOTHESIS TESTING. Hypothesis Testing

One-Sample Numerical Data

Confidence Intervals, Testing and ANOVA Summary

Distribution Fitting (Censored Data)

The Chi-Square Distributions

Statistics Handbook. All statistical tables were computed by the author.

Agonistic Display in Betta splendens: Data Analysis I. Betta splendens Research: Parametric or Non-parametric Data?

Example. χ 2 = Continued on the next page. All cells

Solutions exercises of Chapter 7

The entire data set consists of n = 32 widgets, 8 of which were made from each of q = 4 different materials.

Chi Square Analysis M&M Statistics. Name Period Date

Tables Table A Table B Table C Table D Table E 675

Ling 289 Contingency Table Statistics

Modeling and Performance Analysis with Discrete-Event Simulation

Discrete Multivariate Statistics

Data Analysis: Agonistic Display in Betta splendens I. Betta splendens Research: Parametric or Non-parametric Data?

ME3620. Theory of Engineering Experimentation. Spring Chapter IV. Decision Making for a Single Sample. Chapter IV

Dover- Sherborn High School Mathematics Curriculum Probability and Statistics

Testing for Poisson Behavior

Summary of Chapter 7 (Sections ) and Chapter 8 (Section 8.1)

Frequency Distribution Cross-Tabulation

:the actual population proportion are equal to the hypothesized sample proportions 2. H a

Testing for Normality

3. (a) (8 points) There is more than one way to correctly express the null hypothesis in matrix form. One way to state the null hypothesis is

ANALYSIS OF VARIANCE OF BALANCED DAIRY SCIENCE DATA USING SAS

Declarative Statistics

Contingency Tables. Safety equipment in use Fatal Non-fatal Total. None 1, , ,128 Seat belt , ,878

Institute of Actuaries of India

9 One-Way Analysis of Variance

MODEL FOR DISTRIBUTION OF WAGES

POLI 443 Applied Political Research

Robustness and Distribution Assumptions

Inference for Categorical Data. Chi-Square Tests for Goodness of Fit and Independence

Finding Outliers in Monte Carlo Computations

Chapter 23: Inferences About Means

Statistical Inference: Estimation and Confidence Intervals Hypothesis Testing

The Chi-Square Distributions

Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance ECON 509. Dr.

Introduction to Statistical Data Analysis Lecture 7: The Chi-Square Distribution

One-Way Tables and Goodness of Fit

Quantitative Introduction ro Risk and Uncertainty in Business Module 5: Hypothesis Testing

Inferential statistics

16.400/453J Human Factors Engineering. Design of Experiments II

STAT 536: Genetic Statistics

Design & Analysis of Experiments 7E 2009 Montgomery

Systems Simulation Chapter 7: Random-Number Generation

Chapter 9. Non-Parametric Density Function Estimation

Dr. Maddah ENMG 617 EM Statistics 10/12/12. Nonparametric Statistics (Chapter 16, Hines)

Testing for Normality

Computer Science, Informatik 4 Communication and Distributed Systems. Simulation. Discrete-Event System Simulation. Dr.

Relate Attributes and Counts

Nominal Data. Parametric Statistics. Nonparametric Statistics. Parametric vs Nonparametric Tests. Greg C Elvers

Probability Methods in Civil Engineering Prof. Dr. Rajib Maity Department of Civil Engineering Indian Institution of Technology, Kharagpur

Glossary for the Triola Statistics Series

Discrete distribution. Fitting probability models to frequency data. Hypotheses for! 2 test. ! 2 Goodness-of-fit test

IV. The Normal Distribution

There are statistical tests that compare prediction of a model with reality and measures how significant the difference.

Hypothesis Tests and Estimation for Population Variances. Copyright 2014 Pearson Education, Inc.

Review of Statistics 101

Fall 2012 Analysis of Experimental Measurements B. Eisenstein/rev. S. Errede

Are Declustered Earthquake Catalogs Poisson?

1 One-way Analysis of Variance

* Tuesday 17 January :30-16:30 (2 hours) Recored on ESSE3 General introduction to the course.

Harvard University. Rigorous Research in Engineering Education

IE 303 Discrete-Event Simulation L E C T U R E 6 : R A N D O M N U M B E R G E N E R A T I O N

Topic 21 Goodness of Fit

Basic Business Statistics, 10/e

Model Estimation Example

Testing and Model Selection

Sociology 6Z03 Review II

Statistical distributions: Synopsis

The Components of a Statistical Hypothesis Testing Problem

14.30 Introduction to Statistical Methods in Economics Spring 2009

Transcription:

er15 Chapte Chi-Square Tests d Chi-Square Tests for -Fit Uniform Goodness- Poisson Goodness- Goodness- ECDF Tests (Optional) Contingency Tables A contingency table is a cross-tabulation of n paired observations into categories. Each cell shows the count of observations that fall into the category defined by its row (r) and column (c) heading. Contingency Tables For example:

Chi-Square Test In a test of independence for an r x c contingency table, the hypotheses are H 0 : Variable A is independent of variable B H 1 : Variable A is not independent of variable B Use the chi-square test for independence to test these hypotheses. This non-parametric test is based on frequencies. The n data pairs are classified into c columns and r rows and then the observed frequency f jk is compared with the expected frequency e jk. Chi-Square Distribution The critical value comes from the chi-square probability distribution with ν degrees of freedom. ν = degrees of freedom = (r 1)(c 1) where r = number of rows in the table c = number of columns in the table Appendix E contains critical values for right-tail tail areas of the chi-square distribution. The mean of a chi-square distribution is ν with variance 2ν. Chi-Square Distribution Consider the shape of the chi-square distribution: Expected Frequencies Assuming that H 0 is true, the expected frequency of row j and column k is: e jk = R j C k /n where R j = total for row j (j = 1, 2,, r) C k = total for column k (k = 1, 2,, c) n = sample size

Expected Frequencies The table of expected frequencies is: The e jk always sum to the same row and column frequencies as the observed frequencies. Steps in Testing the Hypotheses Step 1: State the Hypotheses H 0 : Variable A is independent of variable B H 1 : Variable A is not independent of variable B Step 2: State the Decision Rule Calculate ν = (r 1)( )(c 1) For a given α,, look up the right-tail tail critical value (χ 2 R) from Appendix E or by using Excel. Reject H 0 if χ 2 R > test statistic. Steps in Testing the Hypotheses For example, for ν = 6 and α =.05 05, χ 2.05 = 12.59. Steps in Testing the Hypotheses Here is the rejection region.

Steps in Testing the Hypotheses Step 3: Calculate the Expected Frequencies e jk = R jc k/n For example, Steps in Testing the Hypotheses Step 4: Calculate the Test Statistic The chi-square test statistic is Step 5: Make the Decision Reject H 0 if χ 2 R > test statistic or if the p-value < α. Small Expected Frequencies The chi-square test is unreliable if the expected frequencies are too small. Rules of thumb: Cochran s Rule requires that e jk > 5 for all cells. Up to 20% of the cells may have e jk < 5 Most agree that a chi-square test is infeasible if e jk < 1 in any cell. If this happens, try combining adjacent rows or columns to enlarge the expected frequencies. Small Expected Frequencies For example, here are some test t results from MegaStat

Test of Two Proportions For a 2 x 2 contingency table, the chi-square test is equivalent to a two-tailed tailed z test for two proportions, if the samples are large enough to ensure normality. The hypotheses are: H 0 : π 1 = π 2 H 1 : π 1 π 2 The z test statistic is: Cross-Tabulating Raw Data Chi-square tests for independence can also be used to analyze quantitative variables by coding them into categories. For example, the variables Infant Deaths per 1,000 and Doctors per 100,000 000 can each be coded into various categories: 3-Way Tables and Higher More than two variables can be compared using contingency tables. However, it is difficult to visualize a higher order table. For example, you could visualize a cube as a stack of tiled 2-way contingency tables. Major computer packages permit 3-way tables. Chi-Square Test for of-fit Purpose of the Test The goodness-of-fitfit (GOF)) test helps you decide whether your sample resembles a particular kind of population. The chi-square test will be used because it is versatile and easy to understand.

Chi-Square Test for of-fit Hypotheses for GOF The hypotheses are: H 0 : The population follows a distribution H 1 : The population does not follow a distribution The blank may contain the name of any theoretical distribution (e.g., uniform, Poisson, normal). Chi-Square Test for of-fit Test Statistic and Degrees of Freedom for GOF Assuming n observations, the observations are grouped into c classes and then the chi-square test statistic is found using: where f j = the observed frequency of observations in class j e j = the expected frequency in class j if H 0 were true Chi-Square Test for of-fit Test Statistic and Degrees of Freedom for GOF If the proposed distribution gives a good fit to the sample, the test statistic will be near zero. The test statistic follows the chi-square distribution with degrees of freedom ν = c m 1 where c is the no. of classes used in the test m is the no. of parameters estimated Chi-Square Test for of-fit Test Statistic and Degrees of Freedom for GOF

Chi-Square Test for of-fit Data-Generating Situations Instead of fishing for a good-fitting model, visualize apriorithe characteristics of the underlying data-generating process. Mixtures: t A Problem Mixtures occur when more than one data- generating process is superimposed on top of one another. Chi-Square Test for of-fit Eyeball Tests A simple eyeball inspection of the histogram or dot plot may suffice to rule out a hypothesized population. Small Expected Frequencies -fit fit tests may lack power in small samples. As a guideline, a chi-square goodness- of-fit fit test should be avoided if n < 25. Uniform Uniform Multinomial Distribution A multinomial distribution is defined by any k probabilities π 1 1, π 2 2,, π k that sum to unity. For example, consider the following official proportions of M&M colors. Multinomial Distribution The hypotheses are H 0 : π 1 =.30 30, π 2 =.20 20, π 3 =.10 10, π 4 =.10 10, π 5 =.10 10, π 6 =.20 H 1 : At least one of the π j differs from the hypothesized value No parameters are estimated (m = 0) and there are c = 6 classes, so the degrees of freedom are ν = c m 1 = 6 0-1

Uniform Uniform Distribution The uniform goodness-of-fitfit test is a special case of the multinomial in which every value has the same chance of occurrence. The chi-square test for a uniform distribution compares all c groups simultaneously. The hypotheses are: H 0 : π 1 = π 2 =, π c = 1/c H 1 : Not all π j are equal Uniform Uniform GOF Test: Grouped Data The test can be performed on data that are already tabulated into groups. Calculate the expected frequency e ij for each cell. The degrees ees of freedom are ν = c 1 since there e are no parameters for the uniform distribution. Obtain the critical value χ 2 α from Appendix E for the desired level of significance α. The p-value can be obtained from Excel. Reject H 0 if p-value < α. Uniform Uniform Uniform GOF Test: Raw Data First form c bins of equal width and create a frequency distribution. Calculate the observed frequency f j for each bin. Define e e j = n/c. Perform the chi-square calculations. The degrees of freedom are ν = c 1 since there are no parameters for the uniform distribution. Obtain the critical value from Appendix E for a given significance level α and make the decision. Uniform GOF Test: Raw Data Maximize the test s power by defining bin width as As a result, the expected frequencies will be as large as possible.

Uniform Uniform GOF Test: Raw Data Calculate the mean and standard deviation of the uniform distribution as: μ = (a + b)/2 σ = [(b a + 1)2 1)/ )/12 If the data a are not skewed ed and the sample size is large (n > 30), then the mean is approximately normally distributed. So, test the hypothesized uniform mean using Poisson Poisson Data-Generating Situations In a Poisson distribution model, X represents the number of events per unit of time or space. X is a discrete nonnegative integer (X = 0, 1, 2, ) Event arrivals must be independent of each other. Sometimes called a model of rare events because X typically has a small mean. Poisson Poisson Poisson Goodness- The mean λ is the only parameter. Assuming that λ is unknown and must be estimated from the sample, the steps are: Step 1: Tally the observed frequency f j of each X-value. Step 2: Estimate the mean λ from the sample. Step 3: Use the estimated λ to find the Poisson probability P(X) ) for each value of X. Poisson Goodness- Step 4: Multiply P(X) ) by the sample size n to get expected Poisson frequencies e j. Step 5: Perform the chi-square calculations. Step Sep6: Make the edecso decision. You may need to combine classes until expected frequencies become large enough for the test (at least until e j > 2).

Poisson Poisson GOF Test: Tabulated Data Calculate the sample mean as: ^λ = c Σ x j f j j =1 n Using this estimate mean, calculate the Poisson probabilities either by using the Poisson formula P(x) ) = (λ x e - λ )/x! or Excel. Poisson Poisson GOF Test: Tabulated Data For c classes with m = 1 parameter estimated, the degrees of freedom are ν = c m 1 Obtain the critical value for a given α from Appendix E. Make the decision. Normal Data Generating Situations Two parameters, μ and σ,, fully describe the normal distribution. Unless μ and σ are know a priori,, they must be estimated from a sample by using x and s. Using these statistics, the chi-square goodness- of-fit fit test can be used. Method 1: Standardizing the Data Transform the sample observations x 1, x 2,, x n into standardized values. Count the sample observations f j within intervals of the form x + ks and compare them with the known frequencies e j based on the normal distribution.

Method 1: Standardizing the Data Advantage is a standardized di d scale. Disadvantage is that data are no longer in the original units. Method 2: Equal Bin Widths To obtain equal-width bins, divide the exact data range into c groups of equal width. Step 1: Count the sample observations in each bin to get observed frequencies f j. Step 2: Convert the bin limits into standardized z-values by using the formula. Method 2: Equal Bin Widths Step 3: Find the normal area within each bin assuming a normal distribution. Step 4: Find expected frequencies e j by multiplying each normal area by the sample size n. Classes may need to be collapsed from the ends inward to enlarge expected frequencies. Method 3: Equal Expected Frequencies Define histogram bins in such a way that an equal number of observations would be expected within each bin under the null hypothesis. Define bin limits so that e j = n/c A normal area of 1/c in each of the c bins is desired. The first and last classes must be open-ended ended for a normal distribution, so to define c bins, we need c 1 cutpoints.

Method 3: Equal Expected Frequencies The upper limit of bin j can be found directly by using Excel. Alternatively, find z j for bin j using Excel and then calculate the upper limit for bin j as x + z j s Once the bins are defined, count the observations f j within each bin and compare them with the expected frequencies e j = n/c. Method 3: Equal Expected Frequencies Standard normal cutpoints for equal area bins. Histograms The fitted normal histogram gives visual clues as to the likely outcome of the GOF test. Histograms reveal any outliers or other non- normality issues. Further tests t are needed d since histograms vary. Critical Values for Normal GOF Test Since two parameters, m and s, are estimated from the sample, the degrees of freedom are ν = c m 1 At least 4 bins are needed to ensure 1 df.

ECDF Tests Kolmogorov-Smirnov and Lilliefors Tests There are many alternatives to the chi-square test based on the Empirical Cumulative Distribution Function (ECDF). The Kolmogorov-Smirnov (K-S) test statistic D is the largest absolute difference between the actual and expected cumulative relative frequency of the n data values: D = Max F a F e The K-S test is not recommended for grouped data. ECDF Tests Kolmogorov-Smirnov and Lilliefors Tests F a is the actual cumulative frequency at observation i. F e is the expected cumulative frequency at observation i under the assumption that the data came from the hypothesized distribution. ib ti The K-S test assumes that no parameters are estimated. If parameters are estimated, use a Lilliefors test. Both of these tests are done by computer. ECDF Tests Kolmogorov-Smirnov and Lilliefors Tests ECDF Tests Kolmogorov-Smirnov and Lilliefors Tests K-S test for uniformity. K-S test for normality.

ECDF Tests Anderson-Darling Tests The Anderson-Darling (A-D) test is widely used for non-normality normality because of its power. The A-D test is based on a probability plot. When the data fit the hypothesized distribution closely, l the probability bilit plot will be close to a straight line. The A-D test statistic measures the overall distance between the actual and the hypothesized distributions, using a weighted squared distance. ECDF Tests Anderson-Darling Tests with MINITAB Applied Statistics in Business and Economics End of Chapter 15