Print this page and work through it on paper. Revealed answers are never printed, so you can check one question and still print a clean sheet.

  1. Show the solution to question 1

    (a) Group means and the grand mean. , , . The grand mean is the mean of all observations, which is the group means weighted by group size:

    The unweighted average gives Brand A's three observations the same weight as Brand B's five. The grand mean has to reproduce the total, and .

    Between. The group means sit at , and from the grand mean, so

    Within. Deviations from each group's own mean. Brand A: , squares summing to . Brand B: , sum . Brand C: , sum . So .

    (b) The table. Degrees of freedom are between and within. Then and , and

    In table form: Between — , df , ; Within — , df , ; Total — , df ; .

    Since , reject at the level: the three brands do not all have the same mean lifetime. That is all it says. The alternative is “not all equal”, so the test does not identify which brands differ, and it does not say that all three differ from each other — a post-hoc procedure is needed for that.

    (c) The identity as an arithmetic check. First, . Expanding the square, , so

    And ✓, by the decomposition of the total sum of squares. The degrees of freedom agree too: ✓.

    Effect size:

    About of the variation in lifetime is attributable to brand. That is a statement about how much brand matters. The -test answers only whether any difference exists, and with enough data it rejects for differences of no practical size; is what separates “detectable” from “large”.

  2. Show the solution to question 2

    (a) The grand mean. By definition is the total divided by . The total is a sum over groups of each group's total, and a group's total is by the definition of . So

    If every then and , the plain average.

    (b) Within mean square. By the definition of , group 's within sum of squares is . Summing over groups,

    Hence , which is a weighted average of the because the weights are positive and the denominator is their sum. With all the weights are all , so

    (c) Equal variances. If for every , then by (b)

    independently of the .

    When the sizes and the variances are both unequal, (b) says is pulled toward the variances of the large groups, since they carry most of the weight — so it understates the noise in the small groups if those are the more variable ones, and overstates it if they are the less variable ones.

  3. Show the solution to question 3

    (a) The three values. is the weighted average , with weights .

    (i) Weights and variances :

    the plain average of , and . It sits between the group variances, closer to the shared by two of the three groups.

    (ii) Weights and variances :

    The two small groups have variance , nearly four times .

    (iii) Weights and variances :

    The two small groups have variance ; overstates their noise by a factor of about .

    (b) Which way each design fails. In every design the variance ratio is , beyond the factor-of-four rule of thumb, so the difference between the designs is entirely the group sizes.

    (i) Approximately valid. With equal group sizes the weights are equal, is a fair average, and the -test is robust to unequal variances. The true level stays close to .

    (ii) Anti-conservative. This is the dangerous pairing: small groups with the large variances. The degrees of freedom of the tight group dominate , so any comparison that involves group 2 or 3 is divided by a denominator too small by almost a factor of four. comes out too large and the test rejects far more often than when is true.

    (iii) Conservative. The reverse pairing. The large group is the variable one and pulls up, so differences involving the small, tight groups are divided by a denominator that is far too large. The level is below nominal and power is lost; rejections that do occur are trustworthy, but real differences go undetected.

    (c) The recommendation. Use Welch's ANOVA for both (ii) and (iii), unconditionally. It estimates each group's variance separately and adjusts the degrees of freedom, exactly as Welch's -test does for two groups, and it costs almost nothing when the variances turn out to be equal.

    Testing for equal variances first and choosing the main test on the result is a two-stage procedure whose overall error rate nobody computes. It is also weak precisely where it is needed: with in two of the groups, Levene's test has little power even against a nine-fold variance ratio, so a non-rejection would say almost nothing. The group sizes are known before any data are collected, and unequal sizes are reason enough.

  4. Show the solution to question 4

    (a) Tukey. With equal group sizes,

    The six pairwise differences are , , , , and . Only exceeds : diets 1 and 4 differ. No other pair can be separated.

    The closest calls are and , both at , under the threshold by less than one unit. What may be said about them is only that the data do not separate them at familywise — not that those diets are equal. Failure to reject is not evidence of equality, and with the procedure has limited power.

    (b) Bonferroni. Six comparisons, each two-sided at , so each tail gets . The margin is

    That exceeds , and it had to. Bonferroni bounds the familywise rate by the union bound, which adds up the six comparisonwise rates as if the comparisons were unrelated; but they share the same four group means and the same , so the bound is slack. Tukey's HSD instead uses the exact distribution of the most extreme comparison — the studentised range — and achieves rather than staying under it. A threshold that only bounds the rate must be at least as strict as one that attains it. Here the two procedures reach the same conclusions (, nothing else does), but Bonferroni has less room to spare.

    (c) Uncorrected. The margin for a single two-sided -test at is

    Now , and all exceed it: and would be declared different in addition to — two extra claims, bought by abandoning the familywise guarantee.

    Treating the six comparisons as independent, the probability of at least one false rejection when all four diets are identical is about

    using , and . Roughly one experiment in four would report a spurious difference somewhere, which is the error rate the -test was built to avoid.

  5. Show the solution to question 5

    (a) The four errors.

    Step 1 mistakes non-rejection for confirmation, and uses a gatekeeper. A -value of does not establish equal variances; with only observations in two of the three groups, Levene's test has little power, and the observed variance ratio is four times the informal factor-of-four limit. Worse, deciding the main analysis on the outcome of a preliminary variance test makes the whole thing a two-stage procedure whose error rate is not the nominal one. Even a convincing Levene verdict would not license pooling here.

    Step 2 drops the condition on robustness. The -test is robust to unequal variances when the group sizes are equal. These are , and the pairing is the dangerous one — the small groups carry the large variances — which inflates and makes the test reject far too often.

    Step 3 checks the wrong quantity and ranks the assumptions backwards. The assumption is that the errors are normal, which is a statement about the residuals , not about the pooled raw data; pooled data from groups with different means is expected to look irregular. And normality is the least important of the three assumptions, because the statistic is built from group means that the central limit theorem is already normalising — the most important is independence. (A log transformation may well be sensible for reaction times, but not for the reason given, and not as the first priority.)

    Step 4 treats independence as something the data can certify. Independence is a property of how the data were collected and cannot be checked from the numbers; a residual plot with no pattern is fully consistent with strong dependence. And here the design tells us it fails: condition 1's observations are volunteers measured three times each. Repeated measurements on one person are correlated, so those numbers carry something nearer independent pieces of information, and every degree-of-freedom count in the analysis is wrong. This needs a different model — one with volunteer as a random effect — not a correction.

    (b) How far off the pooled denominator is. With ,

    For conditions 2 versus 3 the pooled standard error is . Using those two groups' own variance, , it is . The pooled figure is too small by a factor of , so any statistic between conditions 2 and 3 is inflated by about and any , being a squared quantity, by about . A difference that is genuinely two standard errors out is reported as nearly four.

    Note this calculation still takes condition 1's within-group degrees of freedom at face value, which Step 4 shows is itself unjustified.

    (c) What the report should say. “The group sizes are very unequal and the variance ratio is , with the small groups the more variable, so the pooled -test is not valid; Welch's ANOVA is used instead. Condition 1 consists of three repeated measurements on each of volunteers, so the analysis models volunteer as a random effect rather than treating the values as independent. Normality was assessed on the residuals, not the raw times; it is the least critical assumption, and a log scale was considered on substantive grounds.”

  6. Show the solution to question 6

    (a) Mean and variance of . Expectation is linear, so ; no independence is needed for this.

    For the variance, expand the linear combination:

    The covariances vanish because different groups consist of disjoint sets of independent observations, so the group means are independent — this is the one place independence enters. What remains is .

    By the theorem on expected mean squares, is unbiased for whether or not holds, so replacing by gives the standard error . For the sum is and the standard error is , since is precisely the pooled variance — the two-sample formula recovered. ✓

    (b) Invariance under a common shift. Adding to every mean,

    If the second term vanishes for every . Conversely, if the value is unchanged for some , then forces .

    A comparison is a statement about differences between means, and differences are exactly the quantities that survive a change of origin; a combination with changes when every group is shifted equally, so it measures a level, which depends on where zero is.

    (c) The fertiliser contrast. “Fertiliser 3 versus the average of 1 and 2” is , which sums to zero ✓. The estimate is

    For the standard error, , so

    Planned: against , is far into the rejection region. Unplanned: Scheffé's critical value is (since ), and as well.

    The critical value is legitimate only if the contrast was fixed before the data were seen. If it was chosen after noticing that fertiliser 3 stood out, it is one of infinitely many contrasts that could have been picked, and only Scheffé's value — which bounds the maximum over all of them simultaneously — controls the error rate. Here the conclusion holds under either standard, so it does not matter which story is true; it often does.

  7. Show the solution to question 7

    (a) Marginal means and the main-effect sums of squares. Row means: and . Column means: , , . Grand mean , which also equals ✓.

    Each row mean averages observations and each column mean , so

    (b) Departures from additivity. Additivity predicts cell to be . Row 1 predictions: , , ; the actual means are , so the departures are . Row 2 predictions: , , ; actual , departures .

    Row sums: and ✓. Column sums: , , , all ✓. This is forced by the sum-to-zero constraints on the interaction effects, and it is why the interaction has only degrees of freedom — two of the six departures determine the rest.

    Each departure is shared by observations, so

    (c) The table and the tests. Degrees of freedom: has ; has ; has ; error has . Sum ✓.

    Mean squares: , , , . Every effect is tested over :

    Against the critical values: , significant; , significant; , not significant. By the two-way decomposition the total is on degrees of freedom.

    The interaction is not significant, so the main effects may be interpreted as averages over the other factor. Coating produces a response units higher than on average ( against ). Each step up in curing temperature raises the response by units on average ().

    One caveat belongs in the report. A non-significant interaction is not a proof of additivity: in the sample, temperature raised by across the range but by only , and with that difference is simply not distinguishable from noise at . The main effects are the right summary, but “no interaction” should be read as “none detected”.

  8. Show the solution to question 8

    (a) The three plots. Each plot has and as two positions on the horizontal axis, cell mean on the vertical axis, and two line segments: the segment joins to and the segment joins to . Label the segments and use a common vertical scale from to so the three pictures can be compared.

    (i) runs from up to ; runs from up to . The two segments are parallel, both rising by , with a constant above . Draw the vertical gap at both ends and mark it each time — that equal gap is additivity.

    (ii) runs from up to ; runs from down to . The segments form an X, crossing at the midpoint, height . One slope is and the other ; mark both.

    (iii) is flat at ; rises from to . The segments start together at and diverge, the gap growing from to . Mark the shared starting point.

    (b) The sums of squares. Throughout, , , so each row and column mean averages observations and , , and with departure .

    (i) Row means ; column means ; grand mean . ; . Predicted cells: , , , — every cell is exactly predicted, so . Between-cell total: ✓.

    (ii) Row means ; column means ; grand mean . and . Every cell is predicted to be , so the departures are and . Between-cell total: ✓.

    (iii) Row means ; column means ; grand mean . and likewise . Predicted cells: , , , ; actual ; departures . So . Between-cell total: ✓.

    (c) Reading the pictures. (i) Parallel lines are the picture of additivity, so had to vanish: the interaction is exactly the departure from parallel, and there is none. Both main effects are visible — the lines rise (a effect) and are separated (an effect).

    (ii) The X is symmetric: the and segments have the same average height (), so the row means agree and ; and the heights at and average to the same , so the column means agree and . Everything is interaction. Nothing vanishes in (iii): the lines are not parallel, their average heights differ, and the average heights at the two levels differ.

    In (ii), “ has no effect” reads as if were inert. But measures the effect of averaged over the levels of , and here it is being averaged over a sign change. The simple effects are: within , moving from to raises the response by ; within , it lowers it by . Factor moves the response by units at every level of — in opposite directions. When the interaction is present the correct report is these simple effects or the cell means themselves, never the main effect.

  9. Show the solution to question 9

    (a) Why random. The twelve laboratories are of no interest in themselves; they were drawn from a register so that the conclusion can be about the population of laboratories, and the question is how much laboratories vary. That is the random-effects model,

    with the independent of the . The null hypothesis is — laboratories do not vary at all — rather than a statement about twelve particular means.

    (b) The variance components. By the expected mean squares under random effects, and . Equating mean squares to their expectations,

    A single measurement has variance by independence, estimated by : a measurement sent to a randomly chosen laboratory has standard deviation about concentration units, of which laboratory choice and within-laboratory noise are both substantial parts. The intraclass correlation is

    so of the variance of a single measurement is between laboratories, and two portions measured by the same laboratory have correlation .

    (c) The test and what it means. on and degrees of freedom. Since , reject .

    The rejection says : laboratories in the population genuinely differ in what they report for the same material. It is a statement about all laboratories on the register, and the natural follow-up is the estimate and the intraclass correlation. Had the twelve been fixed — the only twelve the authority uses — the same would say that these particular laboratories do not all have the same mean, and the follow-up would be a post-hoc procedure asking which ones differ. The arithmetic is identical; the estimand is not.

    (d) A negative estimate. Now . A variance cannot be negative, but the estimate is not a computational error: the method of moments returns a negative value whenever , and under that happens roughly half the time, since both mean squares then estimate the same . The usual remedy is to truncate at zero and report , with the caveat that truncation biases the estimator upward.

    Here , so is not rejected. What this indicates: the data provide no evidence of between-laboratory variance. What it does not indicate: that laboratories are identical. A small is not evidence for the null beyond the non-rejection, and with per laboratory the estimate of is imprecise.

  10. Show the solution to question 10

    (a) The covariance structure. Fix a group and two distinct observations in it. The constant contributes nothing to any covariance, so by bilinearity

    The last three terms are zero: the 's are independent of the 's, and distinct 's are independent. So the covariance is — the shared group effect is the only thing two group-mates have in common. For the variance, the same expansion with gives , and therefore

    For observations in different groups , every one of the four terms in the expansion of is zero: distinct 's are independent, 's and 's are independent, and distinct 's are independent. So the two observations are uncorrelated. They are moreover independent, because the whole vector is a linear function of the independent normal variables and is therefore jointly normal, and for jointly normal variables zero correlation is independence.

    Since is a variance and the denominator is positive, : this model can never make group-mates negatively correlated. Equality holds exactly when , which is — under the null the group structure carries no information and the observations are simply i.i.d. .

    (b) Variance of the grand mean. Averaging the model over all observations,

    The two random sums are independent (one is built from the 's, the other from the 's), so their variances add:

    using independence within each sum. Hence . (Equivalently: is the average of the i.i.d. group means, each with variance by the theorem on expected mean squares under random effects, and dividing by gives the same thing.)

    As with fixed the second term vanishes and , which is not zero unless . More observations per group eliminate the measurement noise but leave the draws of the group effect exactly as they were; the grand mean can never estimate more precisely than an average of observations from does. If the aim is , precision comes from sampling more groups. With a fixed total of observations, the design that spreads them over many groups beats the one that concentrates them in a few — for instance , gives , while , gives .

    (c) Unbiasedness, and the cost of truncation. By the quoted expectations and linearity,

    Write and . Then everywhere, and exactly on the event . A non-negative random variable that is strictly positive on an event of positive probability has strictly positive expectation, so if then

    Under the ratio has the distribution, which has positive density on all of , so is strictly positive — in fact close to one half, since both mean squares are estimating the same and their ratio falls on either side of with comparable probability. The consequence is uncomfortable: when the true between-group variance is exactly zero, the truncated estimator has strictly positive expectation. This is the awkwardness of the moment estimator that pushes practice toward likelihood-based estimates of variance components.

  11. Show the solution to question 11

    (a) Step 1 is correct; Steps 2 and 3 are not. Under indicator coding , a difference of two independent group means, so its variance is and, estimating by ,

    Step 2 misdescribes the -test and then misreads a non-rejection. The -test is a model comparison: it tests the single joint hypothesis by comparing under the full model with under the intercept-only model. It is not a combination of the two coefficient tests, which are two uncorrected comparisons against the reference — and neither of them tests whether programmes 2 and 3 differ from each other. A joint hypothesis can be rejected while every marginal one survives. Separately, “not significant” is not “equivalent”: failing to reject is not evidence of equality.

    Step 3 mistakes a reparameterisation for a contradiction. The coefficients are comparisons against whichever reference was chosen, so of course they change with the reference; what does not change is the set of fitted values, hence , hence . The two fits agree perfectly: under reference 2, , which is exactly from the first fit. Choosing which fit to report according to which looks significant is a selection, and it is exactly the uncorrected reference-level comparison the -test exists to replace.

    (b) The -test. The grand mean is , so

    By the decomposition of the total sum of squares, . The full model fits each group its own mean, so , while the intercept-only model has . The model-comparison statistic is

    Reject at : the three programmes do not all have the same mean score. Step 2's conclusion is the opposite of the truth.

    (c) What sees. Programme 1 happens to sit in the middle of the three means. Each coefficient in the reference-1 coding measures a gap of , which is standard errors; but the gap between programmes 2 and 3 is , which is standard errors, and no coefficient in that coding measures it. The -test does not compare anything to a reference: counts programme 2 and programme 3 as each away from the grand mean on opposite sides, so the -unit spread between them is fully present in the numerator. That is why rejects while both coefficients fail — the reference coding was looking at the two smallest of the three differences.

    Whether the 2-versus-3 comparison survives a familywise correction is a Tukey question. With equal group sizes,

    The differences are , and . Only : programmes 2 and 3 differ at familywise , and neither can be separated from programme 1. So the in Step 3 was uncorrected, but the finding it pointed at is genuine. The correct report is: the programmes differ (, ), and the difference the data can locate is between programmes 2 and 3.

  12. Show the solution to question 12

    (a) The one-group identity, and the fit. Insert and remove the group mean: . Squaring and summing over ,

    The middle sum is by the definition of , which proves the identity. Since the second term on the right is non-negative and zero only at , the identity also says: over all , the sum is uniquely minimised at .

    Now the model. An observation in group has every indicator zero, so its fitted value is ; an observation in group has and the others zero, so its fitted value is . Write and for the group levels. The map is a bijection of — its inverse is , — so minimising the residual sum of squares over the 's is the same as minimising

    over all freely. The sum splits into pieces, and piece involves only . By the identity, each piece is minimised uniquely at , so the whole sum is minimised there. The fitted value of every observation in group is , and the minimum value is

    (b) The coefficients, and changing the reference. From the inverse map, and for : the intercept is the reference group's mean, and each slope is a difference from it.

    With group as reference, the fitted value in group is and in group it is ; the correspondence , is again a bijection onto the same set of level vectors . The minimisation over the levels is therefore the same problem with the same unique solution . So the fitted values are unchanged, the residuals are unchanged, is unchanged, and — which is built from , and the degrees of freedom, none of which mention the coding — is unchanged. What does change is the coefficients: and , a different set of comparisons describing the same fit.

    (c) The reduced model. The intercept-only model gives every observation the fitted value . Apply the identity of (a) with the entire sample treated as one group of size and mean :

    with equality at . So the least-squares intercept is the grand mean and . Then, by the quoted decomposition, , and

    The degrees of freedom are the right ones: the full model has parameters, leaving residual degrees of freedom, and the reduced model has , so the comparison spends .

    (d) Two groups. For the one coefficient is . Under the model the two group means are independent with variances and , so . The regression estimate of is the residual mean square , which by (a) is the pooled variance . Hence

    the pooled two-sample statistic, and by the proposition that with two groups is the square of , the coefficient test and the model-comparison -test reject on exactly the same data, with matching critical values .

    For there are coefficients, each testing one difference from the reference at an uncorrected level, whereas tests the single joint hypothesis that all vanish — and a joint hypothesis is neither the conjunction of separately tested marginal ones nor sensitive to which group was chosen as the reference, as the previous problem shows in numbers.

Full solutions sheet →