If you look at the example for predict.gam, it should be clear that
the data frame has a column(s) for the value(s) you want to predict
for:
> newd <- data.frame(x0=(0:30)/30,x1=(0:30)/30,x2=(0:30)/30,x3=(0:30)/30)
> pred <- predict.gam(b,newd)
> head(newd)
x0 x1 x2
The goal is to smooth a scatterplot using the LOESS locally weighted
regression program and a gam. There are 156 points. Thus x can have the
value 1, or 2, etc., up to a maximum of x = 156. The y values are random,
with a Poisson distribution, or the next thing to it.
After reading in the data,
2 matches
Mail list logo