14.03.2015 Views

Behavioural Surveillance Surveys - The Wisdom of Whores

Behavioural Surveillance Surveys - The Wisdom of Whores

Behavioural Surveillance Surveys - The Wisdom of Whores

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

EXAMPLE : CALCULATING THE CHI-SQUARE STATISTIC BY HAND<br />

<strong>The</strong> following illustrates a step-by-step process <strong>of</strong> calculating the chi-square statistic : Set up the<br />

explanatory variable in columns, and the outcome variable in rows. <strong>The</strong>n calculate the row and<br />

the column totals. Next, calculate the expected number <strong>of</strong> observations for each cell if there<br />

were no difference in distribution according to the explanatory variable (i.e., if the null<br />

hypothesis were true). Do this as follows :<br />

Table <strong>of</strong> observed numbers<br />

<strong>The</strong> expected number = row total * column total<br />

overall total N<br />

Chi-square is calculated by comparing the numbers actually observed with those expected<br />

if there were no difference in distribution according to the explanatory variable. For every cell <strong>of</strong><br />

the table, calculate the difference between the expected and observed values (and square it to get<br />

rid <strong>of</strong> any negatives) and then divide it by the expected value. Now add together the result <strong>of</strong> that<br />

calculation for every cell <strong>of</strong> the table. <strong>The</strong> result is the chi-square value. In other words<br />

χ 2 = SUM (observed - expected) 2<br />

expected<br />

Once the χ 2 value has been calculated, it can be compared with the Chi-square Table to determine<br />

whether there is indeed a statistically significant association between the explanatory and the<br />

outcome variables. Notice that the table uses the term degrees <strong>of</strong> freedom. <strong>The</strong> statistical<br />

significance <strong>of</strong> χ 2 depends on how many categories there are in both the explanatory and the<br />

outcome variables. <strong>The</strong> degrees <strong>of</strong> freedom (DF) can be calculated easily by looking at the table<br />

laying out the variables, as follows :<br />

DF = (number <strong>of</strong> rows - 1) * (number <strong>of</strong> columns - 1)<br />

<strong>The</strong> steps below refer to the example provided in Chapter 7 <strong>of</strong> the analysis <strong>of</strong> the number <strong>of</strong><br />

non-regular sex partners by age group.<br />

Step 1 : Set up the explanatory variable in columns, and the outcome variable in rows. <strong>The</strong>n<br />

calculate the row and the column totals.<br />

0 1 2 3+ Totals<br />

< 20 years 12 4 6 9 31<br />

20 - 24 87 36 21 27 171<br />

25 - 29 75 29 11 18 133<br />

30+ 177 26 11 13 227<br />

Totals 351 95 49 67 562<br />

348<br />

A PPEN DI X 5 B EHAV I OR A L SURV EI L L A NC E S U R V EY S

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!