Week 6: Chi-squared tests - PowerPoint PPT Presentation

About This Presentation
Title:

Week 6: Chi-squared tests

Description:

... from this survey that drinking habits are related to the age of the drinker. ... few heavy drinkers in the oldest age group and fewer than expected in the 45 to ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 31
Provided by: computings48
Category:
Tags: chi | drinker | squared | tests | week

less

Transcript and Presenter's Notes

Title: Week 6: Chi-squared tests


1
Week 6 Chi-squared tests
  • Learning outcomes
  • use a chi-squared test to determine whether two
    traits are independent

2
Frequency table
3
Contingency table 2 way
4
Contingency table 2 way
5
Question
  • Are the proportions of males having each of the
    qualifications the same as the corresponding
    proportions for females?
  • Males 15 A-level, 61 higher, 24 other
  • Females 17, 62, 21
  • Are qualifications independent of gender?
  • For this example the answer is yes.

6
Mendels peas experiment
7
Chi-squared test for independence
  • Null hypothesis the attribute smooth or
    wrinkled is independent of whether the pea is
    green or yellow.
  • Alternative hypothesis the proportion which are
    smooth depends on the colour of the pea.

8
Expected frequencies
  • If the null hypothesis is true then the
    proportion of smooth peas is
  • 423/556
  • regardless of the colour of the pea

9
Expected number green and smooth
Therefore the expected number green and smooth is
this proportion of the number of green peas
10
In the same way
Yellow and smooth
Green and wrinkled
Green and smooth
11
Observed/Expected frequencies
12
Observed/Expected frequencies
13
Formula
  • The expected values in each row and column add up
    to the corresponding marginal total.
  • Therefore, in a 2x2 table, once one expected
    value is calculated the rest can be obtained by
    subtraction.
  • A 2x2 contingency table as 1 degree of freedom.

14
Chi-squared test for a 2x2 table
To compare the observed and expected frequencies
  • follows a chi-squared distribution with 1 degree
    of freedom.

15
Peas example
16
conclusion
  • Since the value of chi-squared is low
  • observed frequencies are close to expected
    frequencies
  • the null hypothesis can be accepted
  • there is no evidence of an association between
    colour and texture

17
Using tables
  • Using a 5 significance level with 1 degree of
    freedom the null hypothesis would be rejected if

18
Note
  • The chi-squared test is only valid if the
    expected frequencies are greater than 5.
  • The degrees of freedom for a table with r rows
    and c columns are
  • (r - 1) x ( c - 1)

19
Age and drinking categories of a sample of males
20
Expected frequencies
21
Chi-squared statistic
  • Degrees of freedom (3 - 1) x (5 - 1) 8
  • Value from tables for a 5 significance level is
    15.51.

22
Conclusions
  • The value of chi-squared is large therefore
  • There is very convincing evidence from this
    survey that drinking habits are related to the
    age of the drinker.
  • A comparison of the observed values with the
    expected values in the table shows that there are
    very few heavy drinkers in the oldest age group
    and fewer than expected in the 45 to 54 years age
    group.

23
SPSS
  • The original form of the data will be a row for
    each individual e.g.
  • Units Age
  • 1 4
  • 2 3
  • 1 1
  • SPSS does two things
  • Creates the contingency table
  • Carries out a chi-squared test on the table.

24
AnalysegtDescriptive StatisticsgtCrosstabs
Select Statistics and Chi-square Select Cells
and Expected
25
Contingency Table
26
Chi-squared test
27
Goodness of fit tests
28
Expected frequencies
29
Chi-squared test
  • follows a chi-squared distribution with d.f.
  • number of categories - 1

30
Result
  • Since chi-squared is small (lt the appropriate
    value from the tables with 3 degrees of freedom)
    the theoretical model is a good fit to the data.
Write a Comment
User Comments (0)
About PowerShow.com