MODIFY TABLES question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MODIFY TABLES question

Mario Giesel

Hello, SPSS friends,
 
I repeat my question as no solution was posted so far:
I experimented a bit with ex post table modification via SPSSINC MODIFY TABLES (SPSS V21).
Here's what I did:
 
* =================================================.
DATA LIST FREE (' ') / bought1 bought2 gender.
BEGIN DATA
1 1 1
1 0 1
1 1 2
1 0 2
9 1 2
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2" / gender "Gender".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received' / gender 1 "Male" 2 "Female".
MISSING VALUES bought1 bought2 (9).
CTABLES
  /VLABELS VARIABLES=bought1 bought2 DISPLAY=DEFAULT
  /TABLE (bought1  + bought2)[COUNT F40.0, ROWPCT.COUNT F40.1] BY gender
  /CLABELS ROWLABELS=OPPOSITE
  /CATEGORIES VARIABLES=bought1 bought2 ORDER=A KEY=VALUE EMPTY=INCLUDE MISSING=EXCLUDE.
* Color definition works.
SPSSINC MODIFY TABLES SUBTYPE="*"
SELECT = ["No"] DIMENSION=COLUMNS LEVEL = -2 PROCESS = ALL
/STYLES BACKGROUNDCOLOR=0 191 255.
* Hiding not.
SPSSINC MODIFY TABLES SUBTYPE="*"
SELECT = ["No"] DIMENSION=COLUMNS LEVEL = -2 HIDE = TRUE PROCESS = ALL.
* =================================================.
 
My goal is to remove redundant "No" categories from the table.
I succeed to color them. However, hiding them doesn't work.
Is there a way to do that also?
 
Thanks for any help,
  Mario
Mario Giesel
Munich, Germany
Reply | Threaded
Open this post in threaded view
|

Re: MODIFY TABLES question

Jon K Peck
Hiding has to be applied at the innermost label level due to the hierarchical structure of tables.  Since the innermost labels repeat, and you only want to hide instances based on values at an outer level, you need to make the selection using the column numbers.  This code would work with your example.

SPSSINC MODIFY TABLES subtype="*"
SELECT=0 1 4 5
DIMENSION= COLUMNS
LEVEL = -1  PROCESS = PRECEDING HIDE=TRUE.

HTH,

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Mario Giesel <[hidden email]>
To:        [hidden email],
Date:        11/21/2013 12:33 AM
Subject:        [SPSSX-L] MODIFY TABLES question
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hello, SPSS friends,
 
I repeat my question as no solution was posted so far:
I experimented a bit with ex post table modification via SPSSINC MODIFY TABLES (SPSS V21).
Here's what I did:
 
* =================================================.
DATA LIST FREE (' ') / bought1 bought2 gender.
BEGIN DATA
1 1 1
1 0 1
1 1 2
1 0 2
9 1 2
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2" / gender "Gender".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received' / gender 1 "Male" 2 "Female".
MISSING VALUES bought1 bought2 (9).

CTABLES
 /VLABELS VARIABLES=bought1 bought2 DISPLAY=DEFAULT
 /TABLE (bought1  + bought2)[COUNT F40.0, ROWPCT.COUNT F40.1] BY gender
 /CLABELS ROWLABELS=OPPOSITE
 /CATEGORIES VARIABLES=bought1 bought2 ORDER=A KEY=VALUE EMPTY=INCLUDE MISSING=EXCLUDE.

* Color definition works.
SPSSINC MODIFY TABLES SUBTYPE="*"
SELECT = ["No"] DIMENSION=COLUMNS LEVEL = -2 PROCESS = ALL
/STYLES BACKGROUNDCOLOR=0 191 255.

* Hiding not.
SPSSINC MODIFY TABLES SUBTYPE="*"
SELECT = ["No"] DIMENSION=COLUMNS LEVEL = -2 HIDE = TRUE PROCESS = ALL.

* =================================================.
 
My goal is to remove redundant "No" categories from the table.
I succeed to color them. However, hiding them doesn't work.
Is there a way to do that also?
 
Thanks for any help,
  Mario
Reply | Threaded
Open this post in threaded view
|

Re: MODIFY TABLES question

Mario Giesel
Okay, That helps, Jon.
Thanks a lot,
  Mario


Jon K Peck <[hidden email]> schrieb am 16:55 Donnerstag, 21.November 2013:
Hiding has to be applied at the innermost label level due to the hierarchical structure of tables.  Since the innermost labels repeat, and you only want to hide instances based on values at an outer level, you need to make the selection using the column numbers.  This code would work with your example.

SPSSINC MODIFY TABLES subtype="*"
SELECT=0 1 4 5
DIMENSION= COLUMNS
LEVEL = -1  PROCESS = PRECEDING HIDE=TRUE.

HTH,

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Mario Giesel <[hidden email]>
To:        [hidden email],
Date:        11/21/2013 12:33 AM
Subject:        [SPSSX-L] MODIFY TABLES question
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hello, SPSS friends,
 
I repeat my question as no solution was posted so far:
I experimented a bit with ex post table modification via SPSSINC MODIFY TABLES (SPSS V21).
Here's what I did:
 
* =================================================.
DATA LIST FREE (' ') / bought1 bought2 gender.
BEGIN DATA
1 1 1
1 0 1
1 1 2
1 0 2
9 1 2
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2" / gender "Gender".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received' / gender 1 "Male" 2 "Female".
MISSING VALUES bought1 bought2 (9).

CTABLES
 /VLABELS VARIABLES=bought1 bought2 DISPLAY=DEFAULT
 /TABLE (bought1  + bought2)[COUNT F40.0, ROWPCT.COUNT F40.1] BY gender
 /CLABELS ROWLABELS=OPPOSITE
 /CATEGORIES VARIABLES=bought1 bought2 ORDER=A KEY=VALUE EMPTY=INCLUDE MISSING=EXCLUDE.

* Color definition works.
SPSSINC MODIFY TABLES SUBTYPE="*"
SELECT = ["No"] DIMENSION=COLUMNS LEVEL = -2 PROCESS = ALL
/STYLES BACKGROUNDCOLOR=0 191 255.

* Hiding not.
SPSSINC MODIFY TABLES SUBTYPE="*"
SELECT = ["No"] DIMENSION=COLUMNS LEVEL = -2 HIDE = TRUE PROCESS = ALL.

* =================================================.
 
My goal is to remove redundant "No" categories from the table.
I succeed to color them. However, hiding them doesn't work.
Is there a way to do that also?
 
Thanks for any help,
  Mario


Mario Giesel
Munich, Germany