1. Self merge the data

  2. Identify the 6-month prior comorbidities

  3. Merge back to main analytic file

  4. Cut the data off Jan-June 2007 since no enough data to look back 6 months

comorbidity_6m(original_data = analytic_30dcmp, month = 6)

Arguments

month

how many months to look back for comorbidity, default is 6 months

Value