The difficulty I'm having is that I don't have individual-level data, so I can't figure out how to use the Stata epitab command -ir-, which requires a "case" variable for whether the outcome occurred and an "exposed" variable for the cohort (i.e., it assumes individual-level data).
Another approach would be to use the immediate version of the -ir- command (-iri-; which uses summarized data), but I'm not sure how to extract the values from the variables for outcome count and person-time to feed into the iri command.
This is an extract of a modified version of my dataset with 2 time periods, two cohorts, and 2 outcomes.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str3(followupperiod cohort) str21 outcome long(events n) "d3" "c1" "outcome1" 59 40000 "d3" "c1" "outcome2" 72 40000 "d3" "c2" "outcome1" 217 800000 "d3" "c2" "outcome2" 1515 800000 "d7" "c1" "outcome1" 86 40000 "d7" "c1" "outcome2" 144 40000 "d7" "c2" "outcome1" 358 800000 "d7" "c2" "outcome2" 2580 800000 end
"followupperiod" is the number of days of follow-up: d3=3 days follow-up; d7=7 days follow-up
I'd like to be able to calculate the IRR for the same outcome and time period for two different cohorts, or for the same outcome and cohort at two different time periods, or for the same cohort and time period for two different outcomes.
As an example, I'd like to be able to calculate the IRR for outcome1 at time period d3 comparing cohort c1 to cohort c2. The -iri-command would be
Code:
iri 59 217 40000 800000
events where cohort="c1" followupperiod="d3" and outcome="outcome1"
events where cohort="c2" followupperiod="d3" and outcome="outcome1"
n where cohort="c1" followupperiod="d3" and outcome="outcome1"
n where cohort="c2" followupperiod="d3" and outcome="outcome1"
0 Response to calculate IRR with confidence intervals from summarized data
Post a Comment