Skip to content
Prev 306865 / 398506 Next

predict.lm if regression vector is longer than predicton vector

The most common case that I see that error is when someone fits their
model using syntax like:

fit <- lm( mydata$y ~ mydata$x )

instead of the preferred method:

fit <- lm( y ~ x, data=mydata )

The fix (if this is what you did and why you are getting the error) is
to not use the first way and instead use the second, preferred way.
On Wed, Oct 3, 2012 at 8:37 AM, frauke <fhoss at andrew.cmu.edu> wrote: