1

I need to compare hospital admissions per year before and after the introduction of antibiotics in 100 patients (antibiotics introduced at various time points in the past).

Eg.

Before antibiotics: admissions: 2 start: Jan-09 end: Dec-13 years: 4.92 admissions/year: 0.4

After antibiotics: admissions:0 start: Dec-13 end: June 19 years: 5.5 admissions/year: 0

If I use a t test then 0 admissions in 1 month equals to 0 admissions in 5 years, which is not correct.

Would you recommend any specific software?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
Alex
  • 11
  • 2
  • Do you have 100 patients before antibiotics and another 100 after? If only 100 altogether, how many before antibiotics and how many after? – BruceET Nov 07 '19 at 23:15
  • These are 100 altogether and they are the same patients before and after antibiotics- just different time intervals for each: eg patient A was not on antibiotics for 2 years and then took them for 5 years while patient B was not on antibiotics for 7 years and then took them for 1 year. – Alex Nov 08 '19 at 13:02
  • Duplicate of [your previous question](https://stats.stackexchange.com/questions/434992/comparing-variables-that-involve-time) – Lio Elbammalf Nov 08 '19 at 15:42

1 Answers1

1

I would start with Poisson regression, maybe with a random effect for patient. First, present the data in the following long format (you will need some transformations):

ID     Antibiotics   Admissions_total   Time_length ...
1      without         10                  3
1      with            8                   3
2      without         11                  4
2      with            3                   1
 ...

so you have to calculate total admissions, not per year, and length of period with/without in years/months. The length will then enter as an offset, that is, a variable with a known coefficient of 1. See Scaling vs Offsetting in Quasi-Poisson GLM. The model can then be written as $$ \text{Admissions-total}_i \sim \mathcal{Poisson}(e^{\lambda_i}) $$ where $\lambda_i= \mu + \tau_i + \text{Antibiotics}_i +\text{offset}(\log{\text{Time_length}})$. Here $\tau_i$ (if included in the model) is a patient random effect.

A simpler model without the random effect can be implemented in R with

mod_glm <- glm(Admissions_total ~ Antibiotics + offset(log(Time_length)), family=poisson, data=your_data_frame)

but as there might be large differences between patients, it is probably better to include random effects, which in R could be

library(lme4)
mod_lme4  <- glmer(Admissions_total ~ Antibiotics + offset(log(Time_length)) +(1 | ID), data=your_data_frame, family=poisson)

This could at least be a starting point. The model is called a Poisson rate regression.

While I used R in my example, this could be done with most statistical software.

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467