Presentation is loading. Please wait.

Presentation is loading. Please wait.

Statistics for Business and Economics Chapter 9 Categorical Data Analysis.

Similar presentations


Presentation on theme: "Statistics for Business and Economics Chapter 9 Categorical Data Analysis."— Presentation transcript:

1 Statistics for Business and Economics Chapter 9 Categorical Data Analysis

2 Learning Objectives 1.Explain 2 Test for Proportions 2.Explain 2 Test of Independence 3.Solve Hypothesis Testing Problems More Than Two Population Proportions Independence

3 Data Types Data QuantitativeQualitative ContinuousDiscrete

4 Qualitative Data Qualitative random variables yield responses that classify –Example: gender (male, female) Measurement reflects number in category Nominal or ordinal scale Examples –What make of car do you drive? –Do you live on-campus or off-campus?

5 Hypothesis Tests Qualitative Data Qualitative Data Z Test 2 Test ProportionIndependence 1 pop. 2 Test More than 2 pop.

6 Chi-Square ( 2 ) Test for k Proportions

7 Hypothesis Tests Qualitative Data Qualitative Data Z Test 2 Test ProportionIndependence 1 pop. 2 Test More than 2 pop.

8 Multinomial Experiment n identical trials k outcomes to each trial Constant outcome probability, p k Independent trials Random variable is count, n k Example: ask 100 people (n) which of 3 candidates (k) they will vote for

9 One-Way Contingency Table Shows number of observations in k independent groups (outcomes or variable levels) Outcomes (k = 3) Number of responses Candidate TomBillMaryTotal 352045100

10 : – H: Prof (Tom) = Prob (Mary)=Prof(Bill)=1/3 –H1: Prof (Tom) = 1/3 –H2: Prof (Mary) = 1/3 –H3: Prof (Bill) = 1/3

11 Calculate the probability of incorrectly rejecting the null using the common sense test based on the three individual t-statistics. To simplify the calculation, suppose that, and are independently distributed. Let t 1 and t 2 be the t-statistics. The common sense test is reject if |t 1 |>1.96 and/or |t 2 | > 1.96 and/or |t 3 | > 1.96. What is the probability that this common sense test rejects H 0 when H 0 is actually true? (It should be 5%.) 11

12 Probability of incorrectly rejecting the null 12

13 which is not the desired 5%. 13

14 The size of a test is the actual rejection rate under the null hypothesis. The size of the common sense test isnt 5%. Its size actually depends on the correlation between t 1 t 2 and t 3 (and thus on the correlation between and ). Two Solutions. Use a different critical value in this procedure - not 1.96 (this is the Bonferroni method). This is rarely used in practice. Use a different test statistic that test at once 14

15 Chi-Square ( 2 ) Test for k Proportions Tests equality (=) of proportions only –Example: p 1 =.2, p 2 =.3, p 3 =.5 One variable with several levels Uses one-way contingency table

16 Conditions Required for a Valid Test: One-way Table 1.A multinomial experiment has been conducted 2.The sample size n is large: E(n i ) is greater than or equal to 5 for every cell

17 2 Test for k Proportions Hypotheses & Statistic 2.Test Statistic Observed count Expected count: E(n i ) = np i,0 3.Degrees of Freedom: k – 1 Number of outcomes Hypothesized probability 1.Hypotheses H 0 : p 1 = p 1,0, p 2 = p 2,0,..., p k = p k,0 H a : At least one p i is different from above

18 2 Test Basic Idea 1.Compares observed count to expected count assuming null hypothesis is true 2.Closer observed count is to expected count, the more likely the H 0 is true Measured by squared difference relative to expected count Reject large values

19 Finding Critical Value Example What is the critical 2 value if k = 3, and =.05? 2 0 Upper Tail Area DF.995….95….05 1...…0.004…3.841 20.010…0.103…5.991 2 Table (Portion) If n i = E(n i ), 2 = 0. Do not reject H 0 df= k - 1 = 2 5.991 Reject H 0 =.05

20 As personnel director, you want to test the perception of fairness of three methods of performance evaluation. Of 180 employees, 63 rated Method 1 as fair, 45 rated Method 2 as fair, 72 rated Method 3 as fair. At the.05 level of significance, is there a difference in perceptions? 2 Test for k Proportions Example

21 H 0 : H a : = n 1 = n 2 = n 3 = Critical Value(s): Test Statistic: Decision: Conclusion: p 1 = p 2 = p 3 = 1/3 At least 1 is different.05 634572 =.05 2 0 Reject H 0 5.991 2 Test for k Proportions Solution

22

23 Test Statistic: Decision: Conclusion: 2 = 6.3 Reject at =.05 There is evidence of a difference in proportions 2 Test for k Proportions Solution H 0 : H a : = n 1 = n 2 = n 3 = Critical Value(s): 2 0 Reject H 0 p 1 = p 2 = p 3 = 1/3 At least 1 is different.05 634572 5.991 =.05

24 Hypothesis Tests Qualitative Data Qualitative Data Z TestZ, Chi 2 Test ProportionIndependence 1 pop. 2 Test More than 2 pop.

25 Contingency Table Example Left-Handed vs. Gender Dominant Hand: Left vs. Right Gender: Male vs. Female 2 categories for each variable, so called a 2 x 2 table Suppose we examine a sample of 300 children

26 Contingency Table Example Sample results organized in a contingency table: (continued) Gender Hand Preference LeftRight Female12108120 Male24156180 36264300 120 Females, 12 were left handed 180 Males, 24 were left handed sample size = n = 300:

27 H 0 : H a : = n 1 = n 2 = Critical Value(s): Test Statistic: Decision: Conclusion: p 1 = p 2 At least 1 is different.05 1224 =.05 2 0 Reject H 0 3.841 Contingency Table Example Solution

28 If the two proportions are equal, then P(Left Handed | Female) = P(Left Handed | Male) =.12 i.e., we would expect (.12)(120) = 14.4 females to be left handed (.12)(180) = 21.6 males to be left handed

29 H 0 : H a : = n 1 = n 2 = Critical Value(s): Test Statistic: Decision: Conclusion: p 1 = p 2 At least 1 is different.05 1224 =.05 2 0 Reject H 0 3.841 Contingency Table Example Solution 2 = 0.7576 Reject at =.05 There is evidence of a difference in proportions

30 2 Test of Independence

31 Hypothesis Tests Qualitative Data Qualitative Data Z Test 2 Test ProportionIndependence 1 pop. 2 Test More than 2 pop.

32 2 Test of Independence Shows if a relationship exists between two qualitative variables –One sample is drawn –Does not show causality Uses two-way contingency table

33 2 Test of Independence Contingency Table Shows number of observations from 1 sample jointly in 2 qualitative variables Levels of variable 2 Levels of variable 1

34 Conditions Required for a Valid 2 Test: Independence 1.Multinomial experiment has been conducted 2.The sample size, n, is large: E ij is greater than or equal to 5 for every cell

35 2 Test of Independence Hypotheses & Statistic 1.Hypotheses H 0 : Variables are independent H a : Variables are related (dependent) 3.Degrees of Freedom: (r – 1)(c – 1) Rows Columns 2.Test Statistic Observed count Expected count

36 2 Test of Independence Expected Counts 1.Statistical independence means joint probability equals product of marginal probabilities 2.Compute marginal probabilities and multiply for joint probability 3.Expected count is sample size times joint probability

37 112 160 Marginal probability = Expected Count Example Location UrbanRural House Style Obs. Obs.Total Split–Level 63 49 112 Ranch 15 33 48 Total 78 82 160

38 78 160 Marginal probability = Expected Count Example 112 160 Marginal probability = Location UrbanRural House Style Obs. Obs.Total Split–Level 63 49 112 Ranch 15 33 48 Total 78 82 160

39 Expected Count Example 78 160 Marginal probability = 112 160 Marginal probability = Joint probability = 112 160 78 160 Location UrbanRural House Style Obs. Obs.Total Split–Level 63 49 112 Ranch 15 33 48 Total 78 82 160 Expected count = 160· 112 160 78 160 = 54.6

40 Expected Count Calculation House Location Urban Rural House Style Obs. Exp. Obs. Exp. Total Split-Level 63 112·78 160 54.6 49 112·82 160 57.4 112 Ranch 15 48·78 160 23.4 33 48·82 160 24.6 48 Total 78 82 160

41 As a realtor you want to determine if house style and house location are related. At the.05 level of significance, is there evidence of a relationship? 2 Test of Independence Example

42 2 Test of Independence Solution H 0 : H a : = df = Critical Value(s): Test Statistic: Decision: Conclusion: No Relationship Relationship.05 (2 - 1)(2 - 1) = 1 2 0 Reject H 0 3.841 =.05

43 E ij 5 in all cells 2 Test of Independence Solution 112·82 160 48·78 160 48·82 160 112·78 160

44 2 Test of Independence Solution

45 Test Statistic: Decision: Conclusion: 2 = 8.41 Reject at =.05 There is evidence of a relationship H 0 : H a : = df = Critical Value(s): 2 0 Reject H 0 No Relationship Relationship.05 (2 - 1)(2 - 1) = 1 3.841 =.05

46 Youre a marketing research analyst. You ask a random sample of 286 consumers if they purchase Diet Pepsi or Diet Coke. At the.05 level of significance, is there evidence of a relationship? 2 Test of Independence Thinking Challenge Diet Pepsi Diet CokeNoYesTotal No 84 32116 Yes 48122170 Total132154286

47 2 Test of Independence Solution* H 0 : H a : = df = Critical Value(s): Test Statistic: Decision: Conclusion: No Relationship Relationship.05 (2 - 1)(2 - 1) = 1 2 0 Reject H 0 3.841 =.05

48 E ij 5 in all cells 170·132 286 170·154 286 116·132 286 154·132 286 2 Test of Independence Solution*

49

50 Test Statistic: Decision: Conclusion: 2 = 54.29 Reject at =.05 There is evidence of a relationship H 0 : H a : = df = Critical Value(s): 2 0 Reject H 0 No Relationship Relationship.05 (2 - 1)(2 - 1) = 1 3.841 =.05

51 Example The meal plan selected by 200 students is shown below: Class Standing Number of meals per week Total 20/wee k 10/weeknone Fresh.24321470 Soph.22261260 Junior1014630 Senior14161040 Total708842200

52 Example The hypothesis to be tested is: (continued) H 0 : Meal plan and class standing are independent (i.e., there is no relationship between them) H 1 : Meal plan and class standing are dependent (i.e., there is a relationship between them)

53 Class Standin g Number of meals per week Total 20/wk10/wknone Fresh.24321470 Soph.22261260 Junior1014630 Senior14161040 Total708842200 Class Standing Number of meals per week Total 20/wk10/wknone Fresh.24.530.814.770 Soph.21.026.412.660 Junior10.513.26.330 Senior14.017.68.440 Total708842200 Observed: Expected cell frequencies if H 0 is true: Example for one cell: Example: Expected Cell Frequencies (continued)

54 Example: The Test Statistic The test statistic value is: (continued) = 12.592 from the chi-squared distribution with (4 – 1)(3 – 1) = 6 degrees of freedom

55 Example: Decision and Interpretation (continued) Decision Rule: If > 12.592, reject H 0, otherwise, do not reject H 0 Here, = 0.709 < = 12.592, so do not reject H 0 Conclusion: there is not sufficient evidence that meal plan and class standing are related at = 0.05 2 0.05 =12.592 0 0.05 Reject H 0 Do not reject H 0

56 Conclusion 1.Explained 2 Test for Proportions 2.Explained 2 Test of Independence 3.Solved Hypothesis Testing Problems More Than Two Population Proportions Independence


Download ppt "Statistics for Business and Economics Chapter 9 Categorical Data Analysis."

Similar presentations


Ads by Google