# Chi-Squared Hypothesis Testing Using One-Way and Two-Way Frequency Tables of Categorical Variables.

## Presentation on theme: "Chi-Squared Hypothesis Testing Using One-Way and Two-Way Frequency Tables of Categorical Variables."— Presentation transcript:

Chi-Squared Hypothesis Testing Using One-Way and Two-Way Frequency Tables of Categorical Variables

 2 Hypothesis Test Goodness-of-Fit Independence Homogeneity

Analyzing an Exam Question How does a teacher determine if students were “clueless” on an exam question vs. students were unprepared for that particular exam question?

Goodness-of-Fit Test If you need to test whether populations are distributed evenly (or “preset” proportions), then use Goodness-of-Fit test. 1.This requires a one-way frequency (count) table. 2.Random sample is required for counts. 3.Expected cell counts greater than 5. What’s an expected cell count?

Expected Cell Count? Suppose 300 students answered a multiple choice question with the following distribution. Did the students randomly select answers (I.e. are the answers equally distributed)? The expected cell count for A is 300(1/5) = 60. As the same is true for B thru E. If we assume the answers are equally distributed (null hypothesis), then we “share” the 300 responses equally. ABCDE 6853784259

Observed vs. Expected The observed values are the actual sampled counts (occurrences). The expected values are the hypothesized outcomes based on the null hypothesis. In this example, we are assuming the each answer was equally selected by students. ABCDE Observed6853784259 Expected60

 2 Statistic The computer (or calculator) will calculate the chi-squared statistic for you, and determine the degrees of freedom and p-value. What is degrees of freedom?

Chi-Squared Statistic and p-value  2 = 6.5, df = 4, P(  2 > 6.5) =.16479

 2 Statistic H o :  A =  B =  C =  D =  E H a : at least one  is different  2 = 12.7, df = 4, P(  2 > 12.7) =.0128 ABCDE Observed6853784259 Expected60

Goodness-of-Fit Test What if the hypothesized proportions were not all the same? Example: Does the color of your car influence the chance it will be stolen? Suppose it is known that all cars in the world consist of 15% white, 30% black, 35% red, 15% blue, and 5% other colors.

Color of Stolen Car H o :  W =.15,  B =.30,  R =.35,  U =.30,  E =.05 H a : at least one  is different WhiteBlackRedBlueOther Obsv14023027010090 Expect124.5249.0290.5124.541.5  2 = 66.33, df = 4, P(  2 > 66.33) = 1.3x10 -13

Two-Way Tables Homogeneity—tests for equal category proportions for all populations (because separate random samples were used to collect information). Independence—tests for an independence (no association) between 2 categorical variables. Don’t worry; same test!

College Students’ Drinking Levels The data on drinking behavior for independently chosen random samples of male and female students was collected. Does there appear to be a gender difference with respect to drinking behavior?

Homogeneity Test Gender DrinkingMenWomen None140186 (158.6)(167.4) Low478661 (554.0)(585.0) Moderate300173 (230.1)(242.9) High6316 (38.4)(40.6)

College Students’ Drinking Levels H o : True proportions for the 4 drinking levels are the same for males and females. H a : At least one true proportion is different.  2 = 96.53, df = (4 – 1)(2 – 1) = 3 P(  2 > 96.53) = 8.68 x 10 -21 Reject H o ; data indicates that males and females differ with respect to drinking levels.

Sexual Risk-Taking Factors Among Adolescents Each person in a random sample of sexually active teens was classified according to gender and contraceptive use. Is there a relationship between gender and contraceptive use by sexually active teens?

Independent (No Association) Test Gender Contraceptive Use FemaleMale Rarely/Never210350 (224)(336) Sometimes/ Most Times 190320 (204)(306) Always400530 (372)(558)

Sexual Risk-Taking Factors Among Adolescents H o : Gender and contraceptive use have no association (independent). H a : Gender and contraceptive use have an association (dependent).  2 = 6.572, df = (3 – 1)(2 – 1) = 2 P(  2 > 6.572) =.035 Reject H o and conclude there is an association between gender and contraceptive use.

Expected (Cell) Count for Two-Way Tables

Conditions (Requirements) for  2 Test with 2-Way Tables 1)Random Sample 2)At least 80% of Expected Cell Counts are greater than 5. 3)All Expected Cell Counts and Observed values are greater than or equal to 1.

Titanic Moviemakers of Titanic imply that lower- class passengers were treated unfairly. Was that accurate?

Likelihood of Survival on Titanic? H o :  C = 109/1318,  W = 402/1318,  M = 807/1318 H a : at least one  is different  2 = 225.16, df = 2, P(  2 > 225.16) = 0.000 Reject H o and conclude at least one proportion is different. ChildrenWomenMen Observed57296146 Expected41.269152.199305.533

Download ppt "Chi-Squared Hypothesis Testing Using One-Way and Two-Way Frequency Tables of Categorical Variables."

Similar presentations