Does anybody have any suggestions on how I might simulate from fitted GAM model? I am using the gam function in the mgcv package to fit a variable coefficient model like the following from the examples. I would like simulate based on the fitted model like the simulate function in the stats package does for lm models.
library(mgcv) set.seed(10) ## simulate date from y = f(x2)*x1 + error dat <- gamSim(3,n=400) b<-gam(y ~ s(x2,by=x1),data=dat) Thanks for any help you can give, Mark Lyman ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.