How to do a two way Chi-squared analysis from inputting aggregated frequency counts directly into SPSS
Here is a fictitious dataset describing the incidence of a certain type of brain-damage within a population subdivided by age.
|
Brain-damaged |
Normal |
Young |
23 |
12 |
Old |
13 |
11 |
Input the row and column categories and counts.
Enter these into an SPSS DATA sheet with variables (columns) named:
damaged (coded Brain-damaged = 1 or Normal = 2),
agegroup (coded Young = 1 or Old = 2), and
count.
damaged |
agegroup |
count |
1 |
1 |
23 |
2 |
1 |
12 |
1 |
2 |
13 |
2 |
2 |
11 |
Now 'weight' the data.Click on DATA on menu then click on WEIGHT CASES, click on WEIGHT CASES BY and then put the counts column into the frequency variable box.
Click on OK.
Now analyze the data.Click on ANALYZE:DESCRIPTIVE STATISTICS:CROSSTABS.
Place one categorical variable in the row window and the other in the column window using the arrow buttons (order not important).
Click on STATISTICS then on CHI-SQUARE then click CONTINUE.
Click on OK.
The output should now contain the results of a chi-square analysis.
Chi-square(1)=0.80, (two-sided) p=0.37 so conclude no relationship between age and amount of brain damage.
Here is the syntax corresponding to the above:
WEIGHT BY count . CROSSTABS /TABLES=damaged BY agegroup /FORMAT= AVALUE TABLES /STATISTIC=CHISQ /CELLS= COUNT .
* An example where the table rows have identical totals
[Last updated 21 January, 2011]
Return to Statistics main page
These pages are maintained by Ian Nimmo-Smith and Peter Watson