stset right, failure(suicide) origin(enter) enter(left)
set seed 563476
save cohort
forval i=1/777 { // 777 is a maximum practice id,
use cohort, clear
keep if pracid==`i'
qui tab suicide
if r(r)==2 {
sttocc, n(20)
save temp/matched`i' //, replace
}
}
use temp/matched1, clear
forval i=2/777 {
capture append using temp/matched`i'
save matched, replace
}
set seed 563476
save cohort
forval i=1/777 { // 777 is a maximum practice id,
use cohort, clear
keep if pracid==`i'
qui tab suicide
if r(r)==2 {
sttocc, n(20)
save temp/matched`i' //, replace
}
}
use temp/matched1, clear
forval i=2/777 {
capture append using temp/matched`i'
save matched, replace
}
0 Response to specifying eligibility criteria for "controls" during risk-set sampling (using sttocc command)
Post a Comment