SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  Syntax command for new variable

    Posted Thu July 20, 2023 09:08 AM
    Hello everyone,
     
    I have a survey with 3 measurement points.
    The personal code for T1 (measurement time 1) and T2 (measurement time") is stored under the variable name "SERIAL".
    For T0 (screening), however, the personal code was stored under the variables "OP01" and "OP02", since the test subjects were only assigned to the respective group (intervention group vs. control group) at a certain point.
     
    Since I have to document all steps using a syntax for my work, my question is:
     
    How can I create a new variable using syntax and insert the data from the variables "SERIAL", "OP01" and "OP02" into this variable (also using syntax)?
     
    Thanks in advance.
     
    Best regards


    ------------------------------
    Ilay Engin
    ------------------------------


  • 2.  RE: Syntax command for new variable

    Posted Wed July 26, 2023 02:36 PM

    numeric new_variable(f5).

    if missing(new_variable)

    new_variable=serial.

    if missing(new_variable)

    new_variable=opo1.

    if missing(new_variable)

    new_variable=opo2.



    ------------------------------
    Art Jack
    ------------------------------