Averages of averages (of averages, of averages…)

Consider the following cell biology experiment. We are comparing $T$ different treatments of cultured cells. Each treatment $t$ is replicated in several (microtiter) wells, indexed by the variable $w \in \{1, 2, \cdots, W\}$. To measure the response to the treatment in well $w$, a total of $F_w$ non-overlapping micrographs, or fields, are recorded. Then, for each field $f$ in well $w$, a total of $C_{wf}$ cells are identified computationally, whereby each cell $c$ (in well $w$, field $f$) is represented by a set of $P_{wfc}$ pixels. Finally, associated with each pixel $p$ is a measurement $x_{wfcp}$ (derived from the intensities of various fluorescence signals recorded at that pixel).

The problem is to aggregate all the pixel measurements $x_{wfcp}$ to produce a "reasonable measure" $X_t$ of the effect of the treatment $t$ on the cells treated with it, as well as some measure of the "spread" of $X_t$.

The standard approach to such problems is to use the mean as "the measure" and the variance (or standard deviation) as "the spread". In this case, however, there are multiple, non-equivalent ways in which means and variances could be computed.

Focusing for now on the means, at one extreme, one could simply add up the $x_{wfcp}$ over all the pixels (disregarding their distribution over cells, fields, and wells), and divide this sum by the total number of pixels $P$ (for treatment $t$):

$$\frac{1}{P}\sum_{w=1}^W\sum_{f=1}^{F_w}\sum_{c=1}^{C_{wf}}\sum_{p=1}^{P_{wfc}} x_{wfcp}$$

At the opposite extreme, we could average at each level: first compute the average $x_{wfc}$ of $x_{wfcp}$ for each cell, then compute average $x_{wf}$ of the $x_{wfc}$ for each field, and so on:

$$\frac{1}{W}\sum_{w=1}^W \left[\frac{1}{F_w} \sum_{f=1}^{F_w} \left[\frac{1}{C_{wf}}\sum_{c=1}^{C_{wf}} \left[\frac{1}{P_{wfc}} \sum_{p=1}^{P_{wfc}} x_{wfcp}\right]\right]\right]$$

In general, these two expressions will not be equal. Plus there are several variations in-between. By my count, there are 8 ways of doing this (including the two above); I've listed all in their full glory at the end of this post. For example, one could compute this (number 6 in the list below):

$$\frac{1}{W}\sum_{w=1}^W \left[\frac{1}{C_w} \sum_{f=1}^{F_w} \sum_{c=1}^{C_{wf}} \left[\frac{1}{P_{wfc}} \sum_{p=1}^{P_{wfc}} x_{wfcp}\right]\right]$$

...where $C_w = \sum_f \sum_c \; 1$ is the total number of cells (summed over all fields of) well $w$. (The recipe encoded by this expression says: "compute the average value of $x_{wfcp}$ for each cell, namely $x_{wfc} = \left[\sum_p x_{wfcp}\right]/P_{wfcp}$; then, for each well $w$, compute the average of these $x_{wfc}$ averages over all the $C_w$ cells in well $w$—disregarding their distribution over fields—, namely $x_w = \left[ \sum_f \sum_c x_{wfc}\right]/C_w$; and, finally, average the $x_w$ over all $W$ wells, $\left[\sum_w x_w\right]/W$.")

Faced with all these different ways to "use averages" to measure the effect of treatment $t$, the immediate question is, of course, which one to choose? A sharper version of the question would be: how can I determine under which scenarios a given variant would be appropriate/informative/useful?

And, more generally: are there any pitfalls in computing averages of averages (of averages... )?

Thanks!

(corrections welcome) $$\small \begin{array}{lrl} 1. \;\; \frac{1}{P}\sum_{w=1}^W\sum_{f=1}^{F_w}\sum_{c=1}^{C_{wf}}\sum_{p=1}^{P_{wfc}} x_{wfcp} && && \\ 2. \;\; \frac{1}{W}\sum_{w=1}^W \left[\frac{1}{P_w} \sum_{f=1}^{F_w} \sum_{c=1}^{C_{wf}} \sum_{p=1}^{P_{wfc}} x_{wfcp}\right] && \mathrm{where} && P_w = \sum_{f=1}^{F_w}\sum_{c=1}^{C_{wf}}\sum_{p=1}^{P_{wfc}} \; 1 \\ 3. \;\; \frac{1}{F}\sum_{w=1}^W \sum_{f=1}^{F_w} \left[\frac{1}{P_{wf}}\sum_{c=1}^{C_{wf}} \sum_{p=1}^{P_{wfc}} x_{wfcp}\right] && \mathrm{where} && F = \sum_{w=1}^W \sum_{f=1}^{F_w} \; 1 \, , \, P_{wf} = \sum_{c=1}^{C_{wf}}\sum_{p=1}^{P_{wfc}} \; 1 \\ 4. \;\; \frac{1}{C}\sum_{w=1}^W \sum_{f=1}^{F_w} \sum_{c=1}^{C_{wf}} \left[\frac{1}{P_{wfc}} \sum_{p=1}^{P_{wfc}} x_{wfcp}\right] && \mathrm{where} && C = \sum_{w=1}^W \sum_{f=1}^{F_w} \sum_{c=1}^{C_{wf}} \; 1 \\ 5. \;\; \frac{1}{W}\sum_{w=1}^W \left[\frac{1}{F_w} \sum_{f=1}^{F_w} \left[\frac{1}{P_{wf}}\sum_{c=1}^{C_{wf}}\sum_{p=1}^{P_{wfc}} x_{wfcp}\right]\right] && && \\ 6. \;\; \frac{1}{W}\sum_{w=1}^W \left[\frac{1}{C_w} \sum_{f=1}^{F_w} \sum_{c=1}^{C_{wf}} \left[\frac{1}{P_{wfc}} \sum_{p=1}^{P_{wfc}} x_{wfcp} \right]\right] && \mathrm{where} && C_w = \sum_{f=1}^{F_w} \sum_{c=1}^{C_{wf}} \; 1 \\ 7. \;\; \frac{1}{F}\sum_{w=1}^W \sum_{f=1}^{F_w} \left[\frac{1}{C_{wf}}\sum_{c=1}^{C_{wf}} \left[\frac{1}{P_{wfc}} \sum_{p=1}^{P_{wfc}} x_{wfcp}\right]\right] && && \\ 8. \;\; \frac{1}{W}\sum_{w=1}^W \left[\frac{1}{F_w} \sum_{f=1}^{F_w} \left[\frac{1}{C_{wf}}\sum_{c=1}^{C_{wf}} \left[\frac{1}{P_{wfc}} \sum_{p=1}^{P_{wfc}} x_{wfcp}\right]\right]\right] && && \hspace{3in} \end{array}$$

-
You could do a nested anova to identify whether any of the treatment effects are significant. A good reference is Biometry by Sokal and Rholf. –  aaronjg Sep 5 '11 at 22:06
All of the equations at the bottom of the question are equal, because the arithmetic mean is a linear function. The fraction is scalar, so can be moved outside the sum in each case. The order of the sums is not important. All are equivalent to $$\frac{1}{WFCP}\sum^{W,F,C,P}_{w,f,c,p}x_{wfcp}$$. –  naught101 Oct 3 at 5:55
@naught101: I completely disagree. To begin with, the expression in your comment is not even consistent with the notation I've used in my question. –  kjo Oct 3 at 11:24
Have you tried calculating them? Note that there is one point I missed: you mention variance, and in that case (means of variance vs. variance of means) certainly is different, because variance isn't a linear operator (it has a sum of squares in it). –  naught101 Oct 3 at 13:30
add comment

1 Answer

This is not a direct answer to your question ('Which type of averaging to choose'), but rather a recommendation to avoid calculating averages at all:

Your scenario seems to look like a case for hierarchical/ multilevel models (MLM), as data are perfectly nested. You have three levels of random effects: pixels (Level 1) nested in cells (L2), nested in fields (L3), nested in wells (L4). Treatments should be treated as fixed effects.

You are only interested in the effect of treatment; the MLM method takes care of the different variances of each level and gives you also an estimate of how much variance is explained by which level. So you do not 'lose' any variance by treating an averaged value as 'the measurement', but you estimate the model on the level of raw data.

This method, however, calls for a sufficient number of groups for each random effect (i.e., enough pixels, enough cells, enough fields, enough wells). As you are not interested in cross level interactions, general recommendations say something like 10 to 30 units minimum (of course, depending on the specific scenario, etc.; see, e.g., here).

-
The first link you provided (hierarchical/multilevel models) seems broken now. –  steko Mar 23 at 21:43
add comment