# Confidence interval for the proportion of side effect per day of treatment

Patients during their stay in hospital are conned over given periods to a medical device, some of them contract a rare disease

Example:

patient 1 is connected from day: 10-20, 55-61 and is not infected.
.
.
.
patient 115 is connected from day: 2-50, 58-114, 120-155 and contracts the disease.


How would it be possible to determine the confidence interval of the (number of occurences)/(number of days of exposure to the device)?

Let the respons variable be $y_i$ which is one if patient $i$ is affected, zero elsewhere. Let $E_i$ be the exposure of patient $i$, and let $z_i$ be a vector of other variables influencing effected status, if any. The Poisson regression postulated above is somewhat unnatural here since the response is zero/one and not a count variable. Binomial regression looks more natural, but the most used link function, the logistic, giving logistic regression, seems not. But you can try binomial regression with a log link function, for instance available in R. The model becomes $$p_i=P(Y_i=1 | E_i,z_i) = \exp(\beta_0+\log E_i +\beta' z_i)$$ and we can see that the estimated probability $\hat{p_i}$ is proportional to $E_i$, so proportional to exposure, as wanted. I have never used such a model myself, so do not know how well it works in practice (specifically, estimated probabilities larger than 1 is possible! but how often that arises in practice, I do not know). For more about this model see http://www.biostat.umn.edu/~will/6470stuff/Class24-12/Handout24.pdf