Login  Register

Re: Coloring the tables based on sig t

Posted by Jon Peck on Sep 27, 2018; 7:43pm
URL: http://spssx-discussion.165.s1.nabble.com/Coloring-the-tables-based-on-sig-t-tp5736722p5736729.html

Close, but there are a few problems with the syntax.  Since you are using the older significance format, you need to pass the
desired colors as parameters to the colorIfEndsWithAtoZ rather than specifying the BACKGROUND parameter in the STYLES
subcomand.

More importantly, you need to specify the SELECT keyword as "<<ALL>>" rather than as above.  You are getting no result because
there are no column labels that match the string "ALL".

Putting this together, the syntax should be
SPSSINC MODIFY TABLES subtype="CustomTable" SELECT="<<ALL>>"  DIMENSION= COLUMNS  PROCESS = PRECEDING
/STYLES  APPLYTO=DATACELLS 
CUSTOMFUNCTION="customstylefunctions.colorIfEndsWithAtoZLetter(r=255,g=0,b=0)".



On Thu, Sep 27, 2018 at 4:24 AM Arora, Manoj (IMDLR) <[hidden email]> wrote:

Hi All,

 

I am using SPSS 22 and after using SPSS Merge Table I am using SPSS Modify table to color the background of cell if it is significant. It is merging but it is nor coloring. Please let me know whether this utility works in SPSS 22 or not. I am using customerstylefunctions.py.

 

 

Output generated is show below with syntax and data file

 

 

 

 

DIVISIONSEGMENT

1.00 BRANCH FUNCTIONS

2.00 BUILDING SEGMENT

3.00 CABLE

4.00 CRI

5.00 ECD

6.00 HO FUNCTIONS

7.00 INDUSTRIAL PRODUCT

8.00 LIGHTING

9.00 MANUFACTURING

10.00 SALES COMMON

11.00 STANDARD

gendor

1.00 FEMALE

Column N %

4.9%

0.5%

6.5%

8.8%

B

1.2%

10.0%

B E

0.0%

1.8%

5.7%

B

0.0%

0.0%

2.00 MALE

Column N %

95.1%

99.5%

D F I

93.5%

91.3%

98.8%

F

90.0%

100.0%

98.2%

94.3%

100.0%

100.0%

 

Results are based on two-sided tests with significance level .05. For each significant pair, the key of the category with the smaller column proportion appears under the category with the larger column proportion.

 

 

Syntax is below

 

CTABLES

  /VLABELS VARIABLES=gendor div_seg DISPLAY=LABEL

  /TABLE gendor [C][COLPCT.COUNT PCT40.1] BY div_seg [C]

  /SLABELS POSITION=ROW

  /CATEGORIES VARIABLES=gendor div_seg ORDER=A KEY=VALUE EMPTY=INCLUDE

  /COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=BONFERRONI ORIGIN=COLUMN INCLUDEMRSETS=YES

    CATEGORIES=ALLVISIBLE MERGE=NO.

 

SPSSINC MERGE TABLES MATCHLABEL="Column N %" ATTACH=Rows MODE=MERGE  COLFUNCTION="SPSSINC_MERGE_TABLES.colfuncbynumber"

/OPTIONS HIDE=Yes APPENDTITLE=No APPENDCAPTION=Yes ADDLABELLEAF=Yes HALIGN=Right SEPARATOR="\n".

 

SPSSINC MODIFY TABLES subtype="CustomTable" SELECT="ALL"  DIMENSION= COLUMNS LEVEL = -1  SIGLEVELS=BOTH PROCESS = PRECEDING

/STYLES  APPLYTO=DATACELLS BACKGROUNDCOLOR=255 0 0

CUSTOMFUNCTION="customstylefunctions.colorIfEndsWithAtoZLetter".

 

 

Regards

Manoj

 



Kantar Disclaimer
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD