If it bothers you to see that message, you can change the -stset- command as follows:
Code:
stset endpoint if start_follow_date < endpoint, failure(outcome = 1) scale(36525) origin(start_follow_date) id(person_id)
stset endpoint if start_follow_date < endpoint, failure(outcome = 1) scale(36525) origin(start_follow_date) id(person_id)
sort person_id stroke_date by person_id (stroke_date): gen start_follow_date = stroke_date[1] by person_id (admission_date), sort: egen first_post_stroke_fx_date = /// min(cond(has_fracture_now & admission_date > start_follow_date, admission_date, .)) by person_id (admission_date): gen end_follow_date = min(admission_date[_N], death_date) by person_id: egen had_fracture = max(has_fracture_now) gen dead = 1 replace dead = 0 if missing(death_date) by person_id: egen died = max(dead) by person_id: keep if _n == 1 // FOR FRACTURE OUTCOME ONLY gen outcome = had_fracture gen endpoint = min(first_post_stroke_fx_date, end_follow_date) // INCIDENCE-RATE OF FRACTURES stset endpoint, failure(outcome = 1) scale(36525) origin(start_follow_date) id(person_id) stptime
sort person_id stroke_date by person_id (stroke_date): gen start_follow_date = stroke_date[1] by person_id (admission_date), sort: egen first_fracture_date = min(cond(has_fracture_now, admission_date, .)) by person_id (admission_date): gen end_follow_date = min(admission_date[_N], death_date) by person_id: egen had_fracture = max(has_fracture_now) gen dead = 1 replace dead = 0 if missing(death_date) by person_id: egen died = max(dead) by person_id: keep if _n == 1 // FOR FRACTURE OUTCOME ONLY gen outcome = had_fracture gen endpoint = min(first_fracture_date, end_follow_date) // INCIDENCE-RATE OF FRACTURES stset endpoint, failure(outcome = 1) scale(36525) origin(start_follow_date) id(person_id) stptime
Leave a comment: