Weldon s dice. Lecture 15 - χ 2 Tests. Labby s dice. Labby s dice (cont.)

Similar documents
10.2 Hypothesis Testing with Two-Way Tables

Wolf River. Lecture 15 - ANOVA. Exploratory analysis. Wolf River - Data. Sta102 / BME102. October 22, 2014

Wolf River. Lecture 15 - ANOVA. Exploratory analysis. Wolf River - Data. Sta102 / BME102. October 26, 2015

Quantitative Analysis and Empirical Methods

Example - Alfalfa (11.6.1) Lecture 14 - ANOVA cont. Alfalfa Hypotheses. Treatment Effect

Wolf River. Lecture 19 - ANOVA. Exploratory analysis. Wolf River - Data. Sta 111. June 11, 2014

Inferential statistics

Purposes of Data Analysis. Variables and Samples. Parameters and Statistics. Part 1: Probability Distributions

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

HYPOTHESIS TESTING: THE CHI-SQUARE STATISTIC

STAT 135 Lab 6 Duality of Hypothesis Testing and Confidence Intervals, GLRT, Pearson χ 2 Tests and Q-Q plots. March 8, 2015

Announcements. Unit 4: Inference for numerical variables Lecture 4: ANOVA. Data. Statistics 104

Lecture 41 Sections Mon, Apr 7, 2008

Mathematical Notation Math Introduction to Applied Statistics

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

Ch. 11 Inference for Distributions of Categorical Data

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

Chapter 26: Comparing Counts (Chi Square)

Class 19. Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science. Marquette University MATH 1700

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

Statistical methods for comparing multiple groups. Lecture 7: ANOVA. ANOVA: Definition. ANOVA: Concepts

Project proposal feedback. Unit 4: Inference for numerical variables Lecture 3: t-distribution. Statistics 104

AMS7: WEEK 7. CLASS 1. More on Hypothesis Testing Monday May 11th, 2015

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

The Multinomial Model

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

Lecture 22. December 19, Department of Biostatistics Johns Hopkins Bloomberg School of Public Health Johns Hopkins University.

Nature vs. nurture? Lecture 18 - Regression: Inference, Outliers, and Intervals. Regression Output. Conditions for inference.

j=1 π j = 1. Let X j be the number

Statistics Primer. ORC Staff: Jayme Palka Peter Boedeker Marcus Fagan Trey Dejong

Example - Alfalfa (11.6.1) Lecture 16 - ANOVA cont. Alfalfa Hypotheses. Treatment Effect

Chi Square Analysis M&M Statistics. Name Period Date

Hypotheses. Poll. (a) H 0 : µ 6th = µ 13th H A : µ 6th µ 13th (b) H 0 : p 6th = p 13th H A : p 6th p 13th (c) H 0 : µ diff = 0

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

Review of Statistics 101

MAT Mathematics in Today's World

Lecture 15 - ANOVA cont.

Econ 325: Introduction to Empirical Economics

Lecture 28 Chi-Square Analysis

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

Announcements. Lecture 1 - Data and Data Summaries. Data. Numerical Data. all variables. continuous discrete. Homework 1 - Out 1/15, due 1/22

Topic 21 Goodness of Fit

Psych 230. Psychological Measurement and Statistics

Last two weeks: Sample, population and sampling distributions finished with estimation & confidence intervals

STA 247 Solutions to Assignment #1

Lecture 17. Ingo Ruczinski. October 26, Department of Biostatistics Johns Hopkins Bloomberg School of Public Health Johns Hopkins University

Testing Independence

Multiple Sample Categorical Data

Class 24. Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science. Marquette University MATH 1700

HYPOTHESIS TESTING. Hypothesis Testing

Mean, Median and Mode. Lecture 3 - Axioms of Probability. Where do they come from? Graphically. We start with a set of 21 numbers, Sta102 / BME102

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

Statistics for Managers Using Microsoft Excel

2 and F Distributions. Barrow, Statistics for Economics, Accounting and Business Studies, 4 th edition Pearson Education Limited 2006

10: Crosstabs & Independent Proportions

Part 1.) We know that the probability of any specific x only given p ij = p i p j is just multinomial(n, p) where p k1 k 2

11-2 Multinomial Experiment

Two-sample Categorical data: Testing

MATH 10 INTRODUCTORY STATISTICS

Do students sleep the recommended 8 hours a night on average?

Lecture 7: Hypothesis Testing and ANOVA

Last week: Sample, population and sampling distributions finished with estimation & confidence intervals

CIVL /8904 T R A F F I C F L O W T H E O R Y L E C T U R E - 8

Lecture 11 - Tests of Proportions

STAT Chapter 13: Categorical Data. Recall we have studied binomial data, in which each trial falls into one of 2 categories (success/failure).

Chapter 8 Student Lecture Notes 8-1. Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance

Business Statistics: Lecture 8: Introduction to Estimation & Hypothesis Testing

Frequency Distribution Cross-Tabulation

ij i j m ij n ij m ij n i j Suppose we denote the row variable by X and the column variable by Y ; We can then re-write the above expression as

Statistics 3858 : Contingency Tables

Part III: Unstructured Data

Announcements. Lecture 5: Probability. Dangling threads from last week: Mean vs. median. Dangling threads from last week: Sampling bias

Module 10: Analysis of Categorical Data Statistics (OA3102)

Testing Research and Statistical Hypotheses

One-Way Tables and Goodness of Fit

Hypothesis Testing. ) the hypothesis that suggests no change from previous experience

AP Statistics Cumulative AP Exam Study Guide

Exam 2 Practice Questions, 18.05, Spring 2014

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

Classroom Activity 7 Math 113 Name : 10 pts Intro to Applied Stats

1 Descriptive statistics. 2 Scores and probability distributions. 3 Hypothesis testing and one-sample t-test. 4 More on t-tests

Section 9.1 (Part 2) (pp ) Type I and Type II Errors

CHI SQUARE ANALYSIS 8/18/2011 HYPOTHESIS TESTS SO FAR PARAMETRIC VS. NON-PARAMETRIC

Lecture 41 Sections Wed, Nov 12, 2008

Harvard University. Rigorous Research in Engineering Education

79 Wyner Math Academy I Spring 2016

Occupy movement - Duke edition. Lecture 14: Large sample inference for proportions. Exploratory analysis. Another poll on the movement

Chapter 24. Comparing Means. Copyright 2010 Pearson Education, Inc.

Random processes. Lecture 17: Probability, Part 1. Probability. Law of large numbers

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 14

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

So far we discussed random number generators that need to have the maximum length period.

Research Methodology: Tools

Normal (Gaussian) distribution The normal distribution is often relevant because of the Central Limit Theorem (CLT):

Sociology 6Z03 Review II

Evaluation. Andrea Passerini Machine Learning. Evaluation

4 Hypothesis testing. 4.1 Types of hypothesis and types of error 4 HYPOTHESIS TESTING 49

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

Business Statistics. Lecture 10: Course Review

t-test for b Copyright 2000 Tom Malloy. All rights reserved. Regression

Transcription:

Weldon s dice Weldon s dice Lecture 15 - χ 2 Tests Sta102 / BME102 Colin Rundel March 6, 2015 Walter Frank Raphael Weldon (1860-1906), was an English evolutionary biologist and a founder of biometry. He was the joint founding editor of Biometrika, with Francis Galton and Karl Pearson. In 1894, he rolled 12 dice 26,306 times, and recorded the number of 5s or 6s (which he considered to be a success). It was observed that 5s or 6s occurred more often than expected, and Pearson hypothesized that this was probably due to the construction of the dice. Most inexpensive dice have hollowed-out pips, and since opposite sides add to 7, the face with 6 pips is lighter than its opposing face, which has only 1 pip. Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 2 / 36 Weldon s dice Weldon s dice Labby s dice Labby s dice (cont.) In 2009, Zacariah Labby (U of Chicago), repeated Weldon s experiment using a homemade dice-throwing, pip counting machine. http:// www.youtube.com/ watch? v=95eerdouo2w The rolling-imaging process took about 20 seconds per roll. Each day there were 150 images to process manually. At this rate Weldon s experiment was repeated in about six days. Recommended reading: http:// galton.uchicago.edu/ about/ docs/ labby09dice.pdf Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 3 / 36 Labby did not actually observe the same phenomenon that Weldon observed (higher frequency of 5s and 6s). Automation allowed Labby to collect more data than Weldon did in 1894, instead of recording successes and failures, Labby recorded the individual number of pips on each die. Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 4 / 36

Creating a test statistic for one-way tables Creating a test statistic for one-way tables Summarizing Labby s results Setting the hypotheses Labby rolled 12 dice 26,306 times. If each side is equally likely to come up, how many 1s, 2s,, 6s would he expect to have observed? The table below shows the observed and expected counts from Labby s experiment. Outcome Observed Expected 1 53,222 2 52,118 3 52,465 4 52,338 5 52,244 6 53,285 Total 315,672 315,672 Do these data provide convincing evidence to suggest an inconsistency between the observed and expected counts? H 0 : There is no inconsistency between the observed and the expected counts. The observed counts follow the same distribution as the expected counts. H A : There is an inconsistency between the observed and the expected counts. The observed counts do not follow the same distribution as the expected counts. (There is a bias in which side comes up on the roll of a die) Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 5 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 6 / 36 Creating a test statistic for one-way tables Evaluating the hypotheses Anatomy of a test statistic To evaluate these hypotheses, we quantify how different the observed counts are from the expected counts. Large deviations from what would be expected based on sampling variation (chance) alone provide strong evidence against the null hypothesis. This is called a goodness of fit test since we re evaluating how well the observed data fit the expected distribution. The general form of the test statistics we ve seen this far is This construction is based on point estimate null value SE of point estimate 1 identifying the difference between a point estimate and an expected value if the null hypothesis was true, and 2 standardizing that difference using the standard error of the point estimate. These two ideas will help in the construction of an appropriate test statistic for count data. Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 7 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 8 / 36

χ 2 statistic When dealing with counts and investigating how far the observed counts are from the expected counts, we use a new test statistic called the χ 2 (chi-squared) statistic. The χ 2 statistic is defined to be χ 2 = k (O E) 2 E where k = total number of cells/categories Calculating the χ 2 statistic Outcome Observed Expected 1 53,222 2 52,118 3 52,465 4 52,338 5 52,244 6 53,285 (O E) 2 E (53,222 ) 2 = 7.07 (52,118 ) 2 = 4.64 (52,465 ) 2 = 0.41 (52,338 ) 2 = 1.43 (52,244 ) 2 = 2.57 (53,285 ) 2 = 8.61 Total 315,672 315,672 24.73 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 9 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 10 / 36 Why square? Squaring the difference between the observed and the expected outcome does two things: Any standardized difference that is squared will now be positive. Differences that already looked unusual will become much larger after being squared. Conditions for the χ 2 test 1 Independence: Each case that contributes a count to the table must be independent of all the other cases in the table. 2 Sample size: Each particular scenario (i.e. cell) must have at least 5 expected cases. Failing to check conditions may unintentionally affect the test s error rates. Where have we seen this before? Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 11 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 12 / 36

The χ 2 distribution In order to determine if the χ 2 statistic we calculated is considered unusually high or not we need to first describe its distribution. The χ 2 distribution has just one parameter called degrees of freedom (df), which influences the shape, center, and spread of the distribution. For a goodness of fit test the degrees of freedom is the number of categories - 1 (df = k 1). So far we ve seen two other continuous distributions: Normal distribution - unimodal and symmetric with two parameters: mean (center) and standard deviation (spread) T distribution - unimodal and symmetric with one parameter: degrees of freedom (spead, kurtosis) The χ 2 distribution (Theory) Where does the χ 2 distribution come from? Like the T and the Z, the χ 2 distribution is an example of a continuous probability distribution (it is actually a special case of another distribution called the Gamma distribution) If we define Z N(0, 1) then the quantity, Z 2 χ 2 df =1 If we have Z 1,..., Z n N(0, 1) then the quantity, n 2 iid Z i χ 2 df =n Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 13 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 14 / 36 The χ 2 distribution (cont.) The χ 2 distribution (cont.) Degrees of Freedom 2 4 9 Degrees of Freedom 50 0 5 10 15 20 25 As the df increases: the center of the χ 2 distribution increases the variability of the χ 2 distribution increases 0 20 40 60 80 100 Also, for large df the χ 2 distribution converges to the normal distribution with N (µ = df, σ 2 = 2df ). Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 15 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 16 / 36

Finding areas under the χ 2 curve p-value = tail area under the χ 2 distribution (as usual) For this we can use technology, or a χ 2 probability table. This table works a lot like the t table, but only provides upper tail probabilities. Finding areas under the χ 2 curve (cont.) Estimate the shaded area under the χ 2 curve with df = 6. df = 6 0 10 0 5 10 15 20 25 df 1 1.07 1.64 2.71 3.84 5.41 6.63 7.88 10.83 2 2.41 3.22 4.61 5.99 7.82 9.21 10.60 13.82 3 3.66 4.64 6.25 7.81 9.84 11.34 12.84 16.27 4 4.88 5.99 7.78 9.49 11.67 13.28 14.86 18.47 5 6.06 7.29 9.24 11.07 13.39 15.09 16.75 20.52 6 7.23 8.56 10.64 12.59 15.03 16.81 18.55 22.46 7 8.38 9.80 12.02 14.07 16.62 18.48 20.28 24.32 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 17 / 36 df 1 1.07 1.64 2.71 3.84 5.41 6.63 7.88 10.83 2 2.41 3.22 4.61 5.99 7.82 9.21 10.60 13.82 3 3.66 4.64 6.25 7.81 9.84 11.34 12.84 16.27 4 4.88 5.99 7.78 9.49 11.67 13.28 14.86 18.47 5 6.06 7.29 9.24 11.07 13.39 15.09 16.75 20.52 6 7.23 8.56 10.64 12.59 15.03 16.81 18.55 22.46 7 8.38 9.80 12.02 14.07 16.62 18.48 20.28 24.32 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 18 / 36 Finding areas under the χ 2 curve (cont.) Estimate the shaded area (above 17) under the χ 2 curve with df = 9. Finding areas under the χ 2 curve (one more) Estimate the shaded area (above 30) under the χ 2 curve with df = 10. df = 9 df = 10 0 17 df 7 8.38 9.80 12.02 14.07 16.62 18.48 20.28 24.32 8 9.52 11.03 13.36 15.51 18.17 20.09 21.95 26.12 9 10.66 12.24 14.68 16.92 19.68 21.67 23.59 27.88 10 11.78 13.44 15.99 18.31 21.16 23.21 25.19 29.59 11 12.90 14.63 17.28 19.68 22.62 24.72 26.76 31.26 0 30 df 7 8.38 9.80 12.02 14.07 16.62 18.48 20.28 24.32 8 9.52 11.03 13.36 15.51 18.17 20.09 21.95 26.12 9 10.66 12.24 14.68 16.92 19.68 21.67 23.59 27.88 10 11.78 13.44 15.99 18.31 21.16 23.21 25.19 29.59 11 12.90 14.63 17.28 19.68 22.62 24.72 26.76 31.26 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 19 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 20 / 36

Finding the tail areas using computation Back to Labby s dice While probability tables are very helpful in understanding how probability distributions work, and provide quick reference when computational resources are not available, they are somewhat archaic. Using R: pchisq(q = 30, df = 10, lower.tail = FALSE) ## [1] 0.0008566412 Using a web applet - bit.ly/dist_calc The research question was: Does Labby s data provide convincing evidence to suggest an inconsistency between the observed and expected counts? The hypotheses were: H 0 : There is no inconsistency between the observed and the expected counts. The observed counts follow the same distribution as the expected counts. H A : There is an inconsistency between the observed and the expected counts. The observed counts do not follow the same distribution as the expected counts. (There is a bias in which side comes up on the roll of a die) We had calculated a test statistic of χ 2 = 24.67. All we need is the df and we can calculate the tail area (the p-value) and make a decision on the hypotheses. Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 21 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 22 / 36 Degrees of freedom for a goodness of fit test When conducting a goodness of fit test to evaluate how well the observed data follow an expected distribution, the degrees of freedom are calculated as the number of cells (k) minus 1. The p-value for a χ 2 test is defined as the tail area above the calculated test statistic. df = k 1 For dice outcomes, k = 6, therefore df = 6 1 = 5 df = 5 0 24.67 p-value = P(χ 2 df =5 > 24.67) df 1 1.07 1.64 2.71 3.84 5.41 6.63 7.88 10.83 2 2.41 3.22 4.61 5.99 7.82 9.21 10.60 13.82 3 3.66 4.64 6.25 7.81 9.84 11.34 12.84 16.27 4 4.88 5.99 7.78 9.49 11.67 13.28 14.86 18.47 5 6.06 7.29 9.24 11.07 13.39 15.09 16.75 20.52 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 23 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 24 / 36

Conclusion of the hypothesis test We calculated a p-value less than 0.001. At the 5% significance level, what is the conclusion of the hypothesis test? So what does this mean? Turns out... The 1-6 axis is consistently shorter than the other two (2-5 and 3-4), thereby supporting the hypothesis that the faces with one and six pips are larger than the other faces. Pearson s claim that 5s and 6s appear more often due to the carved-out pips is not supported by these data. Dice used in casinos have flush faces, where the pips are filled in with a plastic of the same density as the surrounding material and are precisely balanced. Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 25 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 26 / 36 Popular kids Recap: p-value for a χ 2 test The p-value for a χ 2 test is defined as the tail area above the calculated test statistic. This is because the test statistic is always positive, and a higher test statistic means a higher deviation from the null hypothesis. Popular kids In the dataset popular, students in grades 4-6 were asked whether good grades, athletic ability, or popularity was most important to them. A two-way table separating the students by grade and by choice of most important factor is shown below. Do these data provide evidence to suggest that goals vary by grade? 4th 5th 6th Grades Popular Sports 4 th 63 31 25 5 th 88 55 33 6 th 96 55 32 Grades Popular p value Sports Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 27 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 28 / 36

Popular kids Expected counts in two-way tables The hypotheses are: H 0 : Grade and goals are independent. Goals do not vary by grade. H A : Grade and goals are dependent. Goals vary by grade. Conditions for the Independence: Each case that contributes a count to the table must be independent of all the other cases in the table. Sample size: Each particular scenario (i.e. cell) must have at least 5 expected counts. The test statistic is calculated using k χ 2 (O E) 2 df = where df = (R 1) (C 1), E where k is the number of cells, R is the number of rows, and C is the number of columns. The p-value is the area under the χ 2 df curve, above the calculated test statistic. Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 29 / 36 (cont.) Expected counts in two-way tables: E row 1,col 1 = Expected Count = (row total) (column total) table total Grades Popular Sports Total 4 th 63 31 25 119 5 th 88 55 33 176 6 th 96 55 32 183 Total 247 141 90 478 119 247 478 = 61 E row 1,col 2 = 119 141 478 = 35 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 30 / 36 Expected counts in two-way tables Expected counts in two-way tables Expected counts in two-way tables What is the expected count for the highlighted cell? Grades Popular Sports Total 4 th 63 31 25 119 5 th 88 55 33 176 6 th 96 55 32 183 Total 247 141 90 478 Calculating the test statistic in two-way tables Expected counts are shown in (blue) next to the observed counts. Grades Popular Sports Total 4 th 63 (61) 31 (35) 25 (23) 119 5 th 88 (91) 55 (52) 33 (33) 176 6 th 96 (95) 55 (54) 32 (34) 183 Total 247 141 90 478 χ 2 = (63 61) 2 (31 35)2 (32 34)2 + + + = 1.3121 61 35 34 df = (R 1) (C 1) = (3 1) (3 1) = 2 2 = 4 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 31 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 32 / 36

Results Results Calculating the p-value What is the correct p-value for this hypothesis test χ 2 = 1.3121 df = 4 df 1 1.07 1.64 2.71 3.84 5.41 6.63 7.88 10.83 2 2.41 3.22 4.61 5.99 7.82 9.21 10.60 13.82 3 3.66 4.64 6.25 7.81 9.84 11.34 12.84 16.27 4 4.88 5.99 7.78 9.49 11.67 13.28 14.86 18.47 5 6.06 7.29 9.24 11.07 13.39 15.09 16.75 20.52 Conclusion Do these data provide evidence to suggest that goals vary by grade? H 0 : Grade and goals are independent. Goals do not vary by grade. H A : Grade and goals are dependent. Goals vary by grade. df = 4 P(χ 2 df =4 > 1.3121) is more than 0.3 P-value > 0.3 0 1.3121 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 33 / 36 Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 34 / 36 Summary Summary - χ 2 test of goodness of fit Data: y - categorical variable w/ 3 or more levels, x - none. Hypotheses: H 0 - data follow the given distribution, Conditions: Test statistic: H A - data do not follow the given distribution. Independent observations, all E i 5. χ 2 = k (O i E i ) 2, df = k 1 E i Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 35 / 36 Summary Summary - Data: Hypotheses: Conditions: Test statistic: y - categorical variable w/ 2 or more levels, x - categorical variable w/ 2 or more levels. χ 2 = H 0 - x and y are independent, H A - x and y are dependent. Independent observations, all E i,j 5. m n (O i,j E i,j ) 2, df = (m 1)(n 1) E i,j j=1 E i,j = N i, N,j N, Sta102 / BME102 (Colin Rundel) Lec 15 March 6, 2015 36 / 36