1 The  2 test Sections 19.1 and 19.2 of Howell This section actually includes 2 totally separate tests goodness-of-fit test contingency table analysis.

Slides:



Advertisements
Similar presentations
Chapter 11 Other Chi-Squared Tests
Advertisements

CHI-SQUARE(X2) DISTRIBUTION
Finish Anova And then Chi- Square. Fcrit Table A-5: 4 pages of values Left-hand column: df denominator df for MSW = n-k where k is the number of groups.
Chi Square Example A researcher wants to determine if there is a relationship between gender and the type of training received. The gender question is.
The Chi-Square Test for Association
Hypothesis Testing IV Chi Square.
Statistical Inference for Frequency Data Chapter 16.
© 2010 Pearson Prentice Hall. All rights reserved The Chi-Square Test of Independence.
1-1 Copyright © 2015, 2010, 2007 Pearson Education, Inc. Chapter 25, Slide 1 Chapter 25 Comparing Counts.
PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010.
CJ 526 Statistical Analysis in Criminal Justice
Crosstabs and Chi Squares Computer Applications in Psychology.
Crosstabs. When to Use Crosstabs as a Bivariate Data Analysis Technique For examining the relationship of two CATEGORIC variables  For example, do men.
Presentation 12 Chi-Square test.
Chapter 11(1e), Ch. 10 (2/3e) Hypothesis Testing Using the Chi Square ( χ 2 ) Distribution.
Hypothesis Testing IV (Chi Square)
Psy B07 Chapter 1Slide 1 ANALYSIS OF VARIANCE. Psy B07 Chapter 1Slide 2 t-test refresher  In chapter 7 we talked about analyses that could be conducted.
1 Psych 5500/6500 Chi-Square (Part Two) Test for Association Fall, 2008.
Phi Coefficient Example A researcher wishes to determine if a significant relationship exists between the gender of the worker and if they experience pain.
CJ 526 Statistical Analysis in Criminal Justice
Statistical Significance R.Raveendran. Heart rate (bpm) Mean ± SEM n In men ± In women ± The difference between means.
Chi-square (χ 2 ) Fenster Chi-Square Chi-Square χ 2 Chi-Square χ 2 Tests of Statistical Significance for Nominal Level Data (Note: can also be used for.
Chapter 9: Non-parametric Tests n Parametric vs Non-parametric n Chi-Square –1 way –2 way.
Copyright © 2012 by Nelson Education Limited. Chapter 10 Hypothesis Testing IV: Chi Square 10-1.
Chapter 11 Hypothesis Testing IV (Chi Square). Chapter Outline  Introduction  Bivariate Tables  The Logic of Chi Square  The Computation of Chi Square.
Chapter 12 A Primer for Inferential Statistics What Does Statistically Significant Mean? It’s the probability that an observed difference or association.
Chi-Square X 2. Parking lot exercise Graph the distribution of car values for each parking lot Fill in the frequency and percentage tables.
Review of the Basic Logic of NHST Significance tests are used to accept or reject the null hypothesis. This is done by studying the sampling distribution.
Slide 26-1 Copyright © 2004 Pearson Education, Inc.
Learning Objectives Copyright © 2002 South-Western/Thomson Learning Statistical Testing of Differences CHAPTER fifteen.
CHI-SQUARE x 2. Chi Square Symbolized by Greek x 2 pronounced “Ki square” a Test of STATISTICAL SIGNIFICANCE for TABLE data “What are the ODDs the relationship.
Section 10.2 Independence. Section 10.2 Objectives Use a chi-square distribution to test whether two variables are independent Use a contingency table.
Reasoning in Psychology Using Statistics Psychology
Section 12.2: Tests for Homogeneity and Independence in a Two-Way Table.
ContentFurther guidance  Hypothesis testing involves making a conjecture (assumption) about some facet of our world, collecting data from a sample,
Chapter 15 The Chi-Square Statistic: Tests for Goodness of Fit and Independence PowerPoint Lecture Slides Essentials of Statistics for the Behavioral.
Chi-Square X 2. Review: the “null” hypothesis Inferential statistics are used to test hypotheses Whenever we use inferential statistics the “null hypothesis”
The Analysis of Variance ANOVA
Chi Square & Correlation
Chi-Square Analyses.
Outline of Today’s Discussion 1.The Chi-Square Test of Independence 2.The Chi-Square Test of Goodness of Fit.
Chi-Square X 2. Review: the “null” hypothesis Inferential statistics are used to test hypotheses Whenever we use inferential statistics the “null hypothesis”
Chi Squared Statistical test used to see if the results of an experiment support a theory or to check that categorical data is independent of each other.
Bullied as a child? Are you tall or short? 6’ 4” 5’ 10” 4’ 2’ 4”
Chapter 14 – 1 Chi-Square Chi-Square as a Statistical Test Statistical Independence Hypothesis Testing with Chi-Square The Assumptions Stating the Research.
Significance Tests for Regression Analysis. A. Testing the Significance of Regression Models The first important significance test is for the regression.
T-tests Chi-square Seminar 7. The previous week… We examined the z-test and one-sample t-test. Psychologists seldom use them, but they are useful to understand.
Section 10.2 Objectives Use a contingency table to find expected frequencies Use a chi-square distribution to test whether two variables are independent.
I. ANOVA revisited & reviewed
Geog4B The Chi Square Test.
Chapter 9: Non-parametric Tests
Presentation 12 Chi-Square test.
Extra Brownie Points! Lottery To Win: choose the 5 winnings numbers from 1 to 49 AND Choose the "Powerball" number from 1 to 42 What is the probability.
Chi-Square X2.
Hypothesis Testing Review
Qualitative data – tests of association
Hypothesis Testing Using the Chi Square (χ2) Distribution
The Chi-Square Distribution and Test for Independence
Is a persons’ size related to if they were bullied
Consider this table: The Χ2 Test of Independence
Is a persons’ size related to if they were bullied
Reasoning in Psychology Using Statistics
Hypothesis Testing and Comparing Two Proportions
Statistical Inference about Regression
The 2 (chi-squared) test for independence
Hypothesis Testing - Chi Square
Contingency Tables (cross tabs)
CHI SQUARE (χ2) Dangerous Curves Ahead!.
What is Chi-Square and its used in Hypothesis? Kinza malik 1.
Presentation transcript:

1 The  2 test Sections 19.1 and 19.2 of Howell This section actually includes 2 totally separate tests goodness-of-fit test contingency table analysis Each has its own point, and requires different things Only thing in common - same formula Keep them separate in your mind!

2 Return to hypothesis testing We can test statistical significance, no prob need p and alpha (and a computer) Sometimes, no computer available can use tables to test statistical significance Little more work, but works just as well This method uses the same logic as the p value method

3 Testing Ho without a PC The strategy (new stuff is underlined) Step1: Set up Ho, Ha and decide on alpha Step 2: Calculate the statistic and df Step 3: Get the critical value from the table Step 4: Compare critical value to statistic

4 Step 1 Set up Ho and alpha - already know Ha - the alternative hypothesis If Ho is false, what do we believe then? (Ha) Ha represents the opposite of Ho eg. if Ho: r = 0 then Ha: r  0 If we reject Ho (because its false), then we must accept Ha as being true.

5 Step 2 Nothing different use appropriate formulas for stat and df!

6 Step 3 Get the critical value from the table (back of Howell) Use alpha and df to look it up Critical value: the value of your statistic at which p = alpha (the edge of the rejection region)

7 Step 4 Compare your stat to the crit value: Ignore any minuses (look only at value) If your calculated stat is more than the crit value, then p < alpha (ie. significance!) The test is significant if calculated value is greater than the crit value Reject the Ho, and accept the Ha. Pretty easy!

8 Example Lets use an r value: We get r = 0.61 with df = 10, alpha = 0.05 Is this significant? Critical value: use df and alpha on table D2 in Howell (significant values of the correlation coefficient) for alpha = 0.05 and df = 10, crit value = 0.576

9 Example Now we have the calculated value and crit value Calculated = 0.61 Critical = Check: if calculated > critical, reject Ho 0.61 > 0.576, so we reject Ho The result is statistically significant!

10 Return to  2 Note:  2 only works with discrete data What is the point of  2 ? Goodness-of-fit: Used to see if data matches a hypothetical distribution Are there the same number of men as women? Are about 25% of South Africans unemployed? Contingency table analysis (independence test): used as a correlation for discrete data (are the variables related?)

11 Goodness-of-fit  2 Used to test a model distribution of data Have an idea of how data should be distributed eg. There should be 60% brunettes, 40% blondes Collect data, check to see if our idea (model) is supported by the data Does the data fit the model? Before starting a goodness-of-fit test, always be sure of what the model is

12 Creating a model We put our expectations as percentages on a table One cell of the table for each possible value of the variable Each cell has the percentage of observations we expect

13 Example model We expect 40% brunettes, 60% blondes, so BlondesBrunettes 60% 40%

14 Observed scores and Expected scores Strategy: Want to see if our observation matches our model We collect some data (Observed scores) We work out what the data would look like if our model were correct (Expected scores) Compare the two: do the observed scores show the same pattern as the expected scores?

15 Converting the model to expected scores We have our model as percentages We must now convert % to actual values (frequencies) - use n (number of observations) If we collected 134 observations, then BlondesBrunettes 60%40% BlondesBrunettes (60/100) x 134 = 80.4 (40/100) x 134 = 53.6

16 Converting % to frequency To do this: (percentage / 100) x n Keep the decimals! You cannot work with % for  2 - you must have frequencies (number of observations)

17 Beginning the  2 analysis To begin, need Ho For,  2 it is always “observed data = expected data” Need to state the model (in %) Collect the data Create an expected freq table (using your model and n) Calculate  2 to see if the observed = expected

18  2 Formula O = observed score E = expected score

19  2 formula, step by step Step 1: for each subject, that subject’s O minus that subject’s E Step 2: for each subject, square the step 1s. Step 3: for each subject, take their step2, and divide it by that subject’s E Step 4: sum all the step 3’s

20 Table method for  2 Use the following columns: O EO-E(O-E) 2 (O-E) 2 E Add up here

21 Degrees of freedom (df) The df for goodness-of-fit tests is easy to calculate: df = k-1 k is the number of possible values for your variable (categories) using males and females k = 2 using coke, pepsi, sprite k = 3 using easy, moderate, hard, awesome k =4

22 Worked example 1 We suspect that there is a 50%/50% gender distribution at UCT. We observed 147 people, 68 male, 79 female. Do we really have a 50%/50% distribution? Set up (step 1) Ho: Distribution is 50%/50% Ha: Distribution is not 50%/50% alpha = 0.05

23 Example: work out expected scores (What would we have seen if Ho were true?) Model: Males 50% Females 50% Convert to scores n = 147 Males expected: (50/100) x 147 = 73.5 Females expected: (50 / 100) x 147 = 73.5

24 Example: O and E values Now we have our values OEO-E(O-E)2 Value E Male Female

25 Example OEO-E(O-E)2 Value E Male Female Work out the columns

26 Example OEO-E(O-E)2 Value E Male Female Add up the values in the last column

27 Example - df Now we have our  2 value: Is it statistically significant? (does the model explain the population?) Need the critical value for this! Degrees of freedom: k-1 2 categories (male, female) so df = 1

28 Example: critical value What is the critical value for our male/female example? Df: k = 2 (male and female), so df = 1 For df = 1 and alpha = 0.05, the table says: crit = 3.84 To be significant, our value must be more that 3.84

29 Example: conclusions Calculated < critical (0.823 < 3.84), so the Ho is true (this means: it is true that “distribution is 50%/50%) Conclusion: it seems that at UCT there are as many males as there are females.

30 Interpreting  2 findings  2 findings are interpreted a little differently False Ho (significance) means we cannot accept the model (the model is wrong for this population) True Ho (non-significance) means we must assume that the model applies to this population This is the case for goodness-of-fit tests

31 Contingency table analysis with  2 Pearson’s product moment allowed us to establish a relationship between 2 continuous variables doesn’t work for discrete data (categories) Eg. “is there are relationship between gender and owning a dog or cat?” (2 discrete variables) Contingency table analysis is used for this can work with nominal variables

32 Something old, something new Quite similar to goodness-of-fit tests Work out the expected values Use the chi square formula Work out df get a critical value from the table Differences: Slightly different O table New way of working out expected values New way of working out df

33 Observed values For each person, we ask 2 questions (2 vars) “are you male/female” and “do you have a dog or a cat”(let’s assume we sample only pet owners) We end up with: SubjectGenderPet 1MD 2MC 3FDetc.

34 O table We need to convert those data into a frequency table that looks like: MaleFemale Dog Cat GENDER PET

35 Filling in the O table Each cell has only one number in it number of people fitting that condition MaleFemale Dog Cat GENDER PET In cell 1: number of people who are Male AND have a dog In cell 2: number of people who are Female AND have a dog In cell 3: number of people who are Male AND have a cat etc

36 The finished O table An o table usually looks like: MaleFemale Dog Cat GENDER PET We had 7 males with cats We had 34 females with dogs This table is a 2x2 table - 2 rows (pet) and 2 columns (gender)

37 Notes about O tables The numbers inside the cells are frequencies (just like goodness-of-fit) You can have as many levels of a variable as you like eg. dog, cat, parakeet, moose, hamster, other (6 levels) BUT you can only have 2 variables eg. not gender, pet AND car type

38 E values Expected values are a bit more tricky We want to finish with an E table, of the same form as the O table MaleFemale Dog Cat Expected Need to calculate a value for each cell we will use the O values to do this

39 Step 1: work out the grand total from the O table (N) Step 2: work out the marginal totals from the O table Step 3: use a formula (R i C j /N) to get a value for each cell of the E table E values, step by step

40 Step 1: Grand total (N) How many people did we use? Same idea as the usual n called capital N (for some reason) To calculate: Add up all the numbers in each of the cells So in the gender/pet example: N is = 109 N = 109

41 Step 2: Marginal totals We can work out the total of the margins of the O table MaleFemale Dog Cat O The marginal totals are written on the edges of the o table

42 Step 2: Calculating marginals For each marginal, add up the numbers in that line, so: MaleFemale Dog Cat O = = = = 66 Do the rows AND the columns!

43 Step 3: Work out E table Write your marginals around your blank E table - in the right places! MaleFemale Dog Cat E We will now use the marginals to compute one E value for each cell The formula for E: E = R i x C j N

44 Step 3: Work out a single cell For each cell, look at the cell’s row and column marginal (R i and C j ) MaleFemale Dog Cat E R = 70 C = 43 For Male/Dog Ri = 70 Cj = 43 The formula for E: E = 70 x = Do the same for each cell

45 Ready to calculate  2 Now we have O and E, ready to calculate  2 (using the same formula as before) MaleFemale Dog Cat OE

46 Calculate  2 This is almost the same as for goodness-of- fit, but be careful in building your table (the O and the E columns) OEO-E(O-E)2 E

47 Matching up the O and E columns Be careful!! Each type of response has an O and an E - match up the correct ones! Male/Cat has O = 7 and E = Female/Dog has O=34 and E = If you get the wrong E for an O, all your results are wrong!! Do it slowly.

48 Working out the table Step 1: O-E (go row by row, slowly) OEO-E(O-E)2 E

49 Working out the table Step 2: square the differences OEO-E(O-E)2 E

50 Working out the table Step 3: divide the squares by E OEO-E(O-E)2 E

51 Working out the table Step 4: sum the divisions to get chi squared OEO-E(O-E)2 E

52 Df for contingency tables Need to check the statistical significance of out chi value! Use df and alpha (exactly as in goodness-of- fit) df = (R-1)(C-1) number of rows-1 x number of columns-1 In our example, R = 2 (2 rows) and C = 2 (2 columns) (2-1)(2-1) = (1)(1) = 1 df = 1

53 Testing significance Look up the critical value in the chi square table using alpha and df if your calculated chi square is more than thew critical, then there is a relationship between the variables remember that Ho is “no relationship” if it is significant, then Ho is false - the si a relationship

54 Example: conclusion We calculated  2 to be df = 1, alpha set to 0.05 Crit value = 3.84 Calc > crit, so reject Ho There is a relationship between gender and pet ownership!