Dear R-experts,
I have fitted a model with 2-way and 3-way interactions.
I would like, for the 3-way interaction (year,age,by=education), to obtain 3D-plots. How could I do that ?
Many thanks for your response.
Here is the reproducible example:
#############
install.packages("ISLR")
library(ISLR)
install.packages("mgcv")
library(mgcv)
mod1<-gam(wage ~education+s(age,bs="ps")+year+te(age,year,bs="ps")+s(year,bs="ps",by=education,m=1)+te(year,age,by=education,bs=rep("ps",2)),data=Wage)
plot(mod1)
#############