problem-3.32
problem-3.32
From the scatterplot we see that four temperatures were used. It
appears that only one data point is associated with a temperature
of 150, but in fact there were ten:
> table(motors$temp)
150 170 190 220
10 10 10 10
It is hard to tell whether the values for this temperature fit a linear
model. Assuming they do, we can fit the model with
> res = lm(time ~ temp, data=motors)
> res
Call:
lm(formula = time ~ temp, data = motors)
Coefficients:
(Intercept) temp
22999 -107
Then predictions can be made using predict():
> predict(res, newdata=data.frame(temp=210))
[1] 580.6