How do I calculate the standard error on, $r$, an aggregated rate? (for a sample of $n$)
I will go through two simple cases first (1 and 2) to put in perspective what I mean by "aggregated rate" which will be explained in case 3.
1. Binary outcome - expected number of successes
Starting simple.
i x
(1/0)
-----------
1 0
2 0
3 1
... ...
N 0
If the probability of an attack happening to a subject is $p$, and there are $n$ subjects, then the expected number of attacks is $np$ with a standard error on the expected value $\sqrt{p(1-p)/n}$. If $p=1$%, then the vast majority of subjects will not have the event happen to them ($x=0$).
2. Poisson outcome - expected count of events
Slightly more complex - instead of looking at a binary outcome, the counts can be examined.
i x
Pois(0.01)
----------------
1 0
2 1
3 2
... ...
N 0
The mean number of times a subject is attacked is $0.01$. A fairly valid model would be to treat the number of attacks as a Poisson distribution with $\lambda = 0.01$. If a sample of $n$ is taken from this underlying population, the mean number of attacks is $\lambda=0.01$ attacks subject$^{-1}$ with a standard error on the mean of $1/\sqrt{\lambda n}$. When $\lambda = 0.01$, the vast majority of subjects will have experienced $x=0$ attacks.
3. Discrete-continuous hybrid - expected rate of events
More complex - instead of looking at counts, looking at rates.
i x w r
Pois(0.01) miles rate
--------------------------------
1 0 10 0
2 1 5 0.2
3 2 20 0.1
... ... ... ...
N 0 50 0
Instead of looking at attack numbers, I am now looking at attack rates (e.g., attacks per mile, or attacks per visit to London, etc). Again, the vast majority of subjects have a rate of $0$ attacks mile$^{-1}$ owing to the rarity of the event in the first place.
The aggregated rate would be:
$$ r = \frac{\sum^N_{i=1} x_i}{\sum^N_{i=1} w_i} $$
But how do I calculate the standard error on, $r$, an aggregated rate? (for a sample of $n$)
I found a similar question here, but could not quite find what I was looking for.