Why the Site Structure Matters
Suppose a researcher measures a chemical concentration in several soil samples collected at each of a few field sites. The measurements from samples at one site share a location, so they are not interchangeable with measurements from independent sites. The analysis must reflect the way the data were collected: samples are nested within sites, and conclusions about differences among sites must use the variation among samples within sites as their error basis.
A further distinction matters when each collected sample is measured more than once. Repeated laboratory readings can describe measurement variation, but they do not create more independently sampled field units. A nested model can separate those two sources of variation and prevent technical repeats from being mistaken for independent samples.
Design, Model, and Assumptions
Let \(i=1,\ldots,a\) index sites, \(j=1,\ldots,b_i\) index samples within site \(i\), and \(k=1,\ldots,m_{ij}\) index repeated readings of sample \(j\) at site \(i\). A standard model for comparing specified sites while accounting for sample-to-sample variation is
Here \(Y_{ijk}\) is a measured response, \(\mu\) is an overall mean, and \(\alpha_i\) is the fixed effect of site \(i\), with a constraint such as \(\sum_i\alpha_i=0\). The sample effect \(u_{j(i)}\) represents variation among samples within a site, and \(\varepsilon_{k(ij)}\) represents variation among repeated readings of the same sample. A common random-effects specification is \(u_{j(i)}\sim N(0,\sigma_u^2)\) and \(\varepsilon_{k(ij)}\sim N(0,\sigma^2)\), independently. Site effects are parameters for the named sites; the model does not, by itself, treat sites as a random sample from all possible sites.
The model assumes independent sample selection within sites, independent errors at their respective levels, and normally distributed sample and reading errors. The variances at each level are assumed common across sites. The design and measurement process should support these assumptions; plots of residuals and knowledge of how the samples were obtained can help assess whether serious departures are plausible.
If each physical sample contributes just one response, there is no separate repeated-reading level to estimate. The model reduces to \(Y_{ij}=\mu+\alpha_i+\varepsilon_{j(i)}\), where the within-site sample deviations are the error term for comparing fixed sites. The examples below show both situations.
Choosing the Error Term
With repeated readings, a site mean averages over both sampled units and readings. The site effect is tested against the sample-within-site mean square, not against the mean square for repeated readings. The reason is that the site comparison must allow for the fact that different samples from the same site can have different responses.
For a balanced design, each site has \(b\) samples and each sample has \(m\) readings. Dividing the expected sample-within-site mean square by \(bm\) gives \(\sigma_u^2/b+\sigma^2/(bm)\), exactly the variance of a site mean under the model. Thus, for a difference between two site means, the estimated standard error is \(\sqrt{2MS_{\text{sample(site)}}/(bm)}\). Under the normal model and the null hypothesis of equal fixed site means, the site F statistic uses \(MS_{\text{sample(site)}}\) in its denominator, with \(a-1\) and \(a(b-1)\) degrees of freedom in a balanced design. The reading-level mean square estimates the lower-level measurement variation; it is not the denominator for the site test.
If there is one response per sample, sample-within-site variation is simply the within-site residual variation. For an unbalanced design with unequal numbers of samples, the usual one-way fixed-effects ANOVA uses the within-site mean square for testing site equality under the common-variance normal model, but the degrees of freedom and standard errors reflect the actual sample counts. The balanced repeated-reading formulas above should not be applied as if all counts were equal.
Worked Example: Comparing Three Sites With Repeated Readings
In a hypothetical soil study, two laboratory readings are made on each of three independently collected samples at each of three specified sites. Concentration is measured in mg/L. The two readings for each sample are one mg/L below and one mg/L above the sample mean shown below.
| Site | Sample means (mg/L) | Site mean (mg/L) |
|---|---|---|
| A | 10, 12, 11 | 11 |
| B | 14, 15, 13 | 14 |
| C | 12, 11, 13 | 12 |
Check the design. There are \(a=3\) fixed sites, \(b=3\) samples per site, and \(m=2\) readings per sample. The samples are the independently collected field units; the duplicate readings are technical repeats. Assume samples were independently selected within each site, and that sample and reading errors are independent, approximately normal, and have common variances across sites.
The grand mean is \((33+42+36)/9=12.333\) mg/L. The site sum of squares is
For sample-within-site variation, the squared deviations of the sample means from their own site means sum to \(2+2+2=6\). Each sample mean represents two readings, so \(SS_{\text{sample(site)}}=2(6)=12\). Within each sample the readings are one unit from their sample mean; each pair contributes \(1^2+(-1)^2=2\), giving \(SS_{\text{reading(sample)}}=9(2)=18\).
The degrees of freedom are \(2\) for site, \(3(3-1)=6\) for sample within site, and \(9(2-1)=9\) for readings within samples. Therefore \(MS_{\text{site}}=28/2=14\), \(MS_{\text{sample(site)}}=12/6=2\), and \(MS_{\text{reading(sample)}}=18/9=2\). The site test is
At \(\alpha=0.05\), this provides evidence that not all three specified site means are equal. It does not establish that every pair of sites differs, nor does it justify generalizing to all sites. The denominator has six degrees of freedom because the independent samples within sites, not the repeated readings, supply the replication for comparing sites.
Comparing Site Means
After testing for an overall site difference, a researcher may estimate or test a specific comparison. For a planned difference between two site means in the balanced repeated-reading model, the estimate is \(\bar{Y}_{i\cdot\cdot}-\bar{Y}_{i'\cdot\cdot}\) and its standard error is \(\sqrt{2MS_{\text{sample(site)}}/(bm)}\). A t test for a prespecified comparison uses \(a(b-1)\) degrees of freedom. If many pairs are examined, the comparison procedure should account for multiple testing; an unadjusted t test for every pair does not preserve the intended overall error rate.
Worked Example: Estimating a Prespecified Difference Between Two Sites
In a separate hypothetical study, four independently collected samples are taken at each of two specified sites, and each sample is read twice. The sample means at Site East are 20, 22, 21, and 21 mg/L; those at Site West are 24, 25, 23, and 24 mg/L. Each pair of readings is one unit below and above its sample mean. The sample means are 21 mg/L for East and 24 mg/L for West.
Assume the samples were independently selected within each site and that sample and reading errors satisfy the independent, normal, common-variance assumptions. The squared sample-mean deviations within East sum to \(2\), and those within West sum to \(2\). With two readings per sample, \(SS_{\text{sample(site)}}=2(2+2)=8\), with \(df=2(4-1)=6\), so \(MS_{\text{sample(site)}}=8/6=1.333\) \((\text{mg/L})^2\). For the prespecified contrast East minus West, the estimated difference is \(21-24=-3\) mg/L. Its standard error is
The test statistic is \(t=-3/0.5774=-5.196\), with \(df=6\); the two-sided p-value is about \(0.0020\). A 95% confidence interval uses \(t^*_{0.975,6}=2.447\):
Under the model, the data support a lower mean concentration at East than at West, with the estimated East-minus-West difference between about \(-4.41\) and \(-1.59\) mg/L. This interval describes uncertainty in the mean difference for these specified sites; it is not a range expected to contain most individual sample measurements.
One Response per Sample and Unequal Sample Counts
When each physical sample supplies one response, the sample-within-site deviations are the residuals for the fixed-site comparison. The analysis is then a one-way ANOVA in which the observations are grouped by site. Unequal sample counts do not change the meaning of the error term, but they do affect the site means, sums of squares, and standard errors. In particular, a site with more independent samples generally contributes a more precise estimate of its mean, assuming the model is suitable.
Worked Example: Comparing Sites With Unequal Numbers of Samples
A hypothetical water-quality survey records one independent sample response at each sampling unit. The concentrations (mg/L) are Site A: 8, 10, 9; Site B: 12, 13, 11, 12; and Site C: 10, 9, 11. The three named sites are the fixed levels of interest. Assume independent sample selection, approximately normal within-site errors, and a common within-site variance.
The site means are 9, 12, and 10 mg/L, and the grand mean is \(105/10=10.5\) mg/L. The between-site sum of squares is
The within-site squared deviations sum to \(2\) at A, \(2\) at B, and \(2\) at C, so \(SS_{\text{within}}=6\). There are \(10-3=7\) within-site degrees of freedom. Thus \(MS_{\text{within}}=6/7=0.8571\), while \(MS_{\text{site}}=16.5/2=8.25\). The test statistic and approximate p-value are
At the 0.05 significance level, the results provide evidence that the mean concentration is not the same at all three specified sites. The conclusion is conditional on the assumed common within-site variance and on the sites being the intended targets. The result alone does not identify which site means differ; a suitable follow-up comparison is needed for that question.
What the Conclusion Can—and Cannot—Say
The scope of a site comparison follows the sampling design. If the sites are deliberately selected locations and the scientific question concerns those locations, treating site as fixed supports conclusions about those named sites. If sites were themselves sampled from a larger population of locations, inference about that population requires a model that treats site as random and reflects the additional site-to-site variation. Several samples taken at one location cannot substitute for independently sampled locations when the target is a wider population of sites.
Likewise, repeated readings on one physical sample primarily improve knowledge of that sample’s measured response. They do not increase the number of independent field samples. Report the number of sites, independent samples per site, and repeated readings per sample separately so readers can see what supplies replication at each level.
Common Mistake
- Wrong reasoning: “There are two laboratory readings for each sample, so there are twice as many independent samples for comparing sites.”
- Correction: The readings share the same collected sample. In a nested model with repeated readings, test site effects against sample-within-site variation. The reading-level error term describes repeat-measurement variation and does not supply independent replication for a site comparison.
- Wrong reasoning: “A significant overall site test proves that every pair of sites is different.”
- Correction: The overall test indicates evidence that at least one site mean differs. Pairwise claims require appropriate comparisons, with adjustment when many comparisons are made.
Check Your Understanding
Use the design structure, not just the total number of recorded readings, to answer these questions.
- A researcher takes five soil samples at each of four sites and measures each sample three times. What are the independent field units, and which variation supplies replication for comparing the four sites?
- In a balanced design with \(a\) sites, \(b\) samples per site, and \(m\) readings per sample, what are the degrees of freedom for site and sample within site?
- Why is the reading-level mean square not the denominator for the site F test in a repeated-reading nested model?
- A study uses one response per sample and finds a significant overall site test. What does this establish, and what does it not establish about individual pairs?
- If the research question concerns a population of locations rather than only the named locations sampled, what feature of the model must reflect the site-sampling process?