A common example in statistics is to estimate the bias of a coin (the proportion of tosses that land "heads"). We can work this out by tossing the coin $N$ times and observing $H$ heads.
The bias (the expected proportion of heads) can be estimated as $\mu = \frac{H}{N}$, which is the mean value if we treat each "heads" result as $1$ and each "tails" as $0$. The standard deviation is $\sigma = \sqrt{\frac{H\times(N-H)}{N}}$
I'm wondering what happens if we "go up a level" to talk about the bias of a coin factory. Let's say a coin factory produces a set of coins $C$: the bias $\mu_c$ of each coin $c \in C$ is constant (but unknown) across all the tosses of that coin; the biases of different coins may vary, due to stochastic processes in the factory's production line.
We want to estimate the mean and standard deviation of coins produced by the factory, based on observations of the coins $C$ it has previously produced. For each $c \in C$, we have observed $H_c$ heads occur in $N_c$ tosses (these may both differ between coins).
Here's my approach to solving this:
To combine the estimates from each coin, we might think about using the ratio of the averages (RoA):
$$RoA = \frac{\sum_{c \in C}{H_c}}{\sum_{c \in C}{N_c}}$$
RoA would be appropriate if the biases of each toss were independent (so grouping them per coin is unnecessary), or to answer a question like "how much influence has the factory's bias had on our bets" (in some hypothetical coin-tossing casino).
For this question RoA seems inappropriate, since each coin acts like a single sample of the factory; if some $c$ has larger $H_c$ and $N_c$ values it tells us more about that coin, but doesn't alter how representative the coin is of the factory.
I think the best method is to just take the average of the ratios (AoR):
$$AoR = \frac{\sum_{c \in C}{\mu_c}}{|C|} = \frac{\sum_{c \in C}{\frac{H_c}{N_c}}}{|C|}$$
However, I don't know how we'd estimate the standard deviation for this, e.g. whether to combine those of the coins in some way, or whether to go down to the level of the tosses.