Skip to content
Prev 386852 / 398502 Next

Error in UseMethod("predict")

Hi Sacha,
I never used these packages before but I installed them and tried your
code. I have a few observations that may help.

1. the statement
    ypred = predict(fit18,newdata=Testing)
    is wrong. Checkout the help page (?robustgam)  which shows in the
Examples section at the bottom to use something like
    ypred = pred.robustgam( fit18, data.frame(X=Testing)

2. your logic is wrong. You define the vectors x and y at the top. They
should remain untouched during your program.
    However in the loop you redefine y and then use the redefined y as an
argument to robustgam() the next time through
    the loop. This looks like a serious error.

HTH,
Eric


On Sun, Jan 17, 2021 at 12:20 PM varin sacha via R-help <
r-help at r-project.org> wrote: