1 2 Test for Independence 2 Test for Independence.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

The t Test for Two Independent Samples
Advanced Piloting Cruise Plot.
Chapter 1 The Study of Body Function Image PowerPoint
STATISTICS HYPOTHESES TEST (II) One-sample tests on the mean and variance Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National.
The chi-squared test,, of independence (contingency tables)
1 2 Test for Independence 2 Test for Independence.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Overview of Lecture Parametric vs Non-Parametric Statistical Tests.
Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA
Lecture 2 ANALYSIS OF VARIANCE: AN INTRODUCTION
1 Contact details Colin Gray Room S16 (occasionally) address: Telephone: (27) 2233 Dont hesitate to get in touch.
NIPRL Chapter 10. Discrete Data Analysis 10.1 Inferences on a Population Proportion 10.2 Comparing Two Population Proportions 10.3 Goodness of Fit Tests.
EPI809/Spring Chapter 10 Hypothesis testing: Categorical Data Analysis.
Elementary Statistics
Business Statistics: A Decision-Making Approach, 6e © 2005 Prentice-Hall, Inc. Chap 10-1 Business Statistics: A Decision-Making Approach 6 th Edition Chapter.
Statistics for Business and Economics
Chapter 13: Chi-Square Test
ABC Technology Project
© 2011 Pearson Education, Inc
Contingency Tables Prepared by Yu-Fen Li.
Statistics for Business and Economics Chapter 9 Categorical Data Analysis.
STATISTICS ELEMENTARY MARIO F. TRIOLA
Chapter 16 Goodness-of-Fit Tests and Contingency Tables
Chi-Square and Analysis of Variance (ANOVA)
VOORBLAD.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Module 16: One-sample t-tests and Confidence Intervals
Addition 1’s to 20.
25 seconds left…...
Week 1.
© The McGraw-Hill Companies, Inc., Chapter 10 Testing the Difference between Means and Variances.
Copyright © 2014 Pearson Education, Inc. All rights reserved Chapter 10 Associations Between Categorical Variables.
We will resume in: 25 Minutes.
© The McGraw-Hill Companies, Inc., Chapter 12 Chi-Square.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
McGraw-Hill/Irwin Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. Chi-Square Tests Chapter 12.
Chapter 18: The Chi-Square Statistic
PSSA Preparation.
Experimental Design and Analysis of Variance
Categorical Data Analysis
Chapter 26 Comparing Counts
CHI-SQUARE(X2) DISTRIBUTION
 2 Test of Independence. Hypothesis Tests Categorical Data.
12.The Chi-square Test and the Analysis of the Contingency Tables 12.1Contingency Table 12.2A Words of Caution about Chi-Square Test.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 14 Goodness-of-Fit Tests and Categorical Data Analysis.
11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data.
HAWKES LEARNING SYSTEMS Students Matter. Success Counts. Copyright © 2013 by Hawkes Learning Systems/Quant Systems, Inc. All rights reserved. Section 10.7.
Chapter 11: Applications of Chi-Square. Count or Frequency Data Many problems for which the data is categorized and the results shown by way of counts.
1 In this case, each element of a population is assigned to one and only one of several classes or categories. Chapter 11 – Test of Independence - Hypothesis.
© 2000 Prentice-Hall, Inc. Statistics The Chi-Square Test & The Analysis of Contingency Tables Chapter 13.
Section 10.2 Independence. Section 10.2 Objectives Use a chi-square distribution to test whether two variables are independent Use a contingency table.
Chapter Outline Goodness of Fit test Test of Independence.
ContentFurther guidance  Hypothesis testing involves making a conjecture (assumption) about some facet of our world, collecting data from a sample,
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 12 Tests of Goodness of Fit and Independence n Goodness of Fit Test: A Multinomial.
Section 10.2 Objectives Use a contingency table to find expected frequencies Use a chi-square distribution to test whether two variables are independent.
Test of independence: Contingency Table
10 Chapter Chi-Square Tests and the F-Distribution Chapter 10
Chapter 12 Tests with Qualitative Data
Contingency Tables: Independence and Homogeneity
CHI SQUARE TEST OF INDEPENDENCE
Inference for Two Way Tables
Chapter Outline Goodness of Fit test Test of Independence.
Presentation transcript:

1 2 Test for Independence 2 Test for Independence

2 Data Types

3 Hypothesis Tests Qualitative Data

4 2 Test of Independence 2 Test of Independence 1.Shows If a Relationship Exists Between 2 Qualitative Variables, but does Not Show Causality 2.Assumptions Multinomial Experiment All Expected Counts 5 3.Uses Two-Way Contingency Table

5 2 Test of Independence Contingency Table 2 Test of Independence Contingency Table 1.Shows # Observations From 1 Sample Jointly in 2 Qualitative Variables 1.Shows # Observations From 1 Sample Jointly in 2 Qualitative Variables

6 2 Test of Independence Contingency Table 2 Test of Independence Contingency Table 1.Shows # Observations From 1 Sample Jointly in 2 Qualitative Variables Levels of variable 2 Levels of variable 1

7 2 Test of Independence Hypotheses & Statistic 2 Test of Independence Hypotheses & Statistic 1.Hypotheses H 0 : Variables Are Independent H 0 : Variables Are Independent H a : Variables Are Related (Dependent) H a : Variables Are Related (Dependent)

8 2 Test of Independence Hypotheses & Statistic 2 Test of Independence Hypotheses & Statistic 1.Hypotheses H 0 : Variables Are Independent H a : Variables Are Related (Dependent) 2.Test Statistic Observed count Expected count

9 2 Test of Independence Hypotheses & Statistic 2 Test of Independence Hypotheses & Statistic 1.Hypotheses H 0 : Variables Are Independent H a : Variables Are Related (Dependent) 2.Test Statistic Degrees of Freedom: (r - 1)(c - 1) Rows Columns Observed count Expected count

10 Expected Count Example

11 Expected Count Example Marginal probability =

12 Expected Count Example Marginal probability =

13 Expected Count Example Marginal probability = Joint probability =

14 Expected Count Example Marginal probability = Joint probability = Expected count = 160· = 54.6

15 Expected Count Calculation

16 Expected Count Calculation

17 Expected Count Calculation 112x x x x78 160

18 You randomly sample 286 sexually active individuals and collect information on their HIV status and History of STDs. At the.05 level, is there evidence of a relationship? You randomly sample 286 sexually active individuals and collect information on their HIV status and History of STDs. At the.05 level, is there evidence of a relationship? 2 Test of Independence Example on HIV 2 Test of Independence Example on HIV

19 2 Test of Independence Solution 2 Test of Independence Solution

20 2 Test of Independence Solution 2 Test of Independence Solution H 0 : H a : = = df = Critical Value(s): Test Statistic: Decision:Conclusion:

21 2 Test of Independence Solution 2 Test of Independence Solution H 0 : No Relationship H a : Relationship = = df = Critical Value(s): Test Statistic: Decision:Conclusion:

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

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

24 E(n ij ) 5 in all cells 170x x x x Test of Independence Solution 2 Test of Independence Solution

25 2 Test of Independence Solution 2 Test of Independence Solution

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

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

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

The procedure to test for the independence: 1. State a hypotheses based on the fit of the data 2. Make a table of the observed and expected values. You will most likely be given the observed values. 3. Calculate the chi-squared test statistic, this is 4. Look up the chi-squared critical value from your chi-squared tables in the information booklet. 5. Compare your test statistic with your critical value and make a conclusion. If the test statistic lies in the critical region then reject H 0 in favour of H 1. Otherwise do not reject H 0 in favour of H 1. At first glance this is similar to the goodness of fit test, but the test statistic is worked out differently.

Degrees of freedom, v. When undertaking a chi-squared test you will have a table of observed and expected values. The degrees of freedom will be defined as: v=(number of rows-1)(number of columns-1) The chi-squared distribution. The distribution will alter depending on the value of v. The general curve is shown opposite.

Example of Chi-squared independence test The headmaster of a large IB school is concerned that the maths results are dependent on the maths teacher. There are 3 SL teachers and the results for each class have been shown below. These are the observed values. Test at the 5% level of significance to see if the grades are independent of the teacher Total Mr. P Ms. Q Mrs. R Total Make your hypotheses: H 0 : the grade at maths SL is independent of the teacher. H 1 : the grade at maths SL is not independent of the teacher. Make a table of expected values. To do this take each row total x column total and divide by the grand total. This is shown opposite. This value is the expected value for this cell. Find the expected number of grade 2s that Mr. P gets. Complete a table of expected values.

Total Mr. P Ms. Q Mrs. R Total continued.... Observed Expected Total Mr. P Ms. Q Mrs. R Total Calculate the chi squared test statistic: Find the critical value from your tables. v=(7-1)(3-1)=12 Critical value = Make your conclusion: Do not reject the null hypothesis. At the 5% level of significance there is no evidence to suggest that the choice of teacher influences the grade achieved. the p value