-
Login or Register
- Log in with
gen test = end_follow_date- start_follow-date if _st==0 sum test sum test if test==0
browse if _d != x
// INCIDENCE-RATE OF CATEGORICAL FRACTURE-CODE stset endpoint, failure(diagnosiscode = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 / 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45) scale(365250) 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_post_stroke_fx_date = /// min(cond(has_fracture_now & admission_date > start_follow_date, admission_date, .)) by person_id: egen diagnosiscode = min(cond(admissiondate == first_post_stroke_fx_date, diag, .)) by person_id (admission_date): gen end_follow_date = min(td(31dec2017), dødsdato) 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
gen has_fracture_now = 1 replace has_fracture_now = 0 if missing(diag) label define has_fracture_now 0 "No fracture" 1 "Fracture" label values has_fracture_now has_fracture_now
by person_id: egen diagnosiscode = min(cond(admissiondate == first_post_stroke_fx_date, diag, .))
by person_id: keep if _n == 1
gen has_fracture_now = 1 replae has_fracture_now = 0 if missing(diag) label define has_fracture_now 0 "No fracture" 1 "Fracture" label values has_fracture_now has_fracture_now
by person_id: egen had_fracture = max(has_fracture_now)
by person_id: egen diagnosiscode = min(cond(admissiondate == first_post_stroke_fx_date, diag, .) stset endpoint, failure(diagnosiscode = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 /// 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45) scale(365250) origin(start_follow_date) id(person_id) stptime
by person_id: egen had_fracture = max(has_fracture_now
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: egen diagnosiscode = min(cond(admissiondate == first_post_stroke_fx_date, diag, .)) by person_id (admission_date): gen end_follow_date = min(td(31dec2017), dødsdato) 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(365250) origin(start_follow_date) id(person_id) stptime // INCIDENCE-RATE OF DIAGNOSIS SPECIFIC FRACTURE stset endpoint, failure(diagnosiscode = 5) scale(365250) origin(start_follow_date) id(person_id) stptime // INCIDENCE-RATE OF CATEGORICAL FRACTURE-CODE stset endpoint, failure(diagnosiscode = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 // 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45) scale(365250) origin(start_follow_date) id(person_id) stptime
Leave a comment: