Why Calculate Cell Means?
In a two-factor experiment, each experimental unit receives one joint condition: one level of the first factor and one level of the second. A cell is the group of observations from units assigned to that particular treatment combination. When a combination has multiple genuine replicate units, its sample cell mean summarizes their responses with one value.
For example, a hypothetical experiment might compare two fertilizer types at two watering levels. The observation from a plant receiving fertilizer A and low water belongs to a different cell from an observation from a plant receiving fertilizer A and high water. The cell mean for the first combination is calculated using only the replicate plants in that cell. It is not an average over all plants receiving fertilizer A, nor an average over every plant in the experiment.
This tutorial focuses on carrying out that calculation accurately and keeping the result attached to the correct combination. The calculation is descriptive: it does not, by itself, test a hypothesis or establish that two treatment combinations differ in the population.
Set Up the Data Before Averaging
A reliable calculation starts with a clear record of which observation belongs to which treatment combination. For two factors, the pair of level labels identifies the cell. The replicate index \(k\) distinguishes observations within that cell; it does not identify another factor or another treatment combination.
A convenient notation is \(x_{ijk}\): the first subscript gives the A level, the second gives the B level, and the third gives the replicate within that combination. Thus \(x_{231}\) means replicate 1 in the cell formed by A level 2 and B level 3. Its cell mean is \(\bar{x}_{23}\), because the mean is indexed by the two factor levels, not by an individual replicate.
A treatment table can help prevent observations from being mixed across cells. Put the levels of one factor in the rows and the levels of the other factor in the columns. Each table entry should first show the observations for that combination; after calculation, it can show the cell mean. The row and column labels are part of the answer: an accurate number placed in the wrong cell is still an incorrect result.
The arithmetic does not require normally distributed responses. It does require correctly identified observations and a well-defined response variable measured on a scale where averaging is meaningful. If the observations are being treated as replicates for an experiment, they must also correspond to the appropriate independently assigned experimental units; repeated measurements or subsamples should not be counted as independent treatment replicates just because there are several recorded values.
Worked Example: A Two-by-Two Dataset
Suppose, hypothetically, that researchers assign independent plants to each combination of two fertilizer types (A and B) and two watering levels (low and high). They record plant height after a fixed period, in centimeters. The four heights in the A, low-water cell are 18, 20, 22, and 20 cm. The heights in the other cells are shown below.
| Fertilizer | Low water (cm) | High water (cm) |
|---|---|---|
| A | 18, 20, 22, 20 | 24, 25, 23, 28 |
| B | 21, 23, 22, 26 | 30, 32, 29, 33 |
Each cell has \(n_{ij}=4\) plants, so each sum is divided by 4. For fertilizer A and low water,
For fertilizer A and high water, the sum is \(24+25+23+28=100\), giving
For fertilizer B and low water, the sum is \(21+23+22+26=92\), so \(\bar{x}_{21}=92/4=23.0\) cm. For fertilizer B and high water, the sum is \(30+32+29+33=124\), so \(\bar{x}_{22}=124/4=31.0\) cm.
The organized result is therefore:
| Fertilizer | Low water: sample cell mean (cm) | High water: sample cell mean (cm) |
|---|---|---|
| A | 20.0 | 25.0 |
| B | 23.0 | 31.0 |
For example, \(\bar{x}_{22}=31.0\) cm describes the sample mean for plants receiving fertilizer B and high water. It does not say that every such plant reached 31.0 cm, and it is not the population mean \(\mu_{22}\).
A Repeatable Calculation
For any cell, the operation is the same: identify the factor-level pair, list all observations belonging to that pair, count them, add them, and divide by that count. The count in the denominator must match the observations actually included in the numerator.
Record the row and column factor clearly so each treatment combination can be identified unambiguously.
Include the observations from that exact pair of factor levels, and no observations from other combinations.
Write down \(n_{ij}\) and the sum of the \(n_{ij}\) responses. These two quantities should refer to the same set of observations.
Calculate \(\bar{x}_{ij}=\text{cell sum}/n_{ij}\), then enter it in the table location bearing that cell's factor-level labels.
Confirm that every observed value was assigned once to the correct cell, and report the mean in the response's units.
A short derivation explains why the sum is divided by the number of observations. The arithmetic mean is the value \(m\) that minimizes the sum of squared deviations from the observations in that cell. For \(n\) values \(x_1,\ldots,x_n\), define \(Q(m)=\sum_{k=1}^{n}(x_k-m)^2\). Differentiating and setting the derivative equal to zero gives
Because \(Q''(m)=2n>0\), this value is a minimum. Applying the result to the observations in just one treatment combination gives the sample cell-mean formula. This justification concerns the mean within a cell; it does not combine cells or compare their means.
Worked Example: Calculating Means With Unequal Cell Counts
Consider a hypothetical study of a measurement in millimeters for two device settings and two room conditions. The recorded values are:
| Setting | Cool room (mm) | Warm room (mm) |
|---|---|---|
| Setting 1 | 12, 14, 13 | 16, 18 |
| Setting 2 | 15, 17 | 20, 22, 21 |
The cell counts are not all the same: there are three observations for setting 1 in the cool room, two for setting 1 in the warm room, two for setting 2 in the cool room, and three for setting 2 in the warm room. Calculate each mean using its own count.
For setting 1 in the cool room, \(n_{11}=3\), and the sum is \(12+14+13=39\). Thus \(\bar{x}_{11}=39/3=13.0\) mm. For setting 1 in the warm room, \(n_{12}=2\), and the sum is \(16+18=34\). Thus \(\bar{x}_{12}=34/2=17.0\) mm.
For setting 2 in the cool room, \(n_{21}=2\), and the sum is \(15+17=32\), so \(\bar{x}_{21}=32/2=16.0\) mm. For setting 2 in the warm room, \(n_{22}=3\), and the sum is \(20+22+21=63\), so \(\bar{x}_{22}=63/3=21.0\) mm.
| Setting | Cool room: sample cell mean (mm) | Warm room: sample cell mean (mm) |
|---|---|---|
| Setting 1 | 13.0 | 17.0 |
| Setting 2 | 16.0 | 21.0 |
The calculation uses each cell's own denominator. The fact that the cell counts differ does not change the definition of a cell mean. It does make it especially important not to divide every cell sum by one common count.
Checks That Catch Common Errors
A few simple checks make a cell-mean table more dependable. First, check the response units: if observations are recorded in millimeters, their mean is also in millimeters. Second, check that each mean lies between the smallest and largest observation in its cell. An arithmetic mean of 12, 14, and 13 cannot be 18 because 18 is outside the observed range. Third, keep enough precision during calculation and round only when reporting the result.
It can also help to track each cell's count and sum alongside its mean. For example, a cell with values 4, 7, and 10 has count 3, sum 21, and mean 7. If the reported mean is 5, the count and sum reveal a likely addition or division error. When all observations are assigned to exactly one cell, the sum of the cell counts should equal the total number of observations in the dataset.
Remember that the table entries are summaries of groups of replicate observations. An individual recorded response remains an observation, while the mean is one calculated summary for that cell. Keeping those distinct prevents a mean from being treated as though it were an extra observed replicate.
Worked Example: Verify and Interpret a Cell-Mean Table
Worked Example: Verify and Interpret a Cell-Mean Table
Suppose, hypothetically, that an experiment records the time in minutes required to complete a task under two lighting conditions and two background-noise conditions. The recorded times are:
| Lighting | Quiet (min) | Noisy (min) |
|---|---|---|
| Bright | 8, 10, 9 | 12, 11, 13 |
| Dim | 11, 12, 10 | 15, 14, 16 |
For bright lighting and quiet, the count is 3 and the sum is \(8+10+9=27\), so the sample cell mean is \(27/3=9.00\) minutes. For bright lighting and noisy, \(12+11+13=36\), giving \(36/3=12.0\) minutes.
For dim lighting and quiet, the sum is \(11+12+10=33\), giving \(33/3=11.0\) minutes. For dim lighting and noisy, the sum is \(15+14+16=45\), giving \(45/3=15.0\) minutes. The means and their labels are:
| Lighting | Quiet: sample cell mean (min) | Noisy: sample cell mean (min) |
|---|---|---|
| Bright | 9.00 | 12.0 |
| Dim | 11.0 | 15.0 |
Each mean falls between the smallest and largest observation in its cell, and each cell has the same count of three. The 12.0-minute entry means that the three hypothetical observations under bright lighting and noisy conditions averaged 12.0 minutes. It does not mean that each task took exactly 12.0 minutes or that the population mean is known to be 12.0 minutes.
Calculating cell means matters because it turns a scattered list of replicate responses into a compact summary that still preserves the treatment-combination labels. That organization is useful for describing the observed data and for later factorial analyses, where cell-specific summaries have a clear role. At this stage, the essential discipline is modest but important: group by both factor levels, average only within that group, and keep the resulting number attached to the correct cell.
Check Your Understanding
Answer each question using the definitions and procedures above.
- In \(x_{ijk}\), what does each of the three subscripts identify?
- A cell contains the responses 5, 8, 11, and 12 seconds. Calculate its sample cell mean and state its units.
- Why should cells with different numbers of observations use their own counts as the denominator?
- Three replicate observations in one cell are 7, 9, and 11. A student reports a cell mean of 9 and calls it an additional replicate. Identify the distinction the student has missed.
- What is one check that can reveal a cell mean entered in the wrong units or calculated incorrectly?