SPSS Statistics

 View Only
  • 1.  Hide Columns using SPSS MODIFY TABLES

    Posted Fri June 02, 2023 06:23 PM
    Edited by David Dwyer Fri June 02, 2023 06:35 PM

    Hi

    I am using SPSSINC MODIFY TABLES  to hide the columns with the label 'Count' in Custom Tables. I know that I can remove them in Ctables script but I need them so I can have the Pearson table.

    My Ctable syntax (using Macros) is as follows:

    define !MyCtabMacro (!pos=!cmdend)
    !do !onevar !in(!1)
       CTABLES
       /VLABELS VARIABLES=!onevar mohafaza
    caza
    village
    A03
    NewAge
    A05
    A06
    Votingdistrict
    A08
    A09
    A10
    A11
    HoH
    A12
    A13
    A14
    A1501
    A1502
    A1503
    A1504
    A1505
    A1506
    DISPLAY=LABEL
       /TABLE  (mohafaza [c] + caza[c] + village [c]+A03[c]+ NewAge[c]+A05[C] +  A06[C] +Votingdistrict[c] +A08[c] + A09[c] +A10[c] + A11[c] + HoH[c]+A12[c] + A13[c]+
     Income[c] + A1501[c] + A1502[c] + A1503 + A1504[c] + A1505[c]+ A1506[c]) [COUNT F40.0, ROWPCT.VALIDN PCT40.1] by !onevar [C]
     /CATEGORIES VARIABLES=mohafaza
    caza
    village
    A03
    NewAge
    A05
    A06
    Votingdistrict
    A08
    A09
    A10
    A11
    HoH
    A12
    A13
    Income
    A1501
    A1502
    A1503
    A1504
    A1505
    A1506
    !onevar  ORDER=A KEY=VALUE EMPTY=EXCLUDE Total=NO POSITION=After
      /SIGTEST TYPE=CHISQUARE ALPHA=0.05 INCLUDEMRSETS=YES CATEGORIES=ALLVISIBLE.
    EXECUTE.
       filter off. 
    !doend
    !enddefine.
    
    !MyCtabMacro B1701
    B1702
    B1703
    B1704
    B1705
    B1706
    B1708
    B1709
    B17a
    B17b

    The output is like that:

    Original Output

    I then use the SPSS Modify Table:

    SPSSINC MODIFY TABLES subtype="'Custom Table'"
    SELECT='Count' 
    DIMENSION= COLUMNS LEVEL = -1  SIGLEVELS=BOTH 
    PROCESS = ALL HIDE=TRUE 
    /STYLES  APPLYTO=DATACELLS.

    However, now the tables are missing all the titles and they are messed up like the below:

    My questions are: is there anything that can be done? and my second question, can "Row Valid N %" Label be changed to "Percent"?

    Thanks

    Edit: My second question was easily resolved by adding 'Percent' to [COUNT F40.0, ROWPCT.VALIDN 'Percent' PCT40.1]

    ------------------------------
    Wael Kassem
    ------------------------------



  • 2.  RE: Hide Columns using SPSS MODIFY TABLES

    Posted Fri June 02, 2023 06:34 PM
      |   view attached

    Hi @Wael Kassem 

    I'm not sure what to tell you.  The example table you gave has preceding totals in the Rows and Columns.  The command syntax you gave does not create preceding totals. 
     /CATEGORIES VARIABLES= <your variable list> !onevar  ORDER=A KEY=VALUE EMPTY=EXCLUDE Total=NO POSITION=After
     

    What else is different about your replication scenario?

    In answer to your second question... Yes, simply change the label in your CTABLES command syntax:

     /TABLE  (<Long list of stacked variables>) [COUNT F40.0, ROWPCT.VALIDN PCT40.1] by !onevar [C]

    becomes

     /TABLE (<Long list of stacked variables>) [COUNT F40.0, ROWPCT.VALIDN ' Percent' PCT40.1] by !onevar [C]

    You seem to be on the right track.  Here is an example that creates its own data and runs your command syntax as you indicated you wanted it.  It then runs SPSSINC MODIFY TABLES.




    ------------------------------
    David Dwyer
    SPSS Technical Support
    IBM Software
    ------------------------------

    Attachment(s)

    zip
    community.sps.zip   811 B 1 version


  • 3.  RE: Hide Columns using SPSS MODIFY TABLES

    IBM Champion
    Posted Fri June 02, 2023 06:40 PM
    If you can send me an spv file containing the table, I'll figure this out (jkpeck@gmail.com).  Also, what version of Statistics are you using?

    --





  • 4.  RE: Hide Columns using SPSS MODIFY TABLES

    Posted Sat June 03, 2023 03:38 AM
    Edited by Wael Kassem Sat June 03, 2023 03:44 AM

    Using Statistics v25.

    I sent the spv file to your email


    ------------------------------
    Wael Kassem
    ------------------------------