Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2023/ii/paper-4/5j/i/solution

Use the R linear-model formula with only its implicit intercept:
fit1 <- lm(log(price) ~ 1, data = cars)
This models every log-price by one common mean plus an error term.

New to topics? Read the docs here!