Date: Thu, 27 Apr 2006 11:55:30 -0500
Reply-To: "Peck, Jon" <peck@spss.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Peck, Jon" <peck@spss.com>
Subject: Re: Custom tables with top/bottom, mean and std info
Content-Type: text/plain; charset="UTF-8"
Caveat: I haven't read through all this thread carefully.
But Ctables has the ability to create subtotals and the ability to hide the categories that are subtotaled as well as the ability to exclude categories explicitly, so by using these features, you should be able to come pretty close to the desired table without constructing other variables. The Ctables dialog supports all these features.
Regards,
Jon Peck
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Hector Maletta
Sent: Thursday, April 27, 2006 10:06 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: [SPSSX-L] Custom tables with top/bottom, mean and std info
It is all possible with CTABLES or TABLES. However, for the subtotals (top2,
top3 and bottom2) you want to create separate variables. For instance:
COMPUTE TOP2=(VARX=1 OR VARX=2).
COMPUTE TOP3=(VARX=1 OR VARX=2 OR VARX=3).
COMPUTE BOTTOM2=(VARX=4 OR VARX=5).
MISSING VALUES VARX TOP2 TOP3 BOTTOM3 (0, 6 THRU HIGHEST).
TABLES /PTOTAL=TOTAL
/TABLE TOTAL+VARX+TOP2+TOP3+BOTTOM2 BY (STATISTICS)
/STAT VALIDN (VARX TOP2 TOP3 BOTTOM2)
CPCT (VARX (PCT7.2) TOP2 (PCT7.2) TOP3 (PCT7.2) BOTTOM2 (PCT7.2)).
TABLES /PTOTAL=TOTAL
/OBS VARX TOP2 TOP3 BOTTOM2
/TABLE TOTAL+VARX+TOP2+TOP3+BOTTOM2 BY (STATISTICS)
/STATS MEAN (VARX (F5.2) TOP2 (F5.2) TOP3 (F5.2) BOTTOM2 (F5.2))
STDDEV (VARX (F5.2) TOP2 (F5.2) TOP3 (F5.2) BOTTOM2 (F5.2)).
MISSING VALUES VARX TOP2 TOP3 BOTTOM3 ().
TABLES /PTOTAL=TOTAL
/TABLE TOTAL+VARX BY (STATISTICS)
/STAT VALIDN CPCT (VARX (PCT7.2)).
I excluded the additional variables in this table for missing values, for
they do not have any user missing value.
I have not tested it but should work.
This is for only one variable (VARX). You can include as many as needed. If
they are too many you may want to use some LOOP structure to create the
additional variables for all of them, but beware of tables that become too
large.
Hector
-----Mensaje original-----
De: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] En nombre de Andy
Devos (Gent)
Enviado el: Thursday, April 27, 2006 10:50 AM
Para: SPSSX-L@LISTSERV.UGA.EDU
Asunto: Custom tables with top/bottom, mean and std info
Dear all,
Is it possible to produce a table for categorical variables (rating 1
till 5) in Spss containing the following info:
- rating counts and percentages,
- top2 box (2 highest ratings as subtotal), top3 and bottom2
- mean and standard deviation
- count and percentages of user-missings (not necessarily in the same
table) - may not count for the calculation of mean/stddev
No problem each one of those separately by ctables, but to combine it?
E.g. top2 and top3 can not be calculated together cause there exists
overlap between these subtotals
Also mean and stddev can not be calculated for single nominal
variables, which is the case here.
Redefining the measurement scale does not help either, as the
top/bottom2 calculation requires that.
So any idea how to overcome this efficiently?
ctables
/TABLE q1 [count colpct ] BY total+ ps6 + ps7 + anti_cat + agegroup +
descrip
/categories variables= q1 [1,2,Subtotal='Bottom2',3,4,5,Subtotal='Top3']
total=yes empty=include
/slabels position=row visible=yes
.
ctables
/TABLE q1 [count colpct ] BY total+ ps6 + ps7 + anti_cat +
agegroup + descrip
/categories variables= q1[1,2,3,Subtotal='Top2',4,5] total=yes
empty=include position=before
/slabels position=row visible=yes
.
ctables
/TABLE q1 [totals[mean f5.2 stddev f5.2] ] BY total+ ps6 + ps7 +
anti_cat + agegroup + descrip
/categories variables= q1[1,2,3,4,5] total=yes empty=include
/slabels position=row visible=yes
.
ctables
/TABLE q1 [count colpct ] BY total+ ps6 + ps7 + anti_cat + agegroup
+ descrip
/categories variables= q1 [8,9] total=yes empty=include
/slabels position=row visible=yes
Thanks a lot
Andy