16
LEARNING PROGRAMME Hypothesis testing Hypothesis testing Part 2: Categorical Part 2: Categorical variables variables Intermediate Training Intermediate Training in Quantitative in Quantitative Analysis Analysis Bangkok 19-23 November 2007 Bangkok 19-23 November 2007

Hypothesis testing Part 2: Categorical variables

  • Upload
    tirza

  • View
    50

  • Download
    0

Embed Size (px)

DESCRIPTION

Hypothesis testing Part 2: Categorical variables. Intermediate Training in Quantitative Analysis Bangkok 19-23 November 2007. Topics to be covered in this presentation. Pearson’s chi square. Learning objectives. By the end of this session, the participant should be able to: - PowerPoint PPT Presentation

Citation preview

Page 1: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME

Hypothesis testingHypothesis testingPart 2: CategoricalPart 2: Categorical variables variables

Intermediate Training in Intermediate Training in Quantitative Analysis Quantitative Analysis

Bangkok 19-23 November 2007Bangkok 19-23 November 2007

Page 2: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 2

Topics to be covered in this presentation

Pearson’s chi square

Page 3: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 3

Learning objectives

By the end of this session, the participant should be able to:Conduct chi square

Page 4: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 4

Hypothesis testing for categorical variables…

We sometimes want to determine…

Whether the proportion of people with some particular outcome differ by another variable

Ex. Does the proportion of food insecure households differ in male and female headed households??

Page 5: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 5

What if we we want to test whether there is a relationship between two categorical

variables?

Pearson Chi-Square

Page 6: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 6

Pearson’s chi-square testPearson’s chi-squared test (X²) is an omnibus

test that is used to test the hypothesis that the row and the column variables of a contingency table are independent

It’s a comparison of the frequencies you observe in certain categories to the frequency you might expect to get in those categories by chance.

Page 7: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 7

Assumptions of the chi-square test

Two assumptions:

1. For the test to be meaningful it is imperative that each unit contributes to only one cell of the contingency table.

2. The expected frequencies should be greater than 5 in each cell (or the test may fail to detect a genuine effect)

Page 8: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 8

Chi square formula…

Expected

ExpectedObservedSquareChi

2)(

Page 9: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 9

Chi square example

Child Gender * underweight Crosstabulation

underweight Total

no yes

Child Gender Male Count 2086 587 2673

Expected Count 2144.6 528.4 2673

Female Count 2204 253 2674

Expected Count 2145.6 528.6 2674

Total Count 4290 1057 5347

Expected Count 4290 1057 5347

Page 10: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 10

Chi Square example…

X2= [(2086-2144.6)2/2144.6] + [(587-528.4)2/528.4] + [(2204-2145.4)2/2145.4] + [(470-528.6)2/528.6]

X2= 1.60 + 6.50 + 1.60 + 6.50

X2= 16.2 (then check x2 distribution…)

Page 11: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 11

Chi Square example… If we do it by spss, we get the same answer

Gender of child * WAZPREV Crosstabulation

2086 587 2673

2144.6 528.4 2673.0

78.0% 22.0% 100.0%

48.6% 55.5% 50.0%

2204 470 2674

2145.4 528.6 2674.0

82.4% 17.6% 100.0%

51.4% 44.5% 50.0%

4290 1057 5347

4290.0 1057.0 5347.0

80.2% 19.8% 100.0%

100.0% 100.0% 100.0%

Count

Expected Count

% within Gender of child

% within WAZPREV

Count

Expected Count

% within Gender of child

% within WAZPREV

Count

Expected Count

% within Gender of child

% within WAZPREV

Male

Female

Gender ofchild

Total

.00 1.00

WAZPREV

Total

Page 12: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 12

Chi-Square Tests

16.196b 1 .000

15.921 1 .000

16.223 1 .000

.000 .000

16.193 1 .000

5347

Pearson Chi-Square

Continuity Correction a

Likelihood Ratio

Fisher's Exact Test

Linear-by-Linear Association

N of Valid Cases

Value dfAsymp. Sig.

(2-sided)Exact Sig.(2-sided)

Exact Sig.(1-sided)

Computed only for a 2x2 tablea.

0 cells (.0%) have expected count less than 5. The minimum expected count is 528.40.b.

Page 13: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 13

To calculate chi-squares in SPSS

In SPSS, chi-square tests are run using the following steps:

1. Click on “Analyze” drop down menu2. Click on “Descriptive Statistics”3. Click on “Crosstabs…”4. Move the variables into proper boxes5. Click on “Statistics…”6. Check box beside “Chi-square”7. Click “Continue”8. Click “OK”

Page 14: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 14

Reading the Chi-square test

However, it is difficult to get an idea about the strength of that relationship

Page 15: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 15

Important Note:

If you compare two categorical variables and at least one has multiple categories, you can determine which categories are different from one another by running a Z-test under “Custom Tables”

This is rather complicated so we will not discuss in detail

Page 16: Hypothesis testing Part 2: Categorical  variables

LEARNING PROGRAMME - 16

Now…..exercise!!!!