Tutorials › ANOVA › A Complete RCBD Analysis From Raw Data

Analyzing Randomized Complete Block Data · Tutorial 144 of 595

A Complete RCBD Analysis From Raw Data

Learn to carry a balanced randomized complete block analysis from raw observations through its treatment test and contextual conclusion.

Intermediate 12 min read

What You'll Learn

  • Organize raw observations and calculate treatment, block, and grand totals
  • Compute the correction factor and the total, treatment, block, and error sums of squares
  • Assemble degrees of freedom and mean squares in an RCBD ANOVA table
  • Calculate and interpret the treatment F statistic and upper-tail p-value
  • Check the model conditions that make the treatment test appropriate
  • Avoid common arithmetic and interpretation errors in a complete analysis

From Raw Observations to a Treatment Conclusion

A randomized complete block design (RCBD) records a response for each combination of treatment and block: every block receives every treatment, with one observation for each treatment within each block. The goal of a complete analysis is to move carefully from those raw observations to the sums of squares, the ANOVA table, and a treatment conclusion. Keeping the raw data visible throughout helps catch arithmetic errors that can dramatically change the result.

The calculations below use a balanced design with \(t\) treatments and \(b\) blocks, so there are \(tb\) observations. Before interpreting the treatment test, specify the model and the conditions it requires.

Model and assumptions: Write the response for treatment \(i\) in block \(j\) as \(Y_{ij}=\mu+\tau_i+\beta_j+\epsilon_{ij}\), for \(i=1,\ldots,t\) and \(j=1,\ldots,b\). The \(\tau_i\) are treatment effects and the \(\beta_j\) are block effects; for identifiability, use \(\sum_i\tau_i=0\) and \(\sum_j\beta_j=0\). The standard RCBD F test assumes an additive model, independent errors with mean zero and common variance \(\sigma^2\), and normally distributed errors. Treatment assignment must follow the design, with every treatment represented once in every block. The errors are the deviations from the additive treatment-plus-block fit.

Independence is supported by the way experimental units are sampled or assigned, not established by the arithmetic. Residual plots can help assess whether the additive, constant-variance, and normal-error assumptions are reasonable, though a small dataset cannot verify them conclusively. The standard analysis also requires a complete balanced table; the formulas here are for that setting.

The Calculation Plan

Let \(y_{ij}\) denote the observed response, \(T_i=\sum_j y_{ij}\) the total for treatment \(i\), \(B_j=\sum_i y_{ij}\) the total for block \(j\), and \(G=\sum_i\sum_j y_{ij}\) the grand total. The correction factor \(C=G^2/(tb)\) puts the raw squared observations and the marginal totals on a common basis.

$$ SS_{\text{Total}}=\sum_i\sum_j y_{ij}^2-C,\qquad SS_{\text{Treatment}}=\frac{\sum_i T_i^2}{b}-C,\qquad SS_{\text{Block}}=\frac{\sum_j B_j^2}{t}-C $$

The remaining variation is assigned to error:

$$ SS_{\text{Error}}=SS_{\text{Total}}-SS_{\text{Treatment}}-SS_{\text{Block}}. $$

This subtraction is not a shortcut that ignores the observations: it follows from the RCBD sum-of-squares decomposition. In a complete balanced table, variation about the grand mean separates into treatment variation, block variation, and residual variation about the fitted additive model.

Degrees of freedom: The total has \(tb-1\) degrees of freedom, treatment has \(t-1\), blocks have \(b-1\), and error has \((t-1)(b-1)\). The components add up because \((t-1)+(b-1)+(t-1)(b-1)=tb-1\). A mean square is its sum of squares divided by its degrees of freedom.

For the treatment test, the null hypothesis is that all treatment means are equal; the alternative is that at least one differs. The statistic compares treatment variation per degree of freedom with error variation per degree of freedom:

$$ F=\frac{MS_{\text{Treatment}}}{MS_{\text{Error}}},\qquad MS_{\text{Treatment}}=\frac{SS_{\text{Treatment}}}{t-1},\qquad MS_{\text{Error}}=\frac{SS_{\text{Error}}}{(t-1)(b-1)}. $$

When the model assumptions hold and \(H_0\) is true, this statistic follows an F distribution with \(t-1\) and \((t-1)(b-1)\) degrees of freedom. The p-value is the probability, under that null model, of obtaining an F statistic at least as large as the observed one.

Worked Example: Two Treatments in Three Blocks

Suppose, hypothetically, that a researcher compares two procedures for improving a score, measured in points. Three blocks each contain two comparable experimental units, and within each block the two procedures are randomly assigned, one per unit. The observed scores are:

ProcedureBlock 1Block 2Block 3Treatment total
A8101230
B12162048
Block total202632Grand total: 78

There are \(t=2\) treatments, \(b=3\) blocks, and \(tb=6\) scores. The table is complete, and the described within-block random assignment matches an RCBD. The standard test additionally assumes independent, normally distributed errors with common variance and an additive treatment-plus-block pattern. Those assumptions cannot be confirmed from six observations; the calculation and conclusion must be read as conditional on them.

1. Correction factor and total sum of squares. The squared observations sum to \(8^2+10^2+12^2+12^2+16^2+20^2=1108\). The correction factor is:

$$ C=\frac{78^2}{6}=\frac{6084}{6}=1014,\qquad SS_{\text{Total}}=1108-1014=94\text{ points}^2. $$

2. Treatment and block sums of squares. Each treatment total contains \(b=3\) observations, and each block total contains \(t=2\):

$$ SS_{\text{Treatment}}=\frac{30^2+48^2}{3}-1014 =\frac{900+2304}{3}-1014=1068-1014=54\text{ points}^2, $$
$$ SS_{\text{Block}}=\frac{20^2+26^2+32^2}{2}-1014 =\frac{400+676+1024}{2}-1014=1050-1014=36\text{ points}^2. $$

3. Error sum of squares and degrees of freedom. The unexplained variation is \(94-54-36=4\text{ points}^2\). The degrees of freedom are \(1\) for treatment, \(2\) for blocks, \(2=(2-1)(3-1)\) for error, and \(5\) total. They add to \(1+2+2=5\).

SourceSS (points squared)dfMS (points squared)F
Treatment5415427
Blocks36218
Error422
Total945

4. Treatment test and conclusion. The treatment means are \(30/3=10\) points for A and \(48/3=16\) points for B. Thus \(MS_{\text{Treatment}}=54/1=54\text{ points}^2\), \(MS_{\text{Error}}=4/2=2\text{ points}^2\), and \(F=54/2=27\), with \((1,2)\) degrees of freedom. The upper-tail p-value is approximately \(0.0351\). At \(\alpha=0.05\), this provides evidence against equal treatment means. In context, the estimated mean score for B is 6 points higher than for A; the test supports a difference, subject to the model assumptions. It does not establish that the procedures would have the same effects in other settings.

The treatment differences within the three blocks are 4, 6, and 8 points. Their variation is a reason to be cautious about the additive-model assumption; a single observation per treatment-block combination does not separately estimate treatment-by-block interaction. The reported test is therefore an additive RCBD analysis, not a demonstration that additivity holds.

Why the Decomposition Works

The formula for \(SS_{\text{Error}}\) is justified by the balanced design. Let \(\bar{y}_{i\cdot}=T_i/b\) be a treatment mean, \(\bar{y}_{\cdot j}=B_j/t\) a block mean, and \(\bar{y}_{\cdot\cdot}=G/(tb)\) the grand mean. The residual for a cell is the observed value minus its fitted additive value:

$$ e_{ij}=y_{ij}-\bar{y}_{i\cdot}-\bar{y}_{\cdot j}+\bar{y}_{\cdot\cdot}. $$

For every treatment, its residuals sum to zero across blocks: \(\sum_j e_{ij}=0\). For every block, its residuals sum to zero across treatments: \(\sum_i e_{ij}=0\). These zero sums make the residual component orthogonal to the treatment and block deviations in a balanced table. Consequently, expanding the squared deviations from the grand mean gives:

$$ \sum_i\sum_j(y_{ij}-\bar{y}_{\cdot\cdot})^2 = \sum_i\sum_j(\bar{y}_{i\cdot}-\bar{y}_{\cdot\cdot})^2 + \sum_i\sum_j(\bar{y}_{\cdot j}-\bar{y}_{\cdot\cdot})^2 + \sum_i\sum_j e_{ij}^2. $$

The three terms are respectively \(SS_{\text{Treatment}}\), \(SS_{\text{Block}}\), and \(SS_{\text{Error}}\). This explains why subtracting the first two components from the total gives the residual component. It also shows the role of balance: the treatment and block deviations separate cleanly in this decomposition.

Worked Example: A Three-Treatment ANOVA Table

Consider a second hypothetical experiment comparing three treatments across three blocks. Each response is measured in the same units, and the raw values are:

TreatmentBlock 1Block 2Block 3Treatment total
A57820
B781025
C8101230
Block total202530Grand total: 75

Assume treatments were randomized within each block and the observations are independent, with a common-variance normal error model and additive treatment and block effects. The table is complete and balanced: \(t=3\), \(b=3\), \(N=9\). The squared observations sum to \(659\), so \(C=75^2/9=625\) and \(SS_{\text{Total}}=659-625=34\).

The treatment and block sums of squares are:

$$ SS_{\text{Treatment}}=\frac{20^2+25^2+30^2}{3}-625 =\frac{1925}{3}-625=16.6667, $$
$$ SS_{\text{Block}}=\frac{20^2+25^2+30^2}{3}-625 =\frac{1925}{3}-625=16.6667. $$

Thus \(SS_{\text{Error}}=34-16.6667-16.6667=0.6667\). The degrees of freedom are \(2\) for treatment, \(2\) for blocks, \(4\) for error, and \(8\) total. Therefore \(MS_{\text{Treatment}}=16.6667/2=8.3333\) and \(MS_{\text{Error}}=0.6667/4=0.1667\), giving \(F=8.3333/0.1667=50\) with \((2,4)\) degrees of freedom. The upper-tail p-value is approximately \(0.00148\). Under the stated assumptions, this is evidence that not all three treatment means are equal. The overall test does not identify which specific means differ.

Reading the Table Without Losing the Context

A treatment F test answers an overall question: whether the data are inconsistent with equal treatment means under the RCBD model. It does not say that every pair of treatments differs, and a small p-value is not a measure of how large or important the treatment effect is. Report the treatment means or their differences in the response's units alongside the test result when describing the pattern.

Blocking has its own row in the table because differences among blocks account for variation. The block F statistic is not the treatment test, and a large block sum of squares does not itself establish a treatment effect. For the treatment test, the denominator is specifically \(MS_{\text{Error}}\), not \(MS_{\text{Block}}\) and not the total mean square.

Worked Example: A Small Difference and Its Test

In a third hypothetical balanced experiment, two methods are compared in three blocks, with outcomes in points:

MethodBlock 1Block 2Block 3Treatment total
A10121133
B11121235
Block total212423Grand total: 68

Suppose the methods were randomly assigned within each block, with independent observations and the additive, normal, common-variance error model considered reasonable. Here \(t=2\), \(b=3\), and the sum of squared observations is \(774\). The correction factor is \(C=68^2/6=770.6667\), giving \(SS_{\text{Total}}=774-770.6667=3.3333\).

The treatment sum of squares is \((33^2+35^2)/3-770.6667=2314/3-770.6667=0.6667\text{ points}^2\). The block sum of squares is \((21^2+24^2+23^2)/2-770.6667=1546/2-770.6667=2.3333\text{ points}^2\). Hence \(SS_{\text{Error}}=3.3333-0.6667-2.3333=0.3333\text{ points}^2\).

The treatment, block, error, and total degrees of freedom are \(1,2,2,\) and \(5\). The mean squares are \(0.6667/1=0.6667\text{ points}^2\) for treatment and \(0.3333/2=0.1667\text{ points}^2\) for error. Therefore \(F=0.6667/0.1667=4\), with \((1,2)\) degrees of freedom, and the upper-tail p-value is approximately \(0.1835\). At \(\alpha=0.05\), there is not sufficient evidence of a difference in mean scores. The observed means are 11 and 11.6667 points, but this test does not establish that the population treatment means are equal.

Common Mistakes to Avoid

  • Using an incorrect sum of squares. Square each observation and check the arithmetic before subtracting the correction factor. An error in one squared value changes the error sum of squares and can alter the treatment F statistic.
  • Dividing marginal totals by the wrong number. Treatment totals are each based on \(b\) observations, so divide their squared totals by \(b\). Block totals are each based on \(t\) observations, so divide their squared totals by \(t\).
  • Using the block mean square as the treatment denominator. The standard treatment statistic is \(MS_{\text{Treatment}}/MS_{\text{Error}}\). The block row accounts for block variation; it is not the error term for this test.
  • Calling a nonsignificant result proof of no effect. A large p-value says the data do not provide sufficient evidence against the null at the chosen significance level. It does not prove the treatment means are equal.
  • Ignoring the model. The table's calculations do not guarantee independent, constant-variance, normal errors or additivity. The F-test conclusion is conditional on these assumptions being reasonable.
Key takeaway: A reliable complete RCBD analysis follows a checkable chain: raw observations, marginal totals, correction factor, sums of squares, degrees of freedom, mean squares, and the treatment F test. Verify each link, then state the treatment conclusion in the response's units and in the context of the model assumptions.

Check Your Understanding

Use the ideas and calculations in this tutorial to answer the following questions.

  1. In an RCBD with four treatments and five blocks, how many observations are there, and what are the treatment, block, error, and total degrees of freedom?
  2. Why does the treatment sum-of-squares formula divide squared treatment totals by the number of blocks?
  3. For the two-treatment example, identify the treatment F statistic's numerator and denominator mean squares. Why is the block mean square not the denominator?
  4. What does a treatment-test p-value of \(0.0351\) mean when the null hypothesis is that the treatment means are equal?
  5. Why does a significant overall treatment test not show that every pair of treatment means differs?
Clinical Biostats