Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Insert blank row in ctables

351 views
Skip to first unread message

je...@yahoo.com

unread,
Jul 19, 2007, 7:29:27 PM7/19/07
to
Hi all,

I know I'm way late to the game at custom tables, but up until a few
weeks ago I was working with SPSS v10. I'm now on v15 and finding some
of my old syntax tricks for TABLES don't work with CTABLES.

For example - I used to use the syntax below to force blank rows into
a large table with multiple variables down the side. When I convert
this syntax into CTABLES it drops my "blank" variables because CTABLES
wants to outsmart me and notes, accurately, that they are...blank. In
TABLES these would just show up as blank rows.

Is there another way to format the table so it will have blank rows
between variables? Or a way to force CTABLES to accept my dummy
variables?

Here is the syntax that worked great in TABLES:

numeric blank1 (f1.0).
var labels blank1 "" .

TABLES
/FORMAT BLANK MISSING('.')
/GBASE=CASES
/FTOTAL= $t000001 "TOTAL # RESP" $t000002 "TOTAL # RESP"
/TABLE=v1 + $t000001 + blank1 + v2 + $t000002
BY v3 + v4
/STATISTICS
cpct( v1( PCT5.0 ) '':v3 v4 )
count( $t000001( F5.0 ) "" )
cpct( blank1( PCT5.0 ) '':v3 v4 )
cpct( v2( PCT5.0 ) '':v3 v4 )
count( $t000002( F5.0 ) "" ).

peter m sopp

unread,
Jul 20, 2007, 5:25:38 AM7/20/07
to
Only a workaround: Have a look at www.spsstools.net and adapt a script
which modify a specific line in your pivot table (for instance:
MakeTotalsBoldAllPivotTables.sbs). Use the color white for your specific
variable - now you have an 'empty' line. Maybe there are better solution
(using python?) but ... ;-)
Peter


je...@yahoo.com schrieb:

JKPeck

unread,
Jul 20, 2007, 9:36:24 AM7/20/07
to

Simplifying the syntax, if your Tables command was
Tables /table = x + blank + y,

prefixed by something like
string blank(a8).
comput blank = ''.
variable label blank ' '.

you can get the same effect in Ctables via

Ctables /table x + blank + y.

However, if Ctables finds no valid categories, it does remove the
variable. You can avoid this by specifying MISSING=INCLUDE on the
CATEGORIES subcommand for the blank variable. I.e.,
/CATEGORIES blank MISSING=INCLUDE.

je...@yahoo.com

unread,
Jul 20, 2007, 12:16:28 PM7/20/07
to
Hi JK,

Thanks for that advice, I did try that before I posted. The problem
is, while it does put a blank space between the labels on the left, it
still includes the totals across the row...which defeats the purpose
since what I'm trying to do is make the table more readable by having
blank space between the total for one variable and the first figure
for the next.

In the old tables syntax this would just appear as a blank all the way
across the row.

je...@yahoo.com

unread,
Jul 20, 2007, 12:34:00 PM7/20/07
to
Hi Peter,

Okay, I haven't used scripts before, but that was easy and worked
great!

A lot of code and effort for such a simple thing in the old syntax,
but at least I can get to what I need. I have clients who are very
particular about the formatting of their tables, and this will save me
a big headache of trying to explain to them why it looks different.

Thanks!

-Selma

Ivan Moore

unread,
Aug 4, 2022, 8:50:01 PM8/4/22
to
Hi Selma,

I am looking to do the exact same thing! It's crazy that SPPS doesn't have the option of inserting blank lines and breaking up the block of percentages in the table. Absolutely no awareness that your average client looking at crosstabs has a hard enough time when they are formatted legibly.

I took a look at the script at spsstools.net and my eyes rolled back in the back of my head. Scripting is not my area of expertise. Can you share your solution?

Thanks,

Ivan
0 new messages