Block design Created 2026-10-07 Updated 2026-10-14
A block design assigns treatments to experimental units partitioned into blocks. Its incidence counts record how often treatment occurs in block . Balance and connectedness determine which treatment contrasts are estimable and how much adjustment for blocks costs.
Contrast (statistics) 2026-10-14
A contrast is a linear combination of group means with . It compares responses without depending on a common additive level. Treatment contrasts and factorial contrasts specify comparisons in a design of experiments.
Design of experiments Created 2026-10-07 Updated 2026-10-14
Design of experiments chooses experimental units, treatments, replication, blocks in experimental design and randomization so that scientifically useful treatment contrasts can be estimated with meaningful standard errors. Allocation determines which measurements supply independent treatment information.
Orthogonal polynomial contrast 2026-10-07
At equally replicated quantitative treatment levels, evaluations of orthogonal polynomials generate pairwise orthogonal treatment contrasts, using the replication-weighted inner product. Five equally spaced levels give four contrast directions representing degrees one through four, besides the constant direction. This decomposes treatment variation without assuming the response has low polynomial degree.
Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 43 1 Solution Created 2026-10-03 Updated 2026-10-14
This is an analysis of covariance: achievement is the response, aptitude is a quantitative covariate, and teaching method is a categorical explanatory variable. The usual normal linear model assumes independent errors with common variance .
read.table reads the data with a header row; attach makes its columns directly accessible, and the two printed vectors confirm their ordering. rep(1:3, each=7) supplies the three group labels, and factor makes them categorical. The contrast option selects treatment coding for unordered factors, with method A as the first-level reference. The polynomial option would apply to ordered factors and has no role here.The formula using
aptitude * Group includes both main effects and their interaction. Writing for the method indicators, its fitted mean has the formThus A, B and C have separate intercepts and slopes. There are six coefficients and residual statistical degrees of freedom. The analysis of variance table uses sequential sums of squares: adding aptitude to an intercept-only model removes from the residual sum of squares; subsequently adding the two group indicators removes ; adding the two slope interactions removes only . The remaining sum of squares is , giving mean square .Each displayed F-test divides the added term's sum of squares by its statistical degrees of freedom and then by this full-model residual mean square. In particular the interaction test isThere is no evidence that the slopes differ, so the common-slope model is preferable among the fitted models. The small group -value concerns differences after including aptitude, whereas the first aptitude row is sequential and does not adjust for Group. It should not be interpreted as the covariate test after treatment adjustment.
The additive formula gives the parallel-lines modelIt has four coefficients and residual statistical degrees of freedom. Removing the interaction raises the residual sum of squares to , but lowers the residual mean square to . The sequential aptitude and group sums of squares are unchanged. The adjusted group test is now on statistical degrees of freedom, with : after allowing for initial aptitude, the methods are not all equally effective.
summary(..., cor=F) displays the fitted coefficients, their standard errors, the individual statistics, and two-sided -values; it omits the coefficient-correlation matrix. The intercept is the fitted A mean at aptitude zero, which is outside the observed range and is mainly a parametrization device. The common slope predicts about extra achievement units per aptitude unit, holding method fixed. Its adjusted test is on statistical degrees of freedom, with about . The method coefficients are adjusted differences from A, not the B and C intercepts themselves. The three fitted lines areThe B-minus-A estimate is with standard error and ; the C-minus-A estimate is with standard error and . Both comparisons are strongly significant.The B-minus-C comparison needs its own treatment contrast; its significance cannot be read off either comparison with A. Reconstructing the coefficient covariance from the design givesThus there is no detectable difference between B and C. This is consistent with pooling their effects in a further reduced model, but does not establish exact equality.
The residual standard error is . The five-number residual summary shows deviations on both sides of zero, with the largest magnitude about ; it does not by itself verify constant variance or normality. The coefficient of determination means about of the achievement variation about its overall mean is explained. The overall compares all three nonintercept coefficients with zero, on statistical degrees of freedom; its -value is . Printed coefficient -values rounded to
0.0000 are small, not literally zero. Past exam of the mathematics course of the University of Cambridge 2011 ii Paper 4 5J Solution Created 2026-09-24 Updated 2026-10-14
Model each person's infections over the fixed exposure period as an independent Poisson random variable with mean , conditional on the explanatory variables. The sum over people is then Poisson distributed with mean , because independent Poisson counts add. This is reasonable for repeatable events occurring at an approximately constant rate without substantial clustering; the count need not be at most , so a binomial model would not describe repeated infections.
The Poisson regression uses a log link and the known offset . The omitted factor levels are the reference categories under treatment contrasts: their effects are absorbed into the intercept. Including all levels together with an intercept would make the design matrix linearly dependent. For the proposed new group, the relevant predictor uses the intercept, the infrequent-swimmer coefficient and the age-20–24 coefficient; beach and female are reference levels. HenceTo add the age-by-sex interaction, one possible R command iswhere
glm(count ~ freq + loc + age * sex, family = poisson, offset = log(n), data = swimmers)swimmers denotes the data frame. The product expands to both main effects and their interaction. There are two additional interaction coefficients because age has three levels and sex has two.The nested-model comparison is a likelihood-ratio test. The reduction in Poisson deviance is , asymptotically under the null hypothesis that both interaction coefficients are zero. Its reported -value gives evidence for an age-by-sex interaction at the five-percent level, though not at the one-percent level.
Neither fitted Poisson model fits well in an absolute sense. Comparing residual deviances with and respectively gives small tail probabilities: the deviance-to-degree-of-freedom ratios are about and . Improvement relative to the simpler model does not establish goodness of fit. Omitted structure, dependence or overdispersion could account for the remaining lack of fit; if the Poisson variance assumption is false, the nominal interaction-test calibration also needs reconsideration. The age label in the introductory legend is inconsistent with the actual model levels; the prediction uses the unambiguous age-20–24 row.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 37 1 c Solution Created 2026-10-03 Updated 2026-10-07
In an R formula,
I(...) protects ordinary arithmetic from the formula operators: the predictor is the numerical variable , rather than an instruction to remove a formula term. Predictor centering leaves fitted values and the height slope unchanged but places the intercept at a meaningful height. It often reduces the correlation between intercept and slope estimates.With , treatment contrasts use female as the reference level in a regression factor. The fitted normal linear model isThe estimates and their standard errors areThe intercept estimates female mean weight at height 165. At that same height the male fitted mean is . Holding height fixed, the fitted male mean exceeds the female mean by 4.3294 weight units. Within either sex, one additional height unit increases fitted mean weight by 0.6211 weight units. If height is in centimetres and weight in kilograms, these interpretations use centimetres and kilograms accordingly. A standard error for the male intercept would require the covariance between and , which is not printed.
The prediction equation is . Predictions for individual students also have residual uncertainty, estimated by , beyond uncertainty in the fitted mean.
Among patients still alive at the same time after surgery, chemotherapy has an estimated lung-cancer death rate 3.71 times that of radiotherapy, assuming proportional cause-specific hazards. The estimated 95% confidence interval for this hazard ratio is . Thus the fit suggests a higher instantaneous lung-cancer death rate on chemotherapy, with appreciable uncertainty in its size.
The null hypothesis of no treatment effect on that hazard is against . Its Wald test uses , approximately standard normal under the null hypothesis, with two-sided . This is evidence against equal lung-cancer death hazards in the fitted model. It is not a statement that five-year lung-cancer death probability is multiplied by 3.71 or that survival duration is divided by 3.71. The cumulative incidence function depends on both cause-specific hazards, and the model needs proportional-hazards and independent observation-censoring assumptions. In a randomised comparison the assigned treatment contrast is protected against baseline confounding, but the instantaneous comparison concerns the groups who have survived to the time in question; it does not identify a treatment effect within a common latent survivor subgroup.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 35 1 b Solution Created 2026-10-03 Updated 2026-10-07
An orthogonal block design has treatment contrasts orthogonal to block contrasts after removing the grand mean. This is a statement about vectors on the experimental units, with the usual inner product; the two full spaces are not orthogonal because both contain the constant vector.
For a counting criterion, let count experimental units receiving treatment in block , let , let , and let . The inner product of the centered indicators for treatment and block is . ConsequentlyIn particular, equal-sized blocks must contain each treatment in the same proportion. Under an additive block-and-treatment model, adjustment for blocks then does not change the fitted treatment contrasts.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 35 1 c ii Solution Created 2026-10-03 Updated 2026-10-07
If the biological cells are initially interchangeable, randomly allocate them to five groups of ten for the days. Within each day, independently choose a uniform distribution on a finite set over assignments having two occurrences of each dose level to the ten experimental units. One implementation is a random permutation of a list containing two labels of each level; the duplicate labels give every admissible assignment the same number of underlying permutations.
Randomize the processing order within each day as well, while pairing each preparation with its immediate measurement. Randomize dose within day, not merely the names of the days. This restricted randomization preserves the planned balance while protecting treatment contrasts against systematic order effects. Conceal the dose labels from the assessor where practical.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 35 3 a Solution Created 2026-10-03 Updated 2026-10-07
A completely randomized design uses eligible animals, randomly selecting to receive and assigning the remainder to . Use comparable follow-up and assess the same response variable in both groups. Its advantage is simplicity and freedom from previous-treatment carryover effects; its disadvantage is that between-animal variation enters the residual and can make a treatment contrast imprecise.
A randomized complete block design with matched pairs first forms pairs using pre-treatment characteristics such as initial disease severity, age or breed. Independently choose which animal in each pair receives , with its partner receiving . The experimental units are animals; pairs are blocks. The average within-pair difference estimates the treatment contrast, and positive within-pair similarity can reduce its variance. Its advantage is control of known heterogeneity; its disadvantage is the need for useful matching, with fewer residual statistical degrees of freedom and little gain if the matching variables are uninformative. Do not construct pairs using outcomes observed after assignment.
A two-period crossover design randomly assigns half the animals to sequence and half to . Each animal receives both treatments in separate periods, with a scientifically justified interval between them and the same outcome assessment after each period. Animal blocks remove persistent between-animal differences, while the two sequences balance treatment against period. Its advantage is potentially high precision from within-animal comparisons; its disadvantage is vulnerability to carryover effects, changing disease state and irreversible effects. It is suitable only when comparing the treatments in both periods remains meaningful and residual effects of the first treatment are adequately controlled. A two-period crossover design does not by itself disentangle arbitrary treatment-specific carryover effects.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 35 4 c Solution Created 2026-10-03 Updated 2026-10-07
The orchard residual mean square in ANOVA is on the original tree-response scale: it equals 30 times the corresponding residual mean square in ANOVA for orchard means. Thus the estimated variance of one orchard's sample mean is .
Each pruning marginal sample mean averages four independent orchard means, giving variance . Two different pruning marginals use disjoint orchards, so the variance of their estimated treatment contrast isEach spray marginal sample mean uses six orchards. Similarly,The corresponding standard errors are and in the units of weight per tree. These compare per-tree marginal sample means, averaging equally over the other factor, even when an interaction term is fitted. Comparing orchard totals instead would multiply these variances by .
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 35 4 d Solution Created 2026-10-03 Updated 2026-10-07
Report the six treatment-combination means and their uncertainty, together with useful marginal treatment contrasts, standard errors and confidence intervals. Means are needed to interpret direction and practical importance, while the fitted interaction term determines whether one factor's effects should be reported separately at levels of the other. For the pairwise marginal comparisons in part (c), ordinary model-based 95% Student t confidence intervals use times the corresponding standard error; a simultaneous set of comparisons needs an appropriate adjustment.
Also describe orchard selection, actual randomization, treatment delivery, numbers of trees observed, missing data and response units. Check orchard-level residuals for unequal variance, outliers or systematic patterns using a residual-versus-fitted plot and an appropriate distributional diagnostic. Explain that twelve orchards provide independent treatment replication; 360 tree measurements provide subsampling precision. No numerical treatment means or numerical confidence intervals can be recovered from the supplied sums of squares in ANOVA alone.
Regression factor Created 2026-10-07 Updated 2026-10-25
A regression factor is a categorical variable encoded by indicator columns or treatment contrasts in a statistical model. A factor with observed levels normally contributes statistical degrees of freedom when an intercept is present. The reference level in a regression factor has coefficient zero under treatment contrasts. Coding a year as a factor permits arbitrary year effects rather than imposing a linear trend.
Replication in experimental design Created 2026-10-07 Updated 2026-10-18
Replication in experimental design repeats a treatment on multiple independent experimental units, so that variation between those units can inform a treatment contrast and its standard error. Repeated measurements on one experimental unit can improve measurement precision without providing additional independent treatment replication. The experimental unit is identified by where the treatment is applied, rather than by how many responses are recorded.[ref]
Experimental unit (NC3Rs Experimental Design Assistant). Experimental unit, “Why is the experimental unit important?” and “Know your experimental unit”, revised 31 October 2023
For a constructed example, grow one plant in each of eight separate pots. Apply treatment A to four pots and treatment B to four pots, without sharing drainage water between pots. Measure the length of three leaves per pot. The pot is the experimental unit; the leaf is the observational unit. There are four treatment replicates per group, eight experimental units overall, and measurements. The three leaves in one pot are nested measurements, because they share the same plant and treatment application. The setup assumes that pots do not affect one another; simply putting them in separate containers does not establish statistical independence.
Constructed two-treatment design: eight pot experimental units contain twenty-four leaf observational units
. Each outlined pot receives one treatment application and supplies three nested measurements. A pot label marks an experimental unit, not a measured response value. Details.Randomization chooses which experimental units receive which treatments; replication supplies multiple experimental units receiving the same treatment. These solve different problems. In the balanced allocation above, choose the four A pots uniformly among the possible subsets. A particular pot has probability of receiving A. Given that one pot receives A, a second receives A with conditional probability , rather than . Thus the assignments are not independent random variables, even though the experimental units can supply independent responses conditional on those assignments in a suitable statistical model.
An actual ecology experiment illustrates why the distinction matters. In Stuart H. Hurlbert's account, twelve experimental ponds initially received zero, fifty or 450 fish, with five, four and three ponds respectively. Preparation included assessing variation between ponds before introducing fish; allocation considered both location and existing differences between ponds. The zero-fish ponds supplied the scientific control. These were repeated treatment applications to ponds, not twelve samples from one pond.[ref]
Pseudoreplication and the Design of Ecological Field Experiments by Stuart H. Hurlbert. Pseudoreplication and the Design of Ecological Field Experiments, pp. 194–195, combined or hybrid allocation approach and the Hurlbert–Mulla experiment
The original article followed the southern California ponds for ten months. Its readouts included zooplankton populations and total phytoplankton; it reported decreases in some zooplankton populations and increased total phytoplankton.[ref]
Impacts of mosquitofish (Gambusia affinis) predation on plankton communities by Stuart H. Hurlbert and Mir Subhan Mulla. Impacts of mosquitofish (Gambusia affinis) predation on plankton communities, abstract, Hydrobiologia 83, pp. 125–151, August 1981
Repeated sampling within a pond helps describe its response through time, while ponds supply treatment replication. Unequal group sizes and initial pond variation matter for the statistical model; the treatment counts alone do not establish equal variances or independent responses. Treatment contrast 2026-10-07
A treatment contrast is a linear contrast of cell means comparing treatment responses, with coefficients adding to zero. Pairwise differences and marginal factorial differences are examples. Its variance depends on the true allocation units and their covariance matrix.
Variance of nested measurements 2026-10-18
For pots per treatment and leaves per pot, the group sample mean decomposes into two averages:The variance of a sum adds the variances of the independent terms. Every pot random effect has weight , whereas each remaining error has weight , giving the short proofThis is also the variance of the arithmetic mean of the pot sample means, each with variance . Equal numbers of leaves per pot make the two averaging procedures identical.
If all leaf measurements were falsely treated as independent, the predicted variance would instead be . The ratio of correct to false variance isThus pseudoreplication can underestimate a standard error by the square root of this ratio. Equality holds when or ; sharing a pot creates an error here precisely when the shared influence has positive variance.
Choose , , and as constructed model parameters in squared length units. These are assumptions rather than fitted experimental values. For each group,The treatment contrast has expected value . Since the group errors are independent conditional on the allocation, its variance is twice the group variance, namely , whereas the false calculation gives . Its correct standard error is length units; the false value is . The variance ratio is .
Constructed variance predictions: adding pots reduces uncertainty faster than adding leaf measurements within four pots
. Each curve uses and ; the horizontal axis counts measurements per treatment. The solid designs agree at four pots with three leaves each. The dashed curve assumes all measurements are independent and therefore illustrates pseudoreplication; none of the curves are observed experimental data. Details.With four pots fixed, increasing drives the error contribution towards zero, but the limit of the group variance remains . Measuring twelve leaves on each of four pots gives . Using the same forty-eight measurements on sixteen pots, with three leaves per pot, gives . More independent experimental units reduce both contributions. Extra nested measurements are useful for characterizing each experimental unit, but cannot average away its shared random effect. This is why sample collection effort and the number of independent treatment replicates answer different questions.[ref]
Pseudoreplication and the Design of Ecological Field Experiments by Stuart H. Hurlbert. Pseudoreplication and the Design of Ecological Field Experiments, p. 201, “Multiple samples per experimental unit”


