Hi all,
I am sorry if this question has more to do with statistical knowledge and not necessarily with Stata usage, but I really need some help. I hope this is appropriate.
I am trying to test the association between a continuous variable and the number of infections each patient had during the follow-up period. The follow-up period length is not the same for all patients, and this is not survival data in the sense that I just have the total number of infection events, not the time until each event.
In this example of the data, the variable <period> is the observation time in years, and the <infection> is the number of infections during that time. <indvar> is the variable being tested for the association, and <covar*> and <age> are co-variables to be included in the regression.
Is a Poisson regression (or a negative binomial regression) the most appropriate here? If it is, I can't figure out how to "adjust" the number of infections to the observation (at risk) period using the <poisson> or the <nbreg> commands.
Many thanks.
I am sorry if this question has more to do with statistical knowledge and not necessarily with Stata usage, but I really need some help. I hope this is appropriate.
I am trying to test the association between a continuous variable and the number of infections each patient had during the follow-up period. The follow-up period length is not the same for all patients, and this is not survival data in the sense that I just have the total number of infection events, not the time until each event.
In this example of the data, the variable <period> is the observation time in years, and the <infection> is the number of infections during that time. <indvar> is the variable being tested for the association, and <covar*> and <age> are co-variables to be included in the regression.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte id double(indvar age) byte covar2 float covar3 byte(infection period) 4 .552 54.31666666666667 1 1 18 9 5 .781 36.59722222222222 1 0 6 5 6 .672 56.56388888888889 1 0 8 9 7 .796 48.61944444444445 1 0 0 6 8 .394 53.41388888888889 0 1 3 7 9 .2725 57.013888888888886 0 0 1 1 10 .48350000000000004 53.36388888888889 1 0 4 10 11 .344 46.69444444444444 1 0 10 7 12 1.3975 42.75 0 0 1 10 13 1.1880000000000002 51.202777777777776 0 0 2 9 end
Is a Poisson regression (or a negative binomial regression) the most appropriate here? If it is, I can't figure out how to "adjust" the number of infections to the observation (at risk) period using the <poisson> or the <nbreg> commands.
Many thanks.
Comment