Meanwhile, I found the solution myself:
using plot.gam() with shift=intercept and trans=exp (for a poisson model) does
the job. I can then
add the original data using points()
Thanks again for your help, which is greatly appreciated!
Best wishes
Christoph
Am 16/07/2013 11:04, schrieb Simon Woo
Thanks, the sequence of x0 values was clearly too short.
However, is there a way to overlay the (marginal) curve from plot.gam() over a
plot of (x,y) values?
Best wishes
Christoph
Am 16/07/2013 11:04, schrieb Simon Wood:
> Probably you didn't want to set x0=0:1? Here is some code, to do what
Probably you didn't want to set x0=0:1? Here is some code, to do what you want.
(The CI shape is not identical to the plot(b) version as the uncertainty
includes
the uncertainty in the other smooths and the intercept now.)
library(mgcv)
set.seed(2)
dat <- gamSim(1,n=400,dist="normal",scale=2)
b
Dear R users,
I´ve stumbled over a problem that can be easily seen from the R code below:
- When I use plot.gam() on a fitted model object, I get a nice and well-looking
smooth curve for all
terms in the model.
- However, when I use predict(model) for a given predictor, with values of all
othe
4 matches
Mail list logo