SPSS Statistics

Expand all | Collapse all

Merge Viewer extension doesn't seem to work properly

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

    Posted 25 days ago
    Edited by Irfan Khairi 25 days ago
    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
    ------------------------------


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

    Posted 25 days ago
    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 25 days ago
    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

    Posted 24 days ago
    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 21 days ago
    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

    Posted 20 days ago
    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 16 days ago
    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

    Posted 16 days ago
    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 13 days ago
    Edited by Tal van Dijk 13 days ago


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

    Posted 13 days ago
    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.



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

    Posted 11 days ago
    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
    ------------------------------