SPSS Statistics

 View Only
  • 1.  Showing only selected variables in dialog boxes?

    Posted Sat February 25, 2023 05:06 AM
    I think I read somewhere that one could limit the variables offered in dialog boxes to a subset of all variables in the active dataset. Possibly by selecting variable attribute values or providing a variable list in a specific syntax command.

    I can't find the source anymore. Is there such an option in the GUI or with syntax?


  • 2.  RE: Showing only selected variables in dialog boxes?

    Posted Sat February 25, 2023 07:49 AM

    Hi. Look in the Utilities menu for Variable Sets.



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



  • 3.  RE: Showing only selected variables in dialog boxes?

    Posted Sat February 25, 2023 08:30 AM
    Hi, thank you!

    Is there also a way to create a new var set from scratch? I only found the APPLY DICTIONARY / FILEINFO -> VARSETS way to copy sets from a preexisting dataset with preexisting sets.








  • 4.  RE: Showing only selected variables in dialog boxes?

    IBM Champion
    Posted Sat February 25, 2023 09:55 AM
     Utilities > Define Variable Sets allows  you to create new sets as well as to select from already defined sets.

    You might also be interested in the SETSMACRO extension command.  It allows you to create a macro listing the variables in a set or sets.

    --





  • 5.  RE: Showing only selected variables in dialog boxes?

    Posted Mon April 08, 2024 11:25 AM

    Dear Jon,

    is there a way in SPSS to define variable sets using syntax?

    I have a huge dataset and to all the prep work by syntaxt. It would be great to include the definition of variable sets in this. The survey has several waves and like this I will not have to redo this step for each wave again.

    Thx so much for your help!!

    axel



    ------------------------------
    Axel Puhlmann
    ------------------------------



  • 6.  RE: Showing only selected variables in dialog boxes?

    IBM Champion
    Posted Mon April 08, 2024 05:49 PM
    Unfortunately, there is no way to define variable sets in syntax.  The definitions are stored as a property of a sav file, but there is no way to get at that directly.

    There is an extension command, SETSMACRO that can create an SPSS macro listing the variable names in a variable set definition or definitions in an open sav file.

    If it would be okay to construct an entire dataset by deleting variables not in the selected sets,  you could use ADD FILES /KEEP ... to limit the variables in the active dataset after using SETSMACRO, but that would be a nuisance if you need to vary the sets in use in a job.

    Variable sets were invented back in the days when dialog boxes couldn't handle large variable lists, but as far as I can tell, they have largely fallen out of use.

    --