M obile C omputing G roup A quick-and-dirty tutorial on the chi2 test for goodness-of-fit testing.

Slides:



Advertisements
Similar presentations
Lecture (11,12) Parameter Estimation of PDF and Fitting a Distribution Function.
Advertisements

CHAPTER 21 Inferential Statistical Analysis. Understanding probability The idea of probability is central to inferential statistics. It means the chance.
Parametric/Nonparametric Tests. Chi-Square Test It is a technique through the use of which it is possible for all researchers to:  test the goodness.
Chap 9: Testing Hypotheses & Assessing Goodness of Fit Section 9.1: INTRODUCTION In section 8.2, we fitted a Poisson dist’n to counts. This chapter will.
S519: Evaluation of Information Systems
© 2010 Pearson Prentice Hall. All rights reserved The Chi-Square Goodness-of-Fit Test.
Making Inferences for Associations Between Categorical Variables: Chi Square Chapter 12 Reading Assignment pp ; 485.
Stat 301 – Day 28 Review. Last Time - Handout (a) Make sure you discuss shape, center, and spread, and cite graphical and numerical evidence, in context.
Evaluating Hypotheses Chapter 9. Descriptive vs. Inferential Statistics n Descriptive l quantitative descriptions of characteristics.
Chapter 7 Sampling and Sampling Distributions
9-1 Hypothesis Testing Statistical Hypotheses Statistical hypothesis testing and confidence interval estimation of parameters are the fundamental.
Chapter 11 Chi-Square Procedures 11.1 Chi-Square Goodness of Fit.
Evaluating Hypotheses Chapter 9 Homework: 1-9. Descriptive vs. Inferential Statistics n Descriptive l quantitative descriptions of characteristics ~
Sampling Distributions
CJ 526 Statistical Analysis in Criminal Justice
Biostatistics Frank H. Osborne, Ph. D. Professor.
Bivariate Statistics GTECH 201 Lecture 17. Overview of Today’s Topic Two-Sample Difference of Means Test Matched Pairs (Dependent Sample) Tests Chi-Square.
Lecture 2: Basic steps in SPSS and some tests of statistical inference
4-1 Statistical Inference The field of statistical inference consists of those methods used to make decisions or draw conclusions about a population.
Ch 15 - Chi-square Nonparametric Methods: Chi-Square Applications
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 14 Goodness-of-Fit Tests and Categorical Data Analysis.
Inferences About Process Quality
Chapter 9 Hypothesis Testing.
PSY 307 – Statistics for the Behavioral Sciences Chapter 19 – Chi-Square Test for Qualitative Data Chapter 21 – Deciding Which Test to Use.
BCOR 1020 Business Statistics
Chapter 14 Inferential Data Analysis
Inferential Statistics
Chapter 9 Title and Outline 1 9 Tests of Hypotheses for a Single Sample 9-1 Hypothesis Testing Statistical Hypotheses Tests of Statistical.
Choosing Statistical Procedures
Chapter Ten Introduction to Hypothesis Testing. Copyright © Houghton Mifflin Company. All rights reserved.Chapter New Statistical Notation The.
The Chi-square Statistic. Goodness of fit 0 This test is used to decide whether there is any difference between the observed (experimental) value and.
Copyright © Cengage Learning. All rights reserved. 11 Applications of Chi-Square.
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Chapter 9 Hypothesis Testing.
Overview of Statistical Hypothesis Testing: The z-Test
Chapter 7 Using sample statistics to Test Hypotheses about population parameters Pages
© 2008 McGraw-Hill Higher Education The Statistical Imagination Chapter 9. Hypothesis Testing I: The Six Steps of Statistical Inference.
EDRS 6208 Analysis and Interpretation of Data Non Parametric Tests
Fundamentals of Data Analysis Lecture 4 Testing of statistical hypotheses.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Statistical Inferences Based on Two Samples Chapter 9.
CJ 526 Statistical Analysis in Criminal Justice
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Inference on Categorical Data 12.
Introduction to Statistical Inference Chapter 11 Announcement: Read chapter 12 to page 299.
14 Elements of Nonparametric Statistics
Chapter 21 Univariate Statistical Analysis © 2010 South-Western/Cengage Learning. All rights reserved. May not be scanned, copied or duplicated, or posted.
Chapter 8 McGrew Elements of Inferential Statistics Dave Muenkel Geog 3000.
Education Research 250:205 Writing Chapter 3. Objectives Subjects Instrumentation Procedures Experimental Design Statistical Analysis  Displaying data.
9-1 Hypothesis Testing Statistical Hypotheses Definition Statistical hypothesis testing and confidence interval estimation of parameters are.
Chi-Square as a Statistical Test Chi-square test: an inferential statistics technique designed to test for significant relationships between two variables.
Chapter 16 The Chi-Square Statistic
Hypothesis Testing A procedure for determining which of two (or more) mutually exclusive statements is more likely true We classify hypothesis tests in.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 8 Hypothesis Testing.
1 Chapter 8 Introduction to Hypothesis Testing. 2 Name of the game… Hypothesis testing Statistical method that uses sample data to evaluate a hypothesis.
Experimental Research Methods in Language Learning Chapter 10 Inferential Statistics.
Chapter Outline Goodness of Fit test Test of Independence.
N318b Winter 2002 Nursing Statistics Specific statistical tests Chi-square (  2 ) Lecture 7.
Logic and Vocabulary of Hypothesis Tests Chapter 13.
Virtual University of Pakistan Lecture No. 44 of the course on Statistics and Probability by Miss Saleha Naghmi Habibullah.
1 URBDP 591 A Lecture 12: Statistical Inference Objectives Sampling Distribution Principles of Hypothesis Testing Statistical Significance.
Chapter 15 The Chi-Square Statistic: Tests for Goodness of Fit and Independence PowerPoint Lecture Slides Essentials of Statistics for the Behavioral.
Statistical Inference Statistical inference is concerned with the use of sample data to make inferences about unknown population parameters. For example,
Copyright © Cengage Learning. All rights reserved. 9 Inferences Based on Two Samples.
Chapter 14 – 1 Chi-Square Chi-Square as a Statistical Test Statistical Independence Hypothesis Testing with Chi-Square The Assumptions Stating the Research.
Chapter 11 Chi-Square Procedures 11.1 Chi-Square Goodness of Fit.
Jump to first page Inferring Sample Findings to the Population and Testing for Differences.
S519: Evaluation of Information Systems Social Statistics Inferential Statistics Chapter 15: Chi-square.
Hypothesis Testing and Statistical Significance
Fundamentals of Data Analysis Lecture 4 Testing of statistical hypotheses pt.1.
Statistical principles: the normal distribution and methods of testing Or, “Explaining the arrangement of things”
Chapter 9: Hypothesis Tests for One Population Mean 9.5 P-Values.
9 Tests of Hypotheses for a Single Sample CHAPTER OUTLINE
Presentation transcript:

M obile C omputing G roup A quick-and-dirty tutorial on the chi2 test for goodness-of-fit testing

Outline Background -concepts Goodness-of-fit (GoF) Chi2 tests for GoF The presentation follows the pyramid schema

Background Descriptive vs. inferential statistics – Descriptive : data used only for descriptive purposes (use tables, graphs, measures of variability etc.) – Inferential : data used for drawing inferences, make predictions etc. Sample vs. population – A sample is drawn from a population, assumed to have some characteristics. – The sample is often used to make inferences about the population (inferential statistics) : Hypothesis testing Estimation of population parameters

Background Statistic vs. parameter – A statistic is related (estimated from) a sample. It can be used for both descriptive and inferential purposes – A parameter refers to the whole population. A sample statistic is often used to infer a population parameter Example : the sample mean may be used to infer the population mean (expected value) Hypothesis testing – A procedure where sample data are used to evaluate a hypothesis regarding the population – A hypothesis may refer to several things : properties of a single population, relation between two populations etc. – Two statistical hypotheses are defined: a null H 0 and an alternative H 1 H 0 is the often a statement of no effect or no difference. It is the hypothesis the researcher seeks to reject

Background Inferential statistical test – Hypothesis testing is carried out via an inferential statistic test : Sample data are manipulated to yield a test statistic The obtained value of the test statistic is evaluated with respect to a sampling distribution, i.e., a theoretical probability distribution for the possible values of the test statistic The theoretical values of the statistic are usually tabulated and let someone assess the statistical significance of the result of his statistical test The goodness-of-fit is a type of hypothesis testing – devise inferential statistical tests, apply them to the sample, infer the matching of a theoretical distribution to the population distribution

GoF as hypothesis testing Hypothesis H 0 : – The sample is derived from a theoretical distribution F() The sample data are manipulated to derive a test statistic – In the case of the chi2 statistic this includes aggregation of data into bins and some computations The statistic, as computed from data, is checked against the sampling distribution – For the chi2 test, the sampling distribution is the chi2 distribution, hence the name

Goodness-of-fit Statistical tests and statistics : the big picture Chi2 type tests EDF-based tests Specialized tests Classical chi2 statistics Generalized chi2 statistics Pearson chi2 statistic Modified chi2 statistic Log-likelihood ratio statistic e.g., KS test, Anderson-Darling test e.g., Shapiro-Wilk test for normality

Pearson chi2 statistic M : number of bins O i (N i ): observed frequency in bin i n : sample size E i (np i ) : expected frequency in bin i according to the theoretical distribution F() If X 1, X 2, X 3 …X n, the random sample and F() the theoretical distribution under test, the Pearson chi2 statistic is computed as:

Interpretation of chi2 statistic Theory says that the Pearson chi2 statistic follows a chi2 distribution, whose df are – M-1, when the parameters of the fitted distribution are given a priori (case 0 test) – Somewhere between M-1 and M-1-q, when the q parameters of the distribution are estimated by the sample data – Usually, the df for this case are taken to be M-1-q Having estimated the value of the chi2 statistic X 2, I check the chi2 distribution with M-1 (M-1-q) df to find – What is the probability to get a value equal to or greater than the computed value X 2, called p-value – If p > a, where a is the significance level of my test, the hypothesis is rejected, otherwise it is retained – Standard values for a are 0.1, 0.05, 0.01 – the higher a is the more conservative I am in rejecting the hypothesis H 0

Example A die is rolled 120 times 1 comes 20 times, 2 comes 14, 3 comes 18, 4 comes 17, 5 comes 22 and 6 comes 29 times The question is: “Is the die biased?” –or better: “Do these data suggest that the die is biased?” Hypothesis H 0 : the die is not biased – Therefore, according to the null hypothesis these numbers should be distributed uniformly – F() : the discrete uniform distribution

Example – cont. Interpretation – The distribution of the test statistic has 5 df – The probability to get a value smaller or equal than 6.7 under a chi2 distribution with 5 df (p-value) is 0.75, which is < 1-a for all a in { }. – Therefore the hypothesis that the die is not biased cannot be rejected Computations:

Interpretation of Pearson chi2 Graphical illustration z P-value : % of the area under the curve At 10% significance level, I would reject the hypothesis if the computed X 2 >9.24)

Properties of Pearson chi2 statistic It can be estimated for both discrete and continuous variables – Holds for all chi2 statistics. Max flexibility but fails to make use of all available information for continuous variables It is maybe the simplest one from computational point of view As with all chi2 statistics, one needs to define number and borders of bins – These are generally a function of sample size and the theoretical distribution under test

Bin selection How many and which? – Different opinions in literature, no rigid proof of optimality There seems to be convergence on the following aspects – Probability of bins The bins should be chosen equiprobable with respect to the theoretical distribution under test – Minimum expected frequencies np i : (Cramer, 46) : np i > 10, for all bins (Cochran, 54) : np i > 1 for all bins, np i >= 5 for 80% of bins (Roscoe and Byars,71)

Bin selection Relevance of bins M to sample size N – (Mann and Wald, 42), (Schorr, 74) : for large sample sizes 1.88n 2/5 < M < 3.76n 2/5 – (Koehler and Larntz,80) : for small sample size M>=3, n>=10 and n 2 /M>=10 – (Roscoe and Byars, 71) Equi-probable bins hypothesis : N > M when a = 0.01 and a = 0.05 Non-equiprobable bins : N>2M (a = 0.05) and N>4M (a=0.01)

Bin selection Bins vs. sample size according to Mann and Ward

Bin selection : cont. vs. discrete Bin i Equi-probable bins easy to select Less straightforward to define equi-probable bins

References D.J. Sheskin, Handbook of parametric and nonparametric statistical procedures – Introduction (descriptive vs. inferential statistics, hypothesis testing, concepts and terminology) – Test 8 (chap. 8) – The Chi-Square Goodness-of-Fit Test (high-level description with examples and discussion on several aspects) R. Agostino, M. Stephens, Goodness-of-fit techniques – Chapter 3 – Tests of Chi-square type Reviews the theoretical background and looks more generally at chi2 tests, not only the Pearson test. Textbooks

References S. Horn, Goodness-of-Fit tests for discrete data: A review and an Application to a Health Impairment scale – Good discussion of the properties and pros/cons of most goodness- of-fit tests for discrete data – accessible, tutorial-like Papers