Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 38 1 Solution Created 2026-10-03 Updated 2026-10-14
The S-Plus input and the data table differ in one entry: the former uses for the first year in the second male age group, whereas the table has . The displayed coefficients are reproduced by the software vector with , so that is the input analysed here. Using instead would give a different fit, including an intercept of rather than .
The factor grid has rows. Its first factor varies fastest, so the five years run within each age group, and the age groups run within each sex. All three predictors are regression factors: in particular the year coefficients are category contrasts, not a fitted linear slope in calendar time. Under reference-level coding, take the first year, youngest age group and men as the reference levels in a regression factor. Write for women and for men, and for the other year and age indicators. The normal linear model isThe star in the formula includes both main effects and their statistical interaction. There are twelve coefficients: an intercept, four year contrasts, one sex contrast, three age contrasts and three sex-by-age contrasts. Year effects are assumed common across all sex-age combinations; there is no year interaction term. Independent errors with common variance are additional assumptions of the reported exact tests.
The least-squares estimator is , where has rank twelve. Under the normal linear model,and these quantities are independent. This standard normal-projection theorem gives and estimated coefficient standard errors . A coefficient estimate divided by its standard error has a Student t-distribution with 28 degrees of freedom under its zero-coefficient null. These are the printed t statistics and two-sided p-values; a printed zero is rounding, not a probability of exactly zero. The option suppresses the coefficient-correlation display.
The fitted intercept is the expected percentage for the reference sex, age and year. Relative to that year, the year changes are percentage points. The last two are individually significant at the conventional five-percent level; the first two are not. The sex coefficient is the female-minus-male difference in the youngest group. The male age changes are points. Adding the three interaction term coefficients gives the female age changes . Thus the sex gap shrinks with age. An individual insignificant interaction term coefficient does not justify deleting the whole interaction: the joint partial F-test for the three interaction terms gives on degrees of freedom, with .
The regression residuals are observed minus fitted percentages; their printed five-number summary describes their spread. Direct calculation gives , so the residual standard error isThe coefficient of determination is . The overall F-test compares all eleven non-intercept coefficients with zero:Under the null it has an F-distribution on degrees of freedom; its very small p-value shows substantial explained variation. This does not independently validate the Gaussian error assumptions. Survey percentages can have different sampling variances and correlations, and the survey denominators and design are not supplied. The output's exact inferential interpretation is conditional on the stated normal linear model.
The final command makes an interaction plot, not another regression fit. Its points are arithmetic averages over the five years for each sex-age combination. It draws two decreasing, nonparallel lines, with coordinatesTheir gaps are percentage points, illustrating the sex-by-age statistical interaction. The average uses the software vector's disputed entry, consistently with the displayed fit. These are means of percentages, not denominator-weighted pooled prevalence estimates.
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 41 2 Solution Created 2026-10-03 Updated 2026-10-14
A factor is a categorical predictor whose levels distinguish experimental conditions. Two factors have a statistical interaction when the effect of changing one depends on the other's level. For cell means , absence of an interaction means ; equivalently, is independent of .
Index thickness by , temperature by , wash by and replication by . The full factorial design has the normal linear modelThe errors are independent with a common positive variance. Sum-to-zero constraints in each factor index, or the displayed treatment coding, identify the mean coefficients. This full model allows an arbitrary mean in each of the sixteen cells.
The missing statistical degrees of freedom, in the output order, are . The first seven entries total fifteen; with the regression intercept there are sixteen mean coefficients among thirty-two observations, leaving sixteen residual statistical degrees of freedom. Balanced factorial orthogonality makes the term sums of squares in ANOVA independent of their ordering.
All terms involving wash have nonsignificant individual F-tests, and it is useful to test their removal jointly. The reduced model omits twelve mean coefficients. Its residual sum of squares is , compared with for the full model, so the nested-model F-test givesThere is no detected wash effect over the four tested durations. Removing its main effect and all its interaction terms respects the principle of marginality. Retaining the very large thickness-by-temperature interaction is essential: the thickness effect changes substantially with temperature.
With numeric indicators , treatment coding expresses the reduced fitted mean asThus the thin/low, thick/low, thin/high and thick/high fitted means are , respectively, at every wash level. Each is the sample mean of eight observations. The equal-cell replication variance formula therefore givesAlternatively, use the variance of a fitted regression mean with : . Individual coefficient standard errors cannot simply be added; their covariances enter the fitted-mean calculation.
Increasing temperature raises fitted lustre by for thin film and for thick film. Increasing thickness raises it by at low temperature and at high temperature. Their difference, , is the estimated interaction contrast; its standard error is , giving on twenty-eight statistical degrees of freedom. The interaction plot shows this strong departure from parallel mean lines, while the wash panel shows the much smaller variation across wash durations. Neither the nonsignificant wash test nor the plot proves that its true effect is exactly zero.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 38 1 Solution Created 2026-10-03 Updated 2026-10-14
Let be the flight distance in millimetres for paper level , launch-angle level , design level and replicate , where and . The full factorial design is fitted by the normal linear modelThe assumptions are independent errors with a common variance and normal distribution, and the displayed factor-combination mean structure. The corner-point constraints areand whenever at least one index equals . Thus the eight free mean coefficients are . These treatment coding coefficients are comparisons at the other factors' reference levels, rather than necessarily averaged main effects.
To test the three-factor interaction term, compare the full model with the model retaining all main effects and all two-factor interactions. The null hypothesis is , against a nonzero value. Removing it increases the residual sum of squares by and removes one parameter. With eight residual degrees of freedom, the nested-model F-test givesThere is no evidence that this three-factor interaction is needed. This does not establish that all two-factor interactions vanish: the paper-design interaction is substantial.
The
stepAIC command performs stepwise selection by the Akaike information criterion. Its upper scope is the full factorial model and its lower scope is the intercept-only model. Starting from the full model, it compares admissible additions and deletions, preserving the hierarchy of interaction terms, and chooses changes that reduce the Akaike information criterion. With the supplied scope its default search permits both directions. For these Gaussian fits the displayed criterion, up to constants common to all models, is , where counts mean coefficients. The first deletion changes it from to : the small increase in residual sum of squares is outweighed by removing a parameter. This is a greedy model selection procedure, not an exhaustive search or a sequence of fixed-level hypothesis tests. The command's arguments are described in the MASS documentation.For the selected model, let and . Thenindependently between flights. It has no angle term. The maximum-likelihood estimates of its mean coefficients are also obtained by ordinary least squares:For example, the four fitted means are just the four paper-design cell means, each averaging four flights over the angle levels. With , the variance-covariance matrix of the coefficient estimates is . Its diagonal gives the displayed standard errors; their ratios are , with mm.
The final line of
summary(model2.lm) is the joint nested-model F-test of , comparing this four-parameter model with a common mean. Its statistic iswith F-distribution under the fixed-model null and P-value . Thus the selected paper-design terms jointly improve the fit substantially. The coefficient of determination means they account for about of the observed centred variation. These nominal inferential summaries do not adjust for the preceding model selection on the same data.Using the unrounded fitted means givesin millimetres. Hence choose the high-performance design with the lighter paper; the fitted model leaves both launch angles tied, with expected distance about mm. A preference for one angle is not supported by this selected model. The strong paper-design interaction reverses the design comparison: the simple design is better on heavy paper, whereas the high-performance design is better on light paper. Consequently a single design effect averaged over paper types would conceal the main result. There is little evidence here for an angle effect, and considerable flight-to-flight variability remains.
Before fitting, inspect raw-distance dot plots for all eight factor combinations, and interaction plots of cell means against design, with separate lines for paper and panels for angle. With only two replicates per cell, showing individual observations is more informative than elaborate box plots. These reveal reversals, spread and possible unusual flights. Afterwards inspect a residual-versus-fitted plot, a Q-Q plot of residuals, a scale-location plot, residuals against each factor and, if recorded, flight order, and Cook's distance for influential observations. Residual patterns by angle would question its deletion, while unequal spread or departures from the normal distribution would question the error assumptions rather than merely demand another mean term.

