problem-3.25
problem-3.25
The wtloss data can be plotted as follows:
> attach(wtloss)
> cor(Weight, Days) # close to -1
[1] -0.9853
> plot(Days, Weight) # kinda linear
> res = lm(Weight ~ Days)
> abline(res) # add regression line
> plot(Days, residuals(res)) # A trend
> detach(wtloss)
We see from the scatterplot that a linear model may not explain the
data well, despite the correlation coefficient that is close to -1.
The residual plot amplifies this observation. This is to be
expected as it is initially easy to lose a large amount of
weight, but this gets progressively harder as there is less excess
weight to shed.