SPSS Statistics

 View Only
Expand all | Collapse all

Merge Viewer extension doesn't seem to work properly

  • 1.  Merge Viewer extension doesn't seem to work properly

    Posted Tue August 31, 2021 09:48 AM
    Edited by System Fri January 20, 2023 04:12 PM
    Hi all,
    I have a question about merging two tables that I created in CTABLES. The cells in the primary table contain percentages while the secondary table contains letter codes in case of significant differences between columns.
    I have the Merge Viewer extension installed and work with SPSS version 25.
    When I set the statistics label as "visible" in the CTABLES syntax, the merge works well, but when it is set as not visible it doesn't.
    Here is what I mean syntax-wise:
    in the CTABLES syntax:  /SLABELS POSITION=ROW VISIBLE=YES  works in conjunction with
    SPSSINC MERGE TABLES MATCHLABEL="Column N %" .
    Changing to VISIBLE=NO doesn't.

    What might be the problem here? Anyone?

    Thanks,

    Tal

    ------------------------------
    Tal van Dijk
    ------------------------------
    #SPSSStatistics


  • 2.  RE: Merge Viewer extension doesn't seem to work properly

    IBM Champion
    Posted Tue August 31, 2021 06:16 PM
    The internal structure of CTABLES output can be complicated, and some experimentation with MERGE TABLES may be necessary.  If you want to send me an spv file containing the table you want to modify, I can take a look.  (jkpeck@gmail.com)

    ------------------------------
    Jon Peck
    ------------------------------



  • 3.  RE: Merge Viewer extension doesn't seem to work properly

    Posted Wed September 01, 2021 03:44 AM
    Many thanks, Jon! I just sent you an e-mail which includes a SPV output file.
    Check your spam if it doesn't pop up in your inbox.


    ------------------------------
    Tal van Dijk
    ------------------------------



  • 4.  RE: Merge Viewer extension doesn't seem to work properly

    IBM Champion
    Posted Wed September 01, 2021 03:43 PM
    This simple looking table has a very strange internal structure when the statistic type is hidden.  One of the segments of the row label is duplicated, so the internal labels for the first table don't match the labels for the sig table.  It is possible to write a small custom row function to modify these labels on the fly, but there are some other issues that I will need to investigate.

    The good news is that MERGE TABLES has some alternative functions to the standard functions used for label-based matching.  Since these tables both have the same dimensions, you can just use these.  They simply match by the row and column numbers.

    Here is the modified syntax.
    SPSSINC MERGE TABLES  ATTACH=ROWS omitstatisticslevel=yes 
    rowfunction="SPSSINC_MERGE_TABLES.rowfuncbynumber"
    colfunction="SPSSINC_MERGE_TABLES.colfuncbynumber"
    /OPTIONS HIDE=YES APPENDTITLE=YES APPENDCAPTION=YES ADDLABELLEAF=YES printlevels=no
    HALIGN=RIGHT SEPARATOR="\n".

    --





  • 5.  RE: Merge Viewer extension doesn't seem to work properly

    Posted Sun September 05, 2021 03:16 AM
    Hi Jon,
    Thanks for your reply.
    I tried to run the modified syntax for Merge Tables but got this warning:
    " name 'f' is not defined ".
    Something in the functions seems to be undefined. 
    Can you tell me what's going on here? 

    Thanks!
     



    ------------------------------
    Tal van Dijk
    ------------------------------



  • 6.  RE: Merge Viewer extension doesn't seem to work properly

    IBM Champion
    Posted Sun September 05, 2021 01:10 PM
    Sorry, as a consequence of the Python 3 conversion of the extension commands, something got broken in this command.  I found and fixed the problem, but I forgot to tell you to update your installation.

    Get the spe file from here and install it with Extensions > Install Local Extension Bundle

    The version on the Extension Hub will get updated, but this may take a little while.

    Let me know how this works.

    --





  • 7.  RE: Merge Viewer extension doesn't seem to work properly

    Posted Thu September 09, 2021 11:02 AM
    Thanks Jon! Works like a charm!

    Now I'm moving on to the extension that should color the significant cells, the ones with the letter marks.
    I tried to run the MODIFY TABLE APPEARANCE extension. While I don't get any error or warning, it also doesn't 
    change anything in the table.
    These are my settings for the extension:
    SPSSINC MODIFY TABLES subtype="customtable"
    SELECT="<ALL>"
    DIMENSION= COLUMNS LEVEL = -1 SIGCELLS=ALLSIG SIGLEVELS=BOTH
    PROCESS = PRECEDING PRINTLABELS=FALSE
    /STYLES APPLYTO=DATACELLS
    BACKGROUNDCOLOR=255 255 0.

    If you could point me in the right direction with this problem, I'd appreciate it very much.

    Thanks,
    Tal



    ------------------------------
    Tal van Dijk
    ------------------------------



  • 8.  RE: Merge Viewer extension doesn't seem to work properly

    IBM Champion
    Posted Thu September 09, 2021 11:42 AM
    Well, there is a small error in the syntax.  It should be

    SPSSINC MODIFY TABLES subtype="customtable"SELECT="<<ALL>>" 
    DIMENSION= COLUMNS LEVEL = -1  SIGCELLS=ALLSIG SIGLEVELS=BOTH 
    PROCESS = PRECEDING 
    /STYLES  APPLYTO=DATACELLS 
    BACKGROUNDCOLOR=255 255 0.

    Notice the double << and >> .

    However, this text from the dialog help explains why coloring is not working for you.

    This subdialog narrows the selection made on the main dialog to those cells that meet the significance criteria specified here. In most cases, the significance criteria would be used with the "<<ALL>>" selection specification on the main dialog, but if there is a subset selected there, the significance specifications are applied within that.

    • This subdialog applies only to Statistics version 24 or later and to output from Custom Tables (CTABLES) where significance markers are shown in the main table and are the simple (not APA) type.


    However, all is not lost.  To make this work with the old-style significance markers after merging, you can run this syntax.
    SPSSINC MODIFY TABLES subtype="customtable"SELECT="<<ALL>>" 
    DIMENSION= COLUMNS LEVEL = -1 
    PROCESS = PRECEDING 
    /STYLES  APPLYTO=DATACELLS 
    CUSTOMFUNCTION="customstylefunctions.colorIfEndsWithAtoZLetter".

    The custom function is included with the extension.  You can specify other colors with arguments to that function.  See the customstylefunctions.py module for details.

    There is also a custom function in that module
    boldIfEndsWithAtoZLetter
    if you would prefer that effect.

    --





  • 9.  RE: Merge Viewer extension doesn't seem to work properly

    Posted Sun September 12, 2021 10:44 AM
    Edited by System Fri January 20, 2023 04:39 PM


  • 10.  RE: Merge Viewer extension doesn't seem to work properly

    IBM Champion
    Posted Sun September 12, 2021 11:27 AM
    Send me the spv file with the table before modifying it and the exact syntax you ran.

    As for doc, open the .py file in any plain text editor.  Each function has doc ahead of it, and most have usage examples.


    #SPSSStatistics


  • 11.  RE: Merge Viewer extension doesn't seem to work properly

    Posted Tue September 14, 2021 09:47 AM
    Hi Jon,
    I found out where it goes wrong in the Merge Viewer module. When I run a table with all or part of the labels of the column variable in Hebrew, the first Hebrew label it finds in a column is deleted and a warning is given under the table.
    In the moment I change the labels to English everything works fine and also the coloring of the data cells that contain significance marks
    with the Modify Table Appearance extension works. 

    Regards,
    Tal

    ------------------------------
    Tal van Dijk
    ------------------------------