[S] Prediction problem

James Clark (clark@aspen.aero.org)
Tue, 3 Mar 1998 10:33:09 -0800

Can someone please explain why the error below occurs when I try to
predict using f2. I don't understand why the result isn't the same
as using f1. I have come across this problem before with other functions,
this is just the latest incarnation.

> f1 <- lm(y ~ poly(x, deg=5), old.data)
> dd <- 5
> f2 <- lm(y ~ poly(x, deg=dd), old.data)
> predict.gam(f1, newdata = new.x)
[1] 4.1063
> predict.gam(f2, newdata = new.x)
Error in safe.predict.gam(object, newdata, type, s..: Length of variable 2 is 1
!= length of row names (1000)

Thank you.

Jim Clark
Aerospace Corp.
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news