SPSS Statistics

SPSS Statistics

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


#Analytics
#SPSSStatistics
#Analyticstools
 View Only
  • 1.  SPSS duplicate cases - add fixed variable to all

    Posted 02/15/21 03:26 PM

    Hi,

    I have a large data seg, where data has been collected (for the same individuals) over three separate rounds. One of the variables is fixed (sex), but is only registrered in round 1 and 3 (not round 2).

    How can I transfer the fixed data to round 2?

    Right now it looks like this:

    ID round sex

    1 1 1

    1 2 .

    1 3 1

    2 1 1

    2 2 .

    2 3 1

    3 1 0

    3 2 .

    3 3 0

    I want this:

    ID round sex

    1 1 1

    1 2 1

    1 3 1

    2 1 1

    2 2 1

    2 3 1

    3 1 0

    3 2 0

    3 3 0






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: SPSS duplicate cases - add fixed variable to all

    Posted 02/16/21 02:26 PM

    Since the variable is always present for the first case for a given ID, you can just execute

    if missing(sex) sex = lag(sex).






    #SPSSStatistics
    #Support
    #SupportMigration