# Doing Chi-square independence test in SPSS?

1. Nov 25, 2016

### Mathman2013

1. The problem statement, all variables and given/known data

Hi there I have problem I hope some can help me solve.

My H0, there is no connection between people who recieved the new and old medication? And them getting well or not well.

I suppose to test the following data using Chi-square test in SPSS.
$$\pmatrix{\\\textrm{"""} & \textrm{treatment} & \textrm{New-treatment} \\\textrm{well} &10 &25\\\textrm{not-well} &15 &10 }$$

I calculate my expected values by hand to be.

$$\pmatrix{\\\textrm{"""} & \textrm{treatment} & \textrm{New-treatment} \\\textrm{well} &14.58 &20.41\\\textrm{not-well} &10.42 &14.59 }$$

2. Relevant equations

3. The attempt at a solution
I calculate my expected values by hand to be.

$$\pmatrix{\\\textrm{"""} & \textrm{treatment} & \textrm{New-treatment} \\\textrm{well} &14.58 &20.41\\\textrm{not-well} &10.42 &14.59 }$$

and then my $$\chi^2 = \frac{(obs-exp)^2}{exp}=5.92$$ and with df = 1 and using a s-level of 0.05 and looking up in a chi-square table I get critical value of 3.84. And since 5.92>3.84, then my H0 fails.

But my question: How do I get a simular result in SPSS?

If I insert my data in data-mode and choose crosstabs and chi-square test, then I get a chi-value of only by my degree of freedom is correct.

So any idear? Or hints to a guide I can learn to get the proper result?

P.s. this is not homework, but for my own better understanding of SPSS.

cheers

MF

2. Nov 25, 2016

### Ray Vickson

What does the sentence "... then I get a chi-value of only by my degree of freedom is correct." I cannot figure out what you are tying to say. In plain English: what value of chi-square does SPSS produce? Do you and SPSS both use the same number of degrees of freedom?

3. Nov 25, 2016

### andrewkirk

I think it is very likely that the difference between your chi-square statistic and the one produced by SPSS is that SPSS applies Yates' Continuity Correction, which involves adjusting the residuals by an addition or subtraction of 0.5. You can read about the correction, the exact formula for the corrected statistic, and why it is done here.

I don't use SPSS, so I can't be sure what it does, but I use R, which applies the continuity correction and hence gets a different chi-square statistic from the one obtained from the standard formula you quote.

The chi-square statistic produced from your data by R, using the continuity correction, is 4.7. If that is what SPSS gives you then you can be confident that the continuity correction is the reason for the difference.