SPSS Statistics

 View Only
  • 1.  Write syntax script that changes the Set Labels for Multiple Response Sets

    Posted Tue May 24, 2022 11:44 AM
    I have an SPSS sav file with many Multiple Response Sets already pre-defined. I would like to write a syntax script that changes the Set Labels for all the Multiple Response Sets.

    I first tried using the "VARIABLE LABELS" syntax, and including the name of the set as defined by SPSS as the variable name (ex: $VarName), but that caused an error. I then tried using the "MULT RESPONSE GROUPS" syntax, and while I was able to output a frequency table for the sets, it did not actually change the Set Label to what I included within the apostrophes.

    Does anyone know if there is a way to do this via syntax? There are a lot of Multiple Response Sets (and I would like this process to be repeatable), so I do not want to make these changes manually within the "Define Multiple Response Sets" screen. Thank you for any help or advice!

    ------------------------------
    Sam Lubchansky
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Write syntax script that changes the Set Labels for Multiple Response Sets

    Posted Tue May 24, 2022 11:55 AM
    Hi, Sam.

    To be clear, you used the MRSETS command? It does have a LABEL keyword for both the MDGROUP and MCGROUP subcommands. Do I understand you correctly that those keywords don't work?

    I notice you also mentioned the MULT RESPONSE command, which MRSETS does not work with (MRSETS was specifically designed for CTABLES and GGRAPH only). You cannot save mult response groups in the SAV file; you can only save the MULT RESPONSE syntax files that create and define them.

    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 3.  RE: Write syntax script that changes the Set Labels for Multiple Response Sets

    Posted Tue May 24, 2022 01:22 PM
    To answer your question, no...I used the "VARIABLE LABELS" and "MULT RESPONSE GROUPS" commands, neither of which worked. I had never used "MULT RESPONSE GROUPS" before, but it was the only thing I could find in the Command Syntax Reference that dealt with multiple response sets.

    After struggling for a few days, I finally posted here yesterday afternoon. And then (naturally), while waiting for the post to be approved, I stumbled onto the MRSETS command this morning - and the MRSETS command did exactly what I needed. So thankfully I was able to figure this out, but at least my case is now out there in case someone else ever searches for a similar solution.

    Thanks for the assist though! If i hadn't stumbled onto it myself, I'm sure your mention of MRSETS would've ultimately sent me to the same place.

    ------------------------------
    Sam Lubchansky
    ------------------------------



  • 4.  RE: Write syntax script that changes the Set Labels for Multiple Response Sets

    IBM Champion
    Posted Tue May 24, 2022 11:59 AM
    There is no syntax for this, but it can be done with a bit of Python code that messes with the variable dictionary.  I can write that, but I might not get to it for a few days.

    What is the change you want to make?  Is it something systematic, or would it be different from set to set?  And would it apply to all MR sets or only a designated list?

    --





  • 5.  RE: Write syntax script that changes the Set Labels for Multiple Response Sets

    Posted Tue May 24, 2022 01:23 PM
    Thanks for the offer, but as mentioned above I solved this via the MRSETS command.

    ------------------------------
    Sam Lubchansky
    ------------------------------



  • 6.  RE: Write syntax script that changes the Set Labels for Multiple Response Sets

    IBM Champion
    Posted Tue May 24, 2022 01:49 PM
    Ok.  That's a good solution as long as you have the original definition syntax.

    --