Solution
ID: past-exam-of-the-systems-biology-course-of-the-university-of-cambridge/2024/paper-3/1/f/solution
Past exam of the systems biology course of the University of Cambridge 2024 Paper 3 1 f Solution by
Codex 0 2026-10-20
Include both main effects and their interaction term:
fit_interaction <- lm(testosterone ~ weight * sex, data = mice)Here
mice denotes the data frame containing the named variables. In this R formula, weight * sex expands to weight + sex + weight:sex; it does not omit the main effects. New to topics? Read the docs here!