Skip to content

How does predict.lm work?

3 messages · Williams, Robin, Gabor Grothendieck, Marc Schwartz

#
Just try it:
Time demand
1    1    8.3
2    2   10.3
3    3   19.0
4    4   16.0
5    5   15.6
6    7   19.8
1
25.73571
Error in eval(expr, envir, enclos) : object "Time" not found


On Tue, Sep 9, 2008 at 10:59 AM, Williams, Robin
<robin.williams at metoffice.gov.uk> wrote:
#
on 09/09/2008 09:59 AM Williams, Robin wrote:
Yes. Also, see the Note in ?predict.lm:

"Variables are first looked for in newdata and then searched for in the
usual way (which will include the environment of the formula used in the
fit). A warning will be given if the variables found are not of the same
length as those in newdata if it was supplied."


It also says "Variables", not columns.
No.
Yes.
HTH,

Marc Schwartz