Skip to content

Interpolating

2 messages · Tom Gottfried, K Jjw

#
From ?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."

The first sentence actually implies, that the columns in newdata need to 
have the names of the variables as specified in the model formula. 
Otherwise, at least in the multivariable case and if the data.frame has 
more than one column, it is impossible to recognize which data to use. Thus

x<-data.frame(day=c(1,2,3,4))

HTH,
Tom

Am 20.08.2012 22:47, schrieb K Jjw: