SPSS Statistics

 View Only
  • 1.  Recoding variable question

    Posted Mon March 13, 2023 06:24 AM
    Edited by Renee Damstra Mon March 13, 2023 06:26 AM

    I have recoded a variable with the menu structure, syntax as follows:

    RECODE soc_alone

    DATASET ACTIVATE DataSet1.
    RECODE soc_alone (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1) INTO soc_alone_recoded.
    VARIABLE LABELS  soc_alone_recoded 'Ik vind het onaangenaam om alleen te zijn'.
    EXECUTE.

    However, is it correct that I cannot find a new variable soc_alone_recoded anywhere and it has overwritten the original variable soc_alone? Is a new variable always added at the end of the workspace? I can't find it and if I try Edit - Go to variable it is not listed.



    ------------------------------
    Renee Damstra
    ------------------------------



  • 2.  RE: Recoding variable question

    Posted Mon March 13, 2023 06:31 AM
    Your syntax is correct. It creates and labels a new variable soc_alone_recoded. You should find the new variable at the end of the variable list. So at the very bottom in variable view or at the very right in data view.





  • 3.  RE: Recoding variable question

    Posted Mon March 13, 2023 07:01 AM

    Could it be that selecting 'paste' instead of 'continue/ok' only pastes the syntax but does not run the command? Since I could not find the recoded variable anywhere.

    I have now tried to run it in syntax and I get the error in the printscreen



    ------------------------------
    Renee Damstra
    ------------------------------



  • 4.  RE: Recoding variable question

    Posted Mon March 13, 2023 07:17 AM
    Yes, paste only pastes. To run the syntax you need to select it in the syntax editor and then run it.

    The RECODE statement in the print-screened syntax editor is incomplete. Even before running it you can recognize this by the red color of the word RECODE. Try to insert the syntax from your first posting instead of the incomplete statement and run it. 






  • 5.  RE: Recoding variable question

    Posted Mon March 13, 2023 10:40 AM

    I haven't changed anything except running the command after the paste and now it works.



    ------------------------------
    Renee Damstra
    ------------------------------