computing chi-square from existing table data

Posted by Leslie Horst on
URL: http://spssx-discussion.165.s1.nabble.com/computing-chi-square-from-existing-table-data-tp1070921.html

Suppose I have data of the following form:

freqrelate      presyears       relatecount
1               1               111
1               2               122
1               3               112
1               4               113
2               1               63
2               2               61
2               3               76
2               4               85

Freqrelate is a classification variable as is presyears - I took these
data from an existing table.  Relatecount is the cell count for each of
the cells in the 2x4 table defined by freqrelate and presyears.  I
remember once (long ago) having a similar situation and being somehow
able to use SPSS to weight by the variable with the cell frequencies in
it and get the table statistics, but I can no longer remember how.  I
took a quick look in Raynald's Tools, but didn't find anything.  How can
I do this in syntax?  Thanks in advance.

Leslie Horst, Ph.D.
Maguire Associates, Inc.
5 Concord Farms
555 Virginia Rd., Suite 201
Concord, MA 01742