Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 2 c Solution Created 2026-10-03 Updated 2026-10-06
Let be sunny days and latitude. The R linear-model formula expands to a normal linear model with both main effects and their interaction term:The fitted conditional mean isThe residual standard error is , giving the usual variance estimate , and .
The estimated interaction term is tiny relative to its standard error: and the two-sided p-value is . A sensible initial simplification is to remove the interaction and refit an additive linear model,
lm(energy ~ sunny + latitude). Both main effects are significant in the supplied fit, and should initially be retained. Do not simply copy their old coefficient estimates into the new fit: removing a design column generally changes all estimates. Centering predictors makes intercepts and main-effect interpretations more useful, but does not change the fitted surface. The Box–Cox transformation in part (d) suggests a further response-scale improvement; after changing the response scale, reassess the interaction and diagnostics. Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 4 5J i Solution Created 2026-09-24 Updated 2026-09-25
Use the R linear-model formula with only its implicit intercept:
fit1 <- lm(log(price) ~ 1, data = cars)