r - Plot GAM relation between variable and estimated variable -


i running gam model this:

library(mgcv) set.seed(2) ## simulate data...  dat <- gamsim(1,n=400,dist="normal",scale=2) b <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat) 

i know can plot outcome so:

plot(b,pages=1) plot(b, select = 1) plot(b, select = 2) 

but looking plot shows x0 on x-axis, y on y-axis, data-points, , estimated line showing model b.

in order this:

enter image description here


Comments