Date: Thu, 16 Sep 2010 09:42:50 -0400
Reply-To: Gene Maguin <emaguin@buffalo.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Gene Maguin <emaguin@buffalo.edu>
Subject: Re: table in SPSS 18
In-Reply-To: <4C909016.4FF1.0045.1@iris.jde.aca.mmu.ac.uk>
Content-Type: text/plain; charset="us-ascii"
Hi Philip,
Perhaps you have already figured out how to do this or got a good answer
from somebody else but if not this command sequence produces your desired
output given the example dataset following.
variable level present(scale).
ctables /table sex > age by cholesterol by present [SUM totaln]/
SLABELS POSITION=ROW.
A key element is that present be declared to be 'scale'. Note also that
present is coded 0 or 1.
data list / id 1-2 sex 4 age 6 cholesterol 8 present 10.
begin data
01 1 1 1 0
02 1 2 1 0
03 2 1 1 0
04 2 2 1 0
05 1 1 2 0
06 1 2 2 0
07 2 1 2 0
08 2 2 2 0
09 1 1 3 0
10 1 2 3 0
11 2 1 3 0
12 2 2 3 0
13 1 1 4 0
14 1 2 4 0
15 2 1 4 0
16 2 2 4 0
17 1 1 1 1
18 1 2 1 1
19 2 1 1 1
20 2 2 1 1
21 1 1 2 1
22 1 2 2 1
23 2 1 2 1
24 2 2 2 1
25 1 1 3 1
26 1 2 3 1
27 2 1 3 1
28 2 2 3 1
29 1 1 4 1
30 1 2 4 1
31 2 1 4 1
32 2 2 4 1
end data.
Gene Maguin
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Philip Sinclair
Sent: Wednesday, September 15, 2010 4:21 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: table in SPSS 18
Dear List,
I have a table showing the number of patients with heart disease present
given factors,
sex (1,2), age (1,2) and cholestrol level (1,2,3,4).
It is 4x4 with number of 'success' and trials in each cell, i.e also can be
viewed as 8x4
table, and I hope the table is clearly reproduced below. The question is,
how can I get
such a table as output from SPSS 18?
Cholestrol
SEX AGE 1 2 3 4
1 1 present 13 18 40 57
N 340 408 421 362
2 present 13 33 35 49
N 123 176 174 183
2 1 present 6 5 10 18
N 542 552 412 357
2 present 9 12 21 48
N 58 135 218 395
Best regards,
Dr Philip A. Sinclair
Dept. of Computing and Mathematics,
Manchester Metropolitan University,
Manchester M1 5GD.
Tel 0161 247 1663
Before acting on this email or opening any attachments
you should read the Manchester Metropolitan University's
email disclaimer available on its website
http://www.mmu.ac.uk/emaildisclaimer
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD