Search code examples
conditional-statementsregressionlogistic-regressionspss

Conditional Logistic Regression in SPSS: data preparation


I need to perform a conditional logistic regression, and unfortunately must use SPSS in this case. The data should be composed of groups, in which there is a subject and 3 matched control. Each combined group should be numbered serially, so it could be used as strata. Suppose I have column A:

  • A. Diagnosis
  • 1
  • 0
  • 0
  • 0 .. How do I add to it column B with group numbers?
  • A.Diagnosis B.Group
  • 1 1
  • 0 1
  • 0 1
  • 0 1
  • 1 2
  • 0 2
  • 0 2
  • 0 2 .. Thanks a lot in advance

Solution

  • This will do it:

    compute group=trunc(($casenum-0.1)/4)+1.
    

    Note that this will not work if the order changes or if there are groups with less or more than 4 lines.