<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>FAQ/ChiSquaredSpss</title><revhistory><revision><revnumber>13</revnumber><date>2013-03-08 10:17:55</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>12</revnumber><date>2011-01-21 12:04:16</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>11</revnumber><date>2011-01-21 12:02:27</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>10</revnumber><date>2011-01-21 10:37:24</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>9</revnumber><date>2011-01-21 10:36:35</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>8</revnumber><date>2011-01-21 10:36:11</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>7</revnumber><date>2011-01-21 10:33:07</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>6</revnumber><date>2010-03-18 11:55:55</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>5</revnumber><date>2006-08-03 09:29:54</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>4</revnumber><date>2006-08-03 09:25:33</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>3</revnumber><date>2006-08-03 09:25:04</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>2</revnumber><date>2006-06-30 23:08:23</date><authorinitials>Scripting Subsystem</authorinitials></revision><revision><revnumber>1</revnumber><date>2006-06-30 23:02:00</date><authorinitials>Scripting Subsystem</authorinitials></revision></revhistory></articleinfo><section><title>How to do a two way Chi-squared analysis from inputting aggregated frequency counts directly into SPSS</title><para>Here is a fictitious dataset describing the incidence of a certain type of brain-damage within a population subdivided by age. </para><informaltable><tgroup cols="3"><colspec colname="col_0" colwidth="17*"/><colspec colname="col_1" colwidth="38*"/><colspec colname="col_2" colwidth="45*"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"/><entry colsep="1" rowsep="1"><para>Brain-damaged</para></entry><entry colsep="1" rowsep="1"><para>Normal</para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>Young</para></entry><entry colsep="1" rowsep="1"><para>23</para></entry><entry colsep="1" rowsep="1"><para>12</para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>Old</para></entry><entry colsep="1" rowsep="1"><para>13</para></entry><entry colsep="1" rowsep="1"><para>11</para></entry></row></tbody></tgroup></informaltable><para><emphasis role="strong">Input the row and column categories and counts.</emphasis> </para><para>Enter these into an SPSS DATA sheet with variables (columns) named: </para><itemizedlist><listitem><para><emphasis><emphasis role="strong">damaged</emphasis></emphasis> (coded Brain-damaged = 1 or Normal = 2)<emphasis><emphasis role="strong">,</emphasis></emphasis> </para></listitem><listitem><para><emphasis><emphasis role="strong">agegroup</emphasis></emphasis> (coded Young = 1 or Old = 2), and </para></listitem><listitem><para><emphasis><emphasis role="strong">count.</emphasis></emphasis> </para></listitem></itemizedlist><informaltable><tgroup cols="3"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para>damaged</para></entry><entry colsep="1" rowsep="1"><para>agegroup</para></entry><entry colsep="1" rowsep="1"><para>count</para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>1</para></entry><entry colsep="1" rowsep="1"><para>1</para></entry><entry colsep="1" rowsep="1"><para>23</para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>2</para></entry><entry colsep="1" rowsep="1"><para>1</para></entry><entry colsep="1" rowsep="1"><para>12</para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>1</para></entry><entry colsep="1" rowsep="1"><para>2</para></entry><entry colsep="1" rowsep="1"><para>13</para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>2</para></entry><entry colsep="1" rowsep="1"><para>2</para></entry><entry colsep="1" rowsep="1"><para>11</para></entry></row></tbody></tgroup></informaltable><para><emphasis role="strong">Now 'weight' the data.</emphasis>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. </para><para>Click on OK. </para><para><emphasis role="strong">Now analyze the data.</emphasis>Click on ANALYZE:DESCRIPTIVE STATISTICS:CROSSTABS. </para><para>Place one categorical variable in the row window and the other in the column window using the arrow buttons (order not important). </para><para>Click on STATISTICS then on CHI-SQUARE then click CONTINUE. </para><para>Click on OK. </para><para>The output should now contain the results of a chi-square analysis. </para><para><emphasis>Chi-square(1)=0.80, (two-sided) p=0.37 so conclude no relationship between age and amount of brain damage.</emphasis> </para><para><emphasis role="strong">Here is the syntax corresponding to the above:</emphasis> </para><screen><![CDATA[WEIGHT BY count .
CROSSTABS
/TABLES=damaged BY agegroup
/FORMAT= AVALUE TABLES
/STATISTIC=CHISQ
/CELLS= COUNT .]]></screen><para>* <ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/FAQ/ChiSquaredSpss/statswiki/FAQ/eqtots#">An example where the table rows have identical totals</ulink> </para><para>[Last updated 21 January, 2011] </para><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/FAQ/ChiSquaredSpss/statswiki/FAQ#">Return to Statistics FAQ page</ulink> </para><para><ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/FAQ/ChiSquaredSpss/statswiki/CbuStatistics#">Return to Statistics main page</ulink> </para><para><ulink url="http://www.mrc-cbu.cam.ac.uk/">Return to CBU main page</ulink> </para><para>These pages are maintained by <ulink url="mailto:ian.nimmo-smith@mrc-cbu.cam.ac.uk">Ian Nimmo-Smith</ulink> and <ulink url="mailto:peter.watson@mrc-cbu.cam.ac.uk">Peter Watson</ulink> </para></section></article>