Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 39 4 Solution Created 2026-10-03 Updated 2026-10-14
A randomized complete block design groups similar experimental units into experimental blocks and places every treatment once in each experimental block, independently randomizing treatment allocation within experimental blocks. Blocking removes background between-block variation from within-block treatment comparisons. A balanced incomplete block design has treatments and experimental blocks of size , with each treatment occurring in experimental blocks and every distinct treatment pair together in experimental blocks. Counting treatment occurrences and co-occurrences gives and .
A Latin square of order places each of treatment symbols once in every row and every column of a array. This controls two nuisance directions. A Graeco-Latin square superposes two mutually orthogonal Latin squares: each square is Latin, and each ordered pair of symbols from the two squares occurs exactly once. The two symbol factors can then be fitted together with row and column effects. Random permutations of row labels, column labels and treatment symbols provide a suitable randomized allocation without destroying these balances.
For the operator experiment, fit the additive normal linear modelHere account for the two fabric directions, and is the operator effect. Additivity, independent equal-variance errors and the normal assumption supply the exact F-test; there is only one observation per cell, so an unrestricted interaction model is not available.
In the analysis of variance for a Latin square, the three centered factor spaces each have dimension . Together with the intercept the model has rank ten, leaving residual statistical degrees of freedom. The corrected total has . The completed calculation isUnder the null hypothesis , the operator F-statistic isThe upper five-percent critical value for is , so the operator effect is not significant at five percent in this model.
The decision is independent of the order of fitting rows, columns and operators. To prove the required orthogonality, let be any centered row coefficients and any centered operator coefficients. Their observation-space inner product is , since every operator occurs once in each row. The same calculation applies to columns and operators, and all row-column pairs occur once as well. Thus the three centered spaces are mutually orthogonal; their projections commute and sequential sums of squares equal adjusted sums of squares in every fitting order.
With machines included, the layout is a Graeco-Latin square: the machine symbols are Latin, and all sixteen operator-machine pairs occur exactly once. Fitin addition to the earlier constraints. The machine space contributes three new statistical degrees of freedom and is orthogonal to the previous factor spaces, so the operator sum of squares remains . The residual sum of squares and statistical degrees of freedom becomeHenceThis exceeds but not . Therefore the operator effect is now significant at five percent, but not at one percent. Adjustment for machines has removed substantial residual variation without altering the operator numerator. This illustrates why a balanced nuisance factor can change precision and significance even when it does not change the estimated treatment contrasts.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 41 1 Solution Created 2026-10-03 Updated 2026-10-14
scan reads the numerical prices, including the three missing-value markers, into a vector. The data must be read row by row for the subsequent factor construction to match them. The sample size available for analysis is therefore , rather than . The numerical summary describes the observed prices: the sample median is £43.54 and the sample mean is £46.94. The upper tail, particularly the boots, raises the sample mean above the sample median. These summaries mix very different products and are not adjusted country comparisons.The two character scans create labels.
gl(8,5,length=40,labels=item) makes a regression factor with each of eight item labels repeated five times. gl(5,1,length=40,labels=country) cycles through the five country labels once for each item. For a regression factor and numerical response, the two plot commands produce grouped box plots. The country box plots suggest lower US prices, while the item box plots show particularly expensive boots and inexpensive cardigans. They are descriptive displays of this small basket, with different item compositions where prices are missing; they cannot separate country effects from item effects.The first
lm fits an additive two-way analysis of variance:The constraints are R's usual treatment coding. The normal linear model used for the printed tests assumes independent errors with common variance and approximately a normal distribution, and no item-by-country interaction in the mean. Missing prices are omitted, leaving responses and independent mean coefficients. Thus the residual degrees of freedom are . This deletion is defensible for the conditional price model when missingness does not depend on the unobserved error after conditioning on the two factors; the output itself does not establish such a missing-data mechanism.The
anova tables report sequential sums of squares, rather than order-independent adjusted effects. If are the residual sums of squares from the intercept-only, country-only, item-only and additive fits, the first order allocates to country and to item. The second order allocates to item and to country. Both allocations sum to the same total explained sum of squares, and both end with the same residual sum of squares . The three missing combinations destroy balanced factorial orthogonality, so the allocation changes with order. To test country after allowing for items, use the country row in the second table; to test item after allowing for countries, use the item row in the first table. The first-entered rows do not supply those adjusted tests.Each mean square in ANOVA divides its sum of squares in ANOVA by its statistical degrees of freedom, and each printed F-statistic divides that mean square in ANOVA by . In particular, the adjusted country partial F-test haswith an reference F-distribution and p-value approximately . The adjusted item partial F-test gives on statistical degrees of freedom. Both factors contribute strongly under the additive normal linear model. The larger item sum of squares in ANOVA measures the much greater differences between these products, but is not evidence that every pair of items differs significantly.
The intercept is the fitted UK price for the reference jeans, not their observed price and not the overall sample mean. Each country regression coefficient is its adjusted price difference from the UK, assumed common across items: Sweden is £5.224 lower, France £10.708 lower, Germany £7.676 lower and the US £21.328 lower. Each item regression coefficient is its adjusted difference from the reference jeans, assumed common across countries. Thus the fitted UK boots price is , and the fitted US boots price is .
The coefficient standard errors come from , where and is the design matrix. Dividing each estimate by its standard error gives the displayed Student t-test statistic, with statistical degrees of freedom. The stars summarize the corresponding two-sided p-values. The individual tests compare each indicated country or item with its reference level, conditional on all other additive terms; they are neither tests of every pairwise comparison nor a simultaneous confidence interval procedure. In particular, Sweden's p-value provides weaker evidence than the other country contrasts, and does not establish equality with the UK. The intercept test has little substantive relevance, and interpreting many individual stars also raises multiple hypothesis testing issues.
The residual standard error measures unexplained prices in pounds. With total corrected sum of squares , the coefficient of determination and adjusted coefficient of determination areMuch of this impressive fit is due to the large differences between items. The overall F-test compares the additive fit with a constant mean: on statistical degrees of freedom. It tests that all eleven non-intercept coefficients vanish, not that the additive model is adequate. Regression diagnostics should examine regression residuals, changing price variability across items and possible interaction. Percentage differences may be more plausible than common pound differences, motivating a natural logarithm of price. No random sample of countries or products, and no independent replication of a price within a cell, is supplied; broad claims about all designer goods or the causes of country differences require more than these conditional tests.
Finally,
Item*Country expands to both main effects and their full interaction. A cell-means parameterization has one separate fitted mean for every observed cell. With one response per cell its design matrix has row matrix rank , while the full layout nominally has coefficients. Three coefficient combinations are aliased because their cells are missing. This is saturation of an unreplicated two-factor regression: every observed price is fitted exactly and the residual degrees of freedom are zero. The final fit has zero residuals, and no residual-based estimate of the error variance or ordinary interaction significance test. The printed numerical summary will mark three coefficients unestimable; coefficient standard errors, tests and adjusted involve undefined division by zero, potentially appearing as NaN or Inf according to numerical roundoff. Perfect interpolation here is a consequence of a saturated statistical model, not evidence for a superior predictive model. Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 4 5J b Solution Created 2026-09-24 Updated 2026-09-29
The intercept-only model has residual degrees of freedom, so the sample size is . The one-covariate model and full model therefore have respectively and residual degrees of freedom. The completed sequential analysis of variance table hasThus the missing sums of squares are and , and the corresponding F-statistics are approximately and . The first p-value is below ; the second is approximately . The tiny second increment is consistent with the reported t-test because, for one added coefficient, the partial F-statistic equals the squared t-statistic up to displayed rounding.