> Hi. I would like to know if you have a command to calculate the confidence
> intervals of the rate (Person Time) and to compare and to determine
> statistical differents between two rates.
A simple way is to use poisson regression via glm. Here is a dummy data set:
> tdata
event time group
1 12 100 1
2 28 200 2
3 29 100 3
> fit <- glm(event ~ factor(group) + offset(log(time)), data=tdata,
>
family=poisson)
> summary(fit)
Coefficients:
Value Std. Error t value Pr(>|t|)
(Intercept) -2.1202635 0.2886751 -7.3448 NA
factor(group)2 0.1541507 0.3450328 0.4468 NA
factor(group)3 0.8823892 0.3432435 2.5707 NA
(Dispersion Parameter for Poisson family taken to be 1 )
Null Deviance: 9.730052 on 2 degrees of freedom
Residual Deviance: 0 on 0 degrees of freedom
Number of Fisher Scoring Iterations: 1
-------------
Since my dummy data has only 1 subject per group S doesn't know what to do
for
a p-value, but don't worry about it. It will fix itself when you have multiple
subjects. The test for group 1 vs group 3 has
relative risk = exp(.88) = 2.41
with 95% CI of exp(.88 - 1.96*.343) to exp(.88 + 1.96*.343)
For a single group use the intercept and confidence interval for the
intercept.
Terry T.
|