# Correct way to express a mean rate between two groups

I am a novice in statistics so pardon my rather simple question.

I have a retrospective case-control study, I would like to show the rate of admissions (ie number of admissions per year) of my cases and controls. I have individual level data on a = total number of admissions of a given patient during follow up period y = total number of years of follow up of a given patient

and I have n1 = number of cases and n2 = number of controls.

If I would like to show the mean number of admissions per year of the cases, and the mean number of admissions of controls per year (with SDs), should I be doing

mean= sum(a/y)/n for both groups, and standard deviation? in R I can easily do this by calculating a new column r (admission rate of an individual) = a/y, then do mean(r) and sd(r)

or should it be

mean= sum(a)/sum(y) for both groups (sum of n1 admissions, divided by sum of y1 years of follow up for cases; and sum of n2 admissions, divided by sum of n2 years of follow up for controls) - however, how do I derive standard deviation from this?

Edited:

total cases: n1
total control: n2

each case/control has $$a$$ admission numbers in $$y$$ period of time.

If $$a$$ and $$y$$ are varying/different for each patient $$i$$

Mean number of admissions per year of the cases:

The mean, $$\mu$$ is $$\frac{\sum_{i}^{n_1}(a_i)}{\sum_{i}^{n_1}(y_i)} = \frac{a_1 + a_2 + ... + a_{n1}}{y_1 + y_2 + ... + y_{n1}}$$

basically, add all the individual patient admissions together and divide by adding all the individual patient's periods.

special case: If $$a$$ and $$y$$ is the same for all patients then mean number of admissions per year of the cases:= is total number of cases $$(n1 \cdot a)$$ divided by total time $$(n1 \cdot y)$$

mean, $$\mu$$ = $$\frac{(n_1 \cdot a)}{(n_1 \cdot y)}$$

replace n1 by n2 above and you can get the mean number of admissions of controls per year.

for standard deviation you just need to apply the formula.

$$\frac{1}{\sum_{i}^{n_1}(y_i)} \cdot \sum_{i}^{n_1}(a_i -\mu)^2 = \frac{(a_1 - \mu)^2 + (a_2 - \mu)^2 + .... + (a_{n_1} - \mu)^2} {y_1 + y_2 + ... + y_{n1}}$$

change n1 to n2 for standard deviation in controls.

• no, a = total number of admissions per patient for the entire follow up period (y) of this patient. And n is number of patients, therefore there are n1 cases and n2 controls. I will edit my question to be more clear.
– Hong
Commented Jul 27, 2023 at 10:45
• Please check now. Commented Jul 28, 2023 at 7:24