Skip to content

Error in eval(expr, envir, enclos) : object 'x' not found

2 messages · Jumlong Vongprasert, Peter Dalgaard

#
On 10/16/2010 09:27 AM, Jumlong Vongprasert wrote:
First isolate it. Break things down into steps by rewriting as

fit <- lm(x~y)
predict(fit, IWJR.complete)

I think you will find that it fails already in the first step, because
you didn't tell lm where to look for its variables (it's not going to
try guessing it from context, and besides it might not be intended to
use the same data as used for prediction).