title: How to copy data within case-set in case control study using SPSS?
body: <p>I'm doing a case-control study about ovarian cancer. I want to do stratified analyses for the different histotypes but haven't found a good way of doing it in SPSS. I was thinking about copying the information about the diagnoses from the cases to the controls, but I don't know the proper syntax to do it.</p>
  
  <p>So - what I want to do is to find the diagnosis within the case-control pair, copy it, and paste it into the same variable for all the controls within that pair. Does anyone know a good way to do this?</p>
  
  <p>ID = unique ID for the individual, casecontrol = 1 for case, 0 for control, caseset = stratum, ID for each matched group of individuals.</p>
  
  <p>My dataset looks like this:</p>
  
  <pre><code>ID | casecontrol | caseset | diagnosis
  1  |     1       |    1    |     1
  2  |     0       |    1    |     0
  3  |     0       |    1    |     0
  4  |     0       |    1    |     0
  5  |     1       |    2    |     3
  6  |     0       |    2    |     0
  7  |     0       |    2    |     0
  8  |     0       |    2    |     0
  </code></pre>
  
  <p>And I want it to look like this:</p>
  
  <pre><code>ID | casecontrol | caseset | diagnosis
  1  |     1       |    1    |     1
  2  |     0       |    1    |     1
  3  |     0       |    1    |     1
  4  |     0       |    1    |     1
  5  |     1       |    2    |     3
  6  |     0       |    2    |     3
  7  |     0       |    2    |     3
  8  |     0       |    2    |     3
  </code></pre>
  
  <p>Thank you very much.</p>