SPSS Statistics

 View Only
Expand all | Collapse all

Is there a way to hide a value in Custom Tables in SPSS?

  • 1.  Is there a way to hide a value in Custom Tables in SPSS?

    Posted Thu September 30, 2021 09:09 AM

    I am using the the coffee.sav dataset, this is the syntax to recreate where i am currently at.

    Recode brand (1=1) (ELSE=0) into AA.
    exe.
    
    Var lab AA 'Brand AA'.
    Val lab AA     0'0' 
                        1'AA'.
    
    * Custom Tables.
    CTABLES
      /VLABELS VARIABLES=image AA DISPLAY=DEFAULT
      /TABLE image [C] BY AA [C][ROWPCT.COUNT PCT40.1]
      /CATEGORIES VARIABLES=image AA ORDER=A KEY=VALUE EMPTY=INCLUDE
      /CRITERIA CILEVEL=95.
    
    * Custom Tables.
    CTABLES
      /VLABELS VARIABLES=image brand DISPLAY=DEFAULT
      /TABLE image BY brand [ROWPCT.COUNT PCT40.1]
      /CATEGORIES VARIABLES=image brand ORDER=A KEY=VALUE EMPTY=INCLUDE
      /CRITERIA CILEVEL=95.
    

    I want to be able to easily hide a value from my output, for example: Hide 0 in variable AA but it still counting in the calculation.

    Or in the second table hide values CC and DD but still receive the same percentages.

    Is there an easy way to do this directly in the custom table?



    ------------------------------
    Joachim Mohn Raanaas
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Is there a way to hide a value in Custom Tables in SPSS?

    IBM Champion
    Posted Thu September 30, 2021 09:27 AM
    Edited by System Fri January 20, 2023 04:23 PM
    There are several ways to go about this.  I take it that you want to hide the entire 0 column in the table.
    One way is to create the table as you are doing and then activate it in the pivot table editor and use the pivot trays to move A to the layer.  Then select the other column in the layer so that it is on top.   You can then print or export it just printing the top layer.
    Another way to do this without manually editing the table is to use the SPSSINC MODIFY TABLES extension command, which you can install via the Extensions > Extension Hub menu.  Then, after creating the table, use syntax like this to hide the first, i.e., zeroth, column
    SPSSINC MODIFY TABLES subtype="customtable" SELECT=0 
    DIMENSION= COLUMNS LEVEL = -1  SIGLEVELS=BOTH 
    PROCESS = PRECEDING HIDE=TRUE 
    /STYLES  APPLYTO=BOTH.
    The select here refers to column order, but you can also select based on column label values.
    MODIFY TABLES appears on the Utilities menu as Modify Table Appearance after it is installed.
    --