SPSS Statistics

SPSS Statistics

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

 View Only
  • 1.  Multiple Comparison Logic with Missing Values

    Posted Fri March 18, 2022 03:08 PM
    Hi all,

    I am trying to compute a binary indicator of improvement such that improvement on any of the underlying variables is categorized as improvement. Some of the variables have missing data for the pre score or post score. My data file is arranged in a "wide format" with one row be individual and Pre and Post score in separate columns. 

    When I attempt to compute an improvement variable (sample syntax below) for any individuals with missing data, $SYSMIS is returned.

    COMPUTE improve = 0.
    IF (Var1_Post > Var1_Pre)  OR (Var2_Post > Var2_Pre) improve = 1.
    EXECUTE.

    Sample Data:
    Var1_Post = 5
    Var1_Pre = $SYSMIS

    Var2_Post = 3
    Var1_Pre = 1.

    My hope is that my "improve" variable would return 1 in this scenario. Is there any way to accomplish this?




    ------------------------------
    Brian Joy
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Multiple Comparison Logic with Missing Values

    Posted Fri March 18, 2022 03:18 PM
    A missing value means that the condition value is indeterminate, so you get sysmis rather than true or false.  You can use the sysmis function (not the sysmis missing value) to code the logic you want.

    --