After exclusion of those individuals with afib-diagnos at baseline I want to know the following:
Time from examination date (examdate1) to diagnose (ICD10), where I want the earliest if those cases there are more than one. rowmin should be there somewhere I think. Last time rowmin only showed the lowest value, not the lowest value in those columns with I48 only.
afibdd=afib diagnose date
gen afibdd=0
egen earliest = rowmin(ts_41280_0_*)
format earliest %td
forvalues i=0/242 {
local var s_41270_0_`i'
local time ts_41280_0_`i'
recode afibdd (0=1) if `time'==earliest & substr(`var', 1, 3) =="I48"
}
Doesn't search for earliest time in those with I48 only like I want.
. tab afib afibdd
| afibdd
afib | 0 1 | Total
-----------+----------------------+----------
0 | 986 0 | 986
1 | 50 5 | 55
-----------+----------------------+----------
Total | 1,036 5 | 1,041
Time from examination date (examdate1) to diagnose (ICD10), where I want the earliest if those cases there are more than one. rowmin should be there somewhere I think. Last time rowmin only showed the lowest value, not the lowest value in those columns with I48 only.
afibdd=afib diagnose date
gen afibdd=0
egen earliest = rowmin(ts_41280_0_*)
format earliest %td
forvalues i=0/242 {
local var s_41270_0_`i'
local time ts_41280_0_`i'
recode afibdd (0=1) if `time'==earliest & substr(`var', 1, 3) =="I48"
}
Doesn't search for earliest time in those with I48 only like I want.
. tab afib afibdd
| afibdd
afib | 0 1 | Total
-----------+----------------------+----------
0 | 986 0 | 986
1 | 50 5 | 55
-----------+----------------------+----------
Total | 1,036 5 | 1,041

Comment