Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a case control cohort

    I would be very grateful for some suggestions on how to create a case control cohort in STATA.
    I have a data-set consisting of several hundred patients and several thousands of controls.
    I would like to match patients to controls by age, gender and residential area (1-13) and then examine mortality in cox-regression analysis. I expect to have about 5 controls with the same gender, residential are and age as the control.
    Is there a way of doing this in STATA?
    I have tried using the Sttocc function and then define age as the survival time, and case-control as the outcome variable, but although this creates a case control set it is not matched as I wish.
    I have read that I can stratify by age-segments, but I don't think I can stratify by age as a continuous variable.

    Crossing fingers for some help.


  • #2
    In general terms, the approach is to separate the data into two data sets, one with cases and the other with controls. Then use -joinby- to match each case on age gender and residential area to all potential matches in the control data set. See -help joinby- for syntax. Then you can randomly select 5 controls for each case from all those potential matches.

    As you note, this approach may fail because requiring an exact match on age may prove too stringent. There are two ways you can relax that. You can create age-bands such as 25-29 30-34 35-39... as a discrete variable and match on that. Or, in my view, better, you can match to within +/- 3 (or 5, or some other appropriate number) years. For this approach you will need to use -rangejoin- instead of -joinby-. -rangejoin- is written by Robert Picard and is available from SSC. And -rangejoin- itself requires -rangestat- (Robert Picard, Nick Cox & Roberto Ferrer, also from SSC).

    If you need help working out the details of the code, post back, using the -dataex- command to show example data and show the code you've tried, posting it in code delimiters. See Forum FAQ #12 for instructions on using -dataex- and code delimiters.

    Comment


    • #3
      You might also explore using -calipmatch- (SSC) which allows ranged matches.
      __________________________________________________ __
      Assistant Professor, Department of Biostatistics and Epidemiology
      School of Public Health and Health Sciences
      University of Massachusetts- Amherst

      Comment


      • #4
        Thank you very much for your response, I am very grateful.

        Comment

        Working...
        X