2 table problems

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

2 table problems

Mike1972
Hello I have 2 questions.
I am using macros to create tables (see below).

Question no-1: I have tried to create the same table look with macro for CTables
but I can't get it working (the n=) appears in a column next to the % instead under the table.

Question no-2: I have tried to get the 2 rows below (% and n=) to get bold with SPSSinc Modify Tables
but only the columns male , female etc. I am able to get bold.
Does anyone have a solution for this.

It will make me very happy!

Kind regards,
Michel

*******************************************.
comp total=1.
var lab total 'Total'.
val lab total
1 ''.

DEFINE singresp (!POS !CHAREND('/')).
!DO !i !IN ( !1).
        TABLES
          /FORMAT BLANK MISSING('.')
          /GBASE=CASES
          /FTOTAL= $t1 "Totaal"
          /TABLE=!i + $t1  BY Total + V2 + V3
          /STATISTICS
                cpct( !i( F5.1 ) ' ':Total V2 V3)
                cpct( $t1( F5.1 ) '%':Total V2 V3)
                cases( $t1( F5.0 ) 'n=')
!DOEND.
!ENDDEFINE.

singresp v1/.      -> will create a table as below.

********************************************************.

                                            GENDER                  EDUCATION
                      Total          male      female    Lower     Middle     Higher
score item-1
             1         10,0          33,3                   50,0
             2         20,0          33,3      14,3                    25,0        25,0
             3         10,0                      14,3                                 25,0
             4         10,0                      14,3                    25,0
             5         20,0                      28,6                    25,0       25,0
             6         10,0                      14,3                                 25,0
             7         20,0          33,3      14,3       50,0       25,0
Totaal    %       100,0        100,0     100,0     100,0      100,0      100,0    -> BOLD?
            n=           10             3           7           2            4            4    -> BOLD

*********************************************************.