Section 5

Page 1

Section 5

Chi-Squared

Learning Outcomes At the end of this session, you should be able to: 

Understand the rationale for the use of chisquared

Understand the basic conditions and criteria involved in the use of chi-squared

Apply the procedure for calculating chi-squared statistics both manually and in SPSS

Interpret manually derived and computer generated SPSS chi-squared output



Chi-Squared

Data Analysis for Research

5.0

Introduction Chi-squared (χ2) is primarily employed to test a null hypothesis of ‘no difference’ between samples of frequency measurements. The method is used widely in the fields of Business and Management and is often employed in questionnaire analysis. In many ways it is the most flexible of such tests as:

It can be applied to frequency data on any originally collected scale of measurement (nominal, ordinal or interval) provided that the data are grouped into independent and mutually-exclusive categories.

It may be used to test a null hypothesis of ‘no difference’ for any number of samples.

The chi-squared test involves computing a calculated χ2 statistic and comparing this with an appropriate tabulated χ2 statistic (or critical χ2 value) to test a null hypothesis of ‘no difference’ at a selected significance level. Although considered less powerful than other tests, this is compensated for by its simple data requirements. Both ordinal and ratio scale data can be converted into nominal form, although such categorisation can often cause a loss of detail.

The chi-squared test requires that data be in the form of contingency tables, which are simply data matrices showing the frequency of observations in different categories (h) for one or more samples (k). The following are three examples of contingency tables. Table 5.1:

Categories of residence sampled in terms of the age of the resident

Sample

a

b

Category

Age: 20-29

30-39

Owner-occupied Rented Council housing Other No. of categories (h) = 4

18 31 24 17

42 29 41 4

c 40 and over 28 12 35 1

No. of samples (k) = 3

Note: Measurement scale: nominal

© Dr Andrew Clegg

p. 5-167


Chi-Squared

Data Analysis for Research

Table 5.2:

Typical questionnaire responses Category

Strongly Agree

Agree

Niether Agree or Disagree

Disagree

Strongly Disagree

Frequency

8

11

6

19

12

No. of categories (h) = 5

No. of samples (k) = 1

Note: Measurement scale: ordinal

Table 5.3:

Total dissolved solids in groundwater, sampled by rock type A Granite (n=30)

Categories (Concentration in mgl-1) 0-19 20-39 40-59 60-79 80-99 100-119

No. of categories (h) = 6

B Basalt (n=30)

3 12 10 4 1 0

1 9 11 8 3 1

No. of samples (k) = 2

Note: Measurement scale: interval The calculated χ2 statistic compares the observed frequency (O) for each category and every sample against an expected frequency (E) using the general formula:

χ = 2

(O − E) 2 E

In the above equation the observed frequencies (O) are those that we measure, (i.e. those that appear in the contingency tables). The expected frequencies (E) for each category are defined by our hypothesis. The null hypothesis of ‘no difference’ often involves testing for departure from a uniform distribution in the case of the single sample test. This means that the expected value for each category is identical and equal to n/h. The chi-squared test can also be used to establish differences from a theoretical distribution, such as the normal distribution. © Dr Andrew Clegg

p. 5-168


Chi-Squared

Data Analysis for Research

Although the χ2 test is primarily employed as a one-tailed test of the significance of differences, it may also be employed to establish the significance of similarities between samples. Most of the χ2 tables contain not only the usual values at the lower end of the significance scale for testing differences but also values at the upper end of this scale for testing similarity. If we wish to establish similarity of two or more samples, then our calculated χ2 statistic must be less than, for example, the appropriate figure for the 95% significance level if we are to accept the null hypothesis of ‘no difference’ at this level.

5.1

The One-Sample Chi-Squared Test The one-sample test is normally used to test the significance of differences between categories of a single sample. Consider the following example.

The frequency of rock falls from a popular cliff face in Snowdonia is recorded for two weeks in the summer, autumn, winter and spring by the local mountain rescue. The results are recorded in Table 5.4. Table 5.4:

Rockfall frequency Sampling Period

Summer

Autumn

Winter

Spring

Frequency of Rockfalls

17

14

10

23

h=4

n=64

If there were no differences in the frequency of rockfalls in each season, then we would expect an equal frequency of rockfalls in each season. Basically, the expected frequency for each category would be:

E=

n 64 = = 16 h 4

As with any test, we must first formalise the null and alternative hypotheses. In this case:

H0: There is no difference in the frequency of rock falls between seasons H1: The frequency of rock falls is significantly greater in some seasons than in others

© Dr Andrew Clegg

p. 5-169


Chi-Squared

Data Analysis for Research

The calculated χ2 statistic can now be computed as follows:

χ = 2

Table 5.5:

(O − E) 2 E

Rockfall frequency: the calculation of the χ2 statistic Category

O

E

(O-E)

(O-E)2

Summer Autumn Winter Spring

17 14 10 23

16 16 16 16

1 -2 -6 7

1 4 36 49

χ2 =

(O − E) 2 E

0.0625 0.2500 2.2500 3.0625

(O − E) 2 = 5.6250 E

The degrees of freedom (v) for this one-sample chi-square test is:

V=h-1 which in this case equals: V=h-1 = 4-1 = 3 The calculated χ2 statistic is then compared with a tabulated χ2 statistic at a selected significance level (see Table 5.6). To reject the null hypothesis, the calculated χ2 must exceed the tabulated χ2. At the 0.05 significance level, the tabulated χ2 statistic with three degrees of freedom is 7.82. As the calculated value is less than the tabulated value we cannot reject the null hypothesis of ‘no difference’ at the 0.05 significance level and conclude that there is no significant difference in the frequency of rock falls between the different seasons.

© Dr Andrew Clegg

p. 5-170


Chi-Squared

Data Analysis for Research

Table 5.6:

Critical Values of Chi-square 95%

Š Dr Andrew Clegg

99%

p. 5-171


Chi-Squared

Data Analysis for Research

5.2

The Chi-Squared Test for Two or More Samples The chi-square test can also be used to test the differences or similarities between two or more samples, though it is always used as a test of difference. The procedure is similar to that for the one sample test, except that the calculation of the expected frequencies (E) is slightly more complex. Consider the following example.

A researcher in Ghana studying the distribution of malaria outbreaks among international tourists obtains the following results from a sample of 100 tourists who stayed in hotels on the river flood plain, and from 200 tourists who stayed in hotels on a plateau above the river. The results are recorded in Table 5.7. Table 5.7:

The incidence of malaria outbreaks in Ghana Category

Infected

Not Infected

20 25

80 175

Sample Flood plain (n=100) Plateau (n=200)

In this case we have two samples (k=2) and two categories (h=2). The researcher wishes to establish whether the two samples differ significantly in terms of the incidence of infection. The expected frequencies (E) are thus those that would be expected if there were indeed ‘no differences’ between the plateau and the flood plain in terms of incidence of infection. The expected frequencies are calculated for each observation using the following formula:

E=

Column total x Row total Overall total

Or alternatively using notation in a contingency table format: Table 5.7a:

Calculation of expected values Category

Infected

Not Infected

Row Total

Sample Flood plain (expected) Plateau (expected) Column Totals

© Dr Andrew Clegg

Cell A= (N1 x T1)/T Cell B=(N1 x T2)/T N1

Cell C= (N2 x T1)/T Cell D= (N2 x T2)/T

T1 T2

N2

T

p. 5-172


Chi-Squared

Data Analysis for Research

Therefore in the case of the malaria outbreaks, the expected values are calculated in the following manner: Table 5.7b:

Calculation of expected values Category

Infected

Not Infected

Row Total

Sample Flood plain (observed) Plateau (observed)

20 25

80 175

100 200

Column Totals

45

255

300

Not Infected

Row Total

Hence the expected values are: Table 5.7c:

Calculation of expected values cont.. Category

Infected

Sample Flood plain (expected) Plateau (expected)

15 (45*100)/300 30 (45*200)/300

85 170

Column Totals

45

255

(255*100)/300 (255*200)/300

100 200 300

Note that the row and column totals for the expected values are identical to those for the observed values. The χ2 statistic is now calculated in the following manner: Table 5.8:

Calculation of the χ2 statistic (O − E) 2 E

Category

O

E

(O-E)

(O-E)2

Flood plain Infected Not Infected

20 80

15 85

5 -5

25 25

1.667 0.294

Plateau Infected Not Infected

25 175

30 170

-5 5

25 25

0.833 0.147

Total

300

300

© Dr Andrew Clegg

2.941

p. 5-173


Chi-Squared

Data Analysis for Research

When the chi-squared test is used to test two or more samples, the number of degrees of freedom is given by: V = (h-1)(k-1) In this case: V = (h-1)(k-1) = (2-1)(2-1) =1

Formally, the test of a null hypothesis of ‘no difference’ is as follows: H0: There is no difference between the incidence of infection on the flood plain and that on the plateau H1: There is a significant difference between the incidence of infection on the flood plain and that on the plateau

The calculated χ2 statistic is then compared with a tabulated χ2 statistic at a selected significance level. The tabulated value at the 0.1 significance level with 1 degree of freedom is 2.71 (see Table 1.6). As the calculated χ2 statistic (2.941) exceeds the tabulated χ2 statistic we can reject the null hypothesis at the 0.1 significance level. In practical terms this means that on the basis of the evidence of the chi-square test, it is extremely unlikely that the observed difference between rates of infection is due only to chance in the sampling process and instead reflects a ‘real’ difference between the rates of iinfection on the flood plain and plateau.

Notice that the larger the test statistic, the stronger the evidence of association will be. This is not surprising because the test statistic, χ2 , is based on differences between the actual, or observed frequencies and those we would expect if there were no association. If there were association then we would anticipate large differences between observed and expected frequencies. If there were no association we would expect small differences.

In the above example, if a higher significance level had been chosen, say 0.05, then the calculated χ2 statistic (2.941) would have been less than the tabulated χ2 statistic ( 3.84) and so the null hypothesis could not have been rejected. This situation raises the issue of subjectivity and that in order to reject a null hypothesis a researcher may well be tempted to choose a lower significance level. The safest rule is to choose a significance level before the test is carried out and stick to it.

© Dr Andrew Clegg

p. 5-174


Chi-Squared

Data Analysis for Research

5.3

Yates Correction Factor When using a χ2 test with one degree of freedom, as in the previous example, it is necessary to make a slight adjustment to the calculations. The adjustment consists of either adding or subtracting 0.5 to the value of each (O-E) before squaring it. The rule for deciding whether to add or subtract the 0.5 is: a) If (O-E) is negative then add; b) If (O-E) is positive then subtract

It is probably more easily remembered by noting that addition or subtraction should be performed with a view to making the value of χ2 smaller. The effect of the Yates correction can be highlighted with reference to a new version of Table 5.9 which has been appropriately adjusted using the Yates correction factor.

Table 5.9:

Calculation of the χ2 statistic with Yates Correction (O-E)

(O-E)2

(O − E) 2 E

Category

O

E

Flood plain Infected Not Infected

20 80

15 85

5-0.5 (4.5) -5+0.5 (-4.5)

25 (20.25) 25 (20.25)

1.667 (1.35) 0.294 (0.24)

Plateau Infected Not Infected

25 175

30 170

-5+0.5 (-4.4) 5-0.5 (4.5)

25 (20.25) 25 (20.25)

0.833 (0.675) 0.147 (0.119)

Total

300

300

2.941 (2.384)

The effect of the Yates correction is to introduce greater accuracy into the calculation and evaluation of the χ2 statistic. In this case, the Yates correction has reduced the value of the calculated χ2 statistic to the extent that is no longer exceeds the value of the tabulated value of χ2 with one degree of freedom. As such the null hypothesis can no longer be rejected and the researcher would have to conclude that there is no significant difference between the incidence of river blindness on the flood plain and the plateau.

© Dr Andrew Clegg

p. 5-175


Data Analysis for Research

5.4

Chi-Squared

Conditions Necessary for Conducting a Chi-squared Test When using chi-square a number of guidelines must be remembered: 

Contingency tables must consist of at least two categories;

Where there are only two categories, the expected frequency in each category must not be less than 5;

Where there are more than two categories, no category should have an expected frequency of less than 1 and not more than one category in five should have an expected frequency of less than five;

Data must be in the form of frequencies (i.e. counted data in categories). The χ2 statistic is best suited to comparing frequencies within nominal categories. It can also be applied to higher order levels of measurement if data are grouped into categories prior to analysis. These tests are not applicable to interval scale data;

No cell is allowed to have an expected frequency of less than 1. This requirement can sometimes be met through the amalgamation of rows and columns (i.e. fewer cells with more observations in each). However be careful as the regrouping of data can lead to a loss of information and the subtle differences between two data sets being obscured. Therefore regrouping should be avoided if at all possible and thus larger sample sizes are recommended . In addition, the way that categories are constructed may determine whether or nor significant associations are detected;

Samples are assumed to be independent (not applicable to dependent variables);

Random sampling is assumed (other sampling procedures can be considered as long as they are proved to be unbiased);

Data samples must be discrete and unambiguous;

Frequencies must be absolute and not percentages of proportional values;

Question of ‘tailedness’ of the alternative hypothesis does not arise in the context of the chi-square tests. Because of the manner of its execution the direction of departure is immaterial.

© Dr Andrew Clegg

p. 5-176


Chi-Squared

Data Analysis for Research

ď €

Activity 22: From an examination of destination preferences for second homes it appears that coastal counties of England and Wales are perceived as being more desirable holiday locations than inland counties. The results are summarised below. Residential Desirability Location Low Preference

High Preference

Total

Coastal Counties

5

14

19

Inland Counties

19

15

34

Total

24

29

53

Of the 19 coastal counties, 14 have preference scores of more than 30 and only 5 have preference scores of 30 or less. Of the 34 inland counties, 15 have high preference scores and 19 have low scores. Use the chi-square test to decide whether there is in fact a significant difference at the 0.05 level between coastal and inland counties in terms of their destination desirability. Report your final result below:

Š Dr Andrew Clegg

p. 5-177


Data Analysis for Research

ď €

Chi-Squared

Activity 23: In a survey commissioned by a TV travel program, 135 people were asked what their favourite foreign holiday destination was. Some of the results are summarised in the contingency table below:

Use these sample results to test for association between gender and destination preference, using a 95% confidence level. When calculating the expected frequencies, check if the data meets the requirements of the chi-square test. How can you re-categorise the data to make it meet the criteria for the chi-squared test? Report your final result below:

Š Dr Andrew Clegg

p. 5-178


Chi-Squared

Data Analysis for Research

Activity 24: Company managers at Butlins are investigating the relationship between job satisfaction and the levels of absenteeism in the firm. They believe that satisfied individuals are less likely to be absent from work than those who are not satisfied. The results from a survey of 30 workers are displayed in a contingency table below. Job Satisfaction Absenteeism Dissatisfied

Happy

Total

Absent from work

4

11

15

Not absent from work

10

5

15

Total

14

16

30

Calculate the value of χ2 for the difference between the observed and expected numbers. Is this difference significant at the 0.05 level? Record your final result below:

© Dr Andrew Clegg

p. 5-179


Chi-Squared

Data Analysis for Research

5.5

Using SPSS to Calculate Chi-Squared Having considered how to calculate chi-square manually, the aim of the following section is to highlight how to calculate chi-square values using SPSS.

To start, we will repeat Exercise 3 relating to job satisfaction levels at Butlins. Load the ‘Butlins1’ exercise file into SPSS.

Label the columns and values as you have done in previous sessions.

Subject 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Job Satis 1 1 2 1 2 2 1 1 2 1 2 2 2 2 2 1 1 2 1 2 2 1 2 2 1 1 1 2 1 1

Absent 2 1 1 1 1 1 2 2 2 2 2 1 1 2 1 2 1 2 2 1 2 2 1 1 2 1 2 1 2 2

To perform a chi-squared test in SPSS, move the mouse over Analyse and press the left mouse button. Move the mouse over Descriptive Statistics and then Crosstabs.

simulation © Dr Andrew Clegg

p. 5-180


Chi-Squared

Data Analysis for Research

The Crosstabs dialog box appears.

Move the mouse over Jobsatis and press the left mouse button. Press the top arrow button so that Jobsatis is selected in the Row(s): box. Move the mouse over Absent and press the left mouse button. Press the middle arrow button so that Absent is selected in the Column(s) box.

Move the mouse over Statistics and press the left mouse button. The Crosstabs: Statistics dialog box appears.

Select the chi-square option and then press Continue.

Š Dr Andrew Clegg

p. 5-181


Data Analysis for Research

Chi-Squared

This takes you back to the Crosstabs dialog box. Move the mouse over Cells and press the left mouse button. The Crosstabs: Cell display dialog box appears. Make sure that Observed and Expected counts are selected and then press Continue. This will take you back to the initial Crosstabs dialog box.

Press OK and SPSS will automatically calculate the chi-square statistics and display the results in the output window. The output window will display a contingency table and the following output.

Š Dr Andrew Clegg

p. 5-182


Data Analysis for Research

Chi-Squared

How do these results compare to your manual output ? Well, first of all you should notice that the Pearson chi-square result gives you the χ2 statistic prior to revision by the Yates Correction (4.82). Second, the Continuity Correction chisquare gives you the χ2 statistic as adjusted by the Yates Correction (3.34).

But, from the SPSS output how do you infer the significance level ?

Although the output looks daunting the answer is quite simple. In the output below, the significance value (Asymp. Sig. (two -tailed)) for the corrected χ2 statistic is .067. This value is greater than 0.05 which means it is not significant at the 0.05 confidence level. This can also be reported as p>0.05 ( not significant). Notice however, that the value is less than 0.1, which means it is significant at the 0.1 significance level , which can alternatively be recorded as p<0.1 (significant). Basically, these are the same results as you should have calculated manually.

© Dr Andrew Clegg

p. 5-183


Chi-Squared

Data Analysis for Research

Remember: 

if the significance value (p) is <0.1 then the value is significant at the 0.1 significance level (90%)

if the significance value (p) is <0.05 then the value is significant athe 0.05 significance level (95%)

if the significance value (p) is <0.01 then the value is significant at the 0.01 significance level (99%).

Remember however, that you should not switch between significance levels so that the null hypothesis can be rejected. The safest rule is to pick a significance level before you start and stick with it all the way through the test.

Accurately Reporting the Outcomes of the Chi-Square Test

When reporting the chi-square result a number of key elements must be included: 

Specify suitable hypotheses. In this case: H0: There is no significant difference between job satisfaction and levels of absenteeism H1: There is a significant difference between job satisfaction and levels of absenteeism

The test statistic. Therefore in your write-up you must include what χ2 equals. In this example χ2 = 3.34.

The degrees of freedom. This is the number of rows minus 1, times the number of columns minus 1. This value is actually given in the SPSS output. The value for degrees of freedom is placed between the χ2 and the = sign and placed in brackets. In this example the degrees of freedom = 1, therefore χ2 (1) = 3.34.

As part of the report you must also state the probability. As highlighted above this is done in relation to whether your probability value was below 0.05 and 0.01 (and therefore significant) or above 0.05 (and therefore not significant). Here, you use the less than (<) or greater than (>) the criteria level. You state this criteria by stating whether p<0.05 (significant), p<0.01 (significant) or p>0.05 (not significant). Assuming a 95% confidence level in the above example, as p=0.67, we would write p>0.05 and place this after the reporting of the χ2 value. Therefore χ2 (1) = 3.34, p (0.067)>0.05.

© Dr Andrew Clegg

p. 5-184


Chi-Squared

Data Analysis for Research

These elements must be incorporated into your text to ensure that your results are presented succintly but effectively. You can also include a table. Therefore using the findings above we could report the following.

Table 1: Job Satisfaction v Job Absenteeism

Category

Job Satisfaction Happy Dissatisifed

Totals

Absenteeism Yes (observed) % of Total

4 13%

11 37%

15 50%

No (observed) % of Total

10 33%

5 17%

15 50%

Totals

14

16

30

‘Table 1 shows a breakdown of the distribution of respondents in terms of levels of job satisfaction and levels of absenteeism (with percentages in brackets). A chi-squared was used to determine whether there was a significant difference between the two variables. A null hypothesis of no signifcanrt difference and an alternative hypothesis of a significant difference were established, and a 95% confidence level was assumed. No significant difference was found between job satisfaction and absenteeism (χ2 (1) = 3.34, p (0.067)>0.05). The null of hypothesis of no significant difference can therefore not be rejected.’ Note if we had assumed a 90% confidence level from the start we would write: ‘Table 1 shows a breakdown of the distribution of respondents in terms of levels of job satisfaction and levels of absenteeism (with percentages in brackets). A chi-squared was used to determine whether there was a significant difference between the two variables. A null hypothesis of no significant difference and an alternative hypothesis of a significant difference were established, and a 90% confidence level was assumed. A significant difference was found between job satisfaction and absenteeism (χ2 (1) = 3.34, p (0.067)<0.1). The null hypothesis of no significant difference can therefore be rejected.’

© Dr Andrew Clegg

p. 5-185


Chi-Squared

Data Analysis for Research

Activity 25: Load the ‘Chi Square Exercises file’ file into SPSS. This file contains the data relating to the two additional practical exercises that you completed by hand. Perform two chi-squares tests and compare your output back to your manual calculations. Note that the Excel file contains two spreadsheets that you will need to access. Import into SPSS the normal way but select the spreadsheet you wish to use from the Opening Excel Data Source dialog box (as below). Record the results in your log book.

simulation

The following coding schemes have been used: Residential Desirability: Area: Coastal =1; Inland =2; Score: High = 1; Low =2 TV Survey:

© Dr Andrew Clegg

Gender: Female =1; Male = 2; Location: Greece = 1; Spain = 2; Thailand = 3; Turkey = 4; USA =5 Regroup: Europe = 1; Asia = 2; USA = 3

p. 5-186


Chi-Squared

Data Analysis for Research

Activity 26:

© Dr Andrew Clegg

Referring to the variables in the Dataset file, identify a series of relationships that could be examined using the chi-squared test. Remember you need to focus on category/nominal data for this exercise.

p. 5-187


Data Analysis for Research

Chi-Squared

Activity 27: Using the Dataset file conduct 3 appropriate chi-squared tests. Please complete the following tables, making clear reference to the SPSS output. For each test, identify a research scenario that you are using the test to explore.

Table 28: Chi-Squared 1 Chi-Squared Test

Research Scenario

Row Variable Column Variable Null Hypothesis

Alternative Hypothesis Comment on the SPSS Output

Table 29: Chi-Squared 2 Chi-Squared Test

Research Scenario

Row Variable Column Variable Null Hypothesis

Alternative Hypothesis Comment on the SPSS Output

© Dr Andrew Clegg

p. 5-188


Data Analysis for Research

Chi-Squared

Activity 27: Using the Dataset file conduct 3 appropriate chi-squared tests. Please complete the following tables, making clear reference to the SPSS output. For each test, identify a research scenario that you are using the test to explore.

Table 30: Chi-Squared 3 Chi-Squared Test

Research Scenario

Row Variable Column Variable Null Hypothesis

Alternative Hypothesis Comment on the SPSS Output

© Dr Andrew Clegg

p. 5-189


Data Analysis for Research

Chi-Squared

Notes:

Š Dr Andrew Clegg

p. 5-190


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.