Chi-square test
Data Statistics Continuous measurement: Interval Mean Categorical measurement: NominalFrequency, count, proportion One-way chi-square test counts the number of subjects falling into different categories of a variable and determines whether the distribution or pattern of the counts in different categories differs from that expected by the null hypothesis Two way chi-square test counts the number of subjects falling into different categories of two variables and determines whether the distribution or pattern of the counts in different categories of one variable is related to (your hypothesis) or independent from (null hypothesis) that of the other variable.
Examples Hypothesis: The marketing campaign of Pepsi has increased its market share Expected frequency distribution Observed frequency distribution Historical market shares CokePepsiOther 50%30%20% Current market shares CokePepsiOther 40%50%10%
Hong Kong has more high-IQ people than the normal distribution % 16% 50% 20% 10% Expected IQ distributionHK IQ distribution
df 6 df 10 df 20 df 22 df = number of categories minus one
Movie ActionHorrorDramaComedyTotal Observed Expected df = J – 1 = 4 – 1 = 3 0.05 2 = 9.25 2 (3,.05) = 7.81 Reject Null
E 5, df 2 E 10, df = 1 Yates’s correction, 1.Subtract.5 from the observed frequency if the observed frequency is greater than the expected frequency; that is, if O>E, subtract.5 from O. 2. Add.5 to the observed frequency if the observed frequency is less than the expected frequency; that is, if O<E, add.5 to O.
Movie Choices SexActionHorrorDramaComedyTotal Male Female Total (73) (43) (224) (133) (218) (129) (48) (29) 2 observed = = Reject Null 2 = 2 (3,.01) = df = (r – 1)(c – 1) = (4-1)(2-1) = 3 <.01
Answers to Homework 4: Economy has changed undergraduate major choices Past five years record: ScienceSocial ScienceMedicineArts 30%20%40%10% You took a random sample 110 second year students and their majors are distributed: ScienceSocial ScienceMedicineArtsTotal Observed Expected df = k – 1 = 4 – 1 = 3
2 = 2 (3,.01) = Reject Null
Answer to h4: There is a relationship between gender and major choices ScienceSocial ScienceMedicineArtsTotal Female Male ScienceSocial ScienceMedicineArtsTotal 5 /625 / 2415 /1815 /1260 Female 5/ 415 / 1615 /12 5 / 8 40 Male df = (r – 1)(c – 1) = (4 – 1)(2 – 1) = 3
2 = 3.65 2 (3,.01) = Do not reject Null.