How to do a two way Chisquared analysis from inputting aggregated frequency counts directly into SPSS
Here is a fictitious dataset describing the incidence of a certain type of braindamage within a population subdivided by age.

Braindamaged 
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 Braindamaged = 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 CHISQUARE then click CONTINUE.
Click on OK.
The output should now contain the results of a chisquare analysis.
Chisquare(1)=0.80, (twosided) 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 NimmoSmith and Peter Watson