Re: [R] mgcv package plot superimposing smoothers

2010-12-06 Thread Jannis
Hi Jef, I would extract the information about the smoothers and plot them using standard plotting routines. After Mtest <- gam(outcome ~ s(age, by=as.numeric(gender==0)) + s(age,by=as.numeric(gender==1))+factor(Gender)) run something similar to: smoothers <- predict(s,type='terms') and you

[R] mgcv package plot superimposing smoothers

2010-12-03 Thread Jef Vlegels
Dear R help list, I'm fitting a 'variable coefficient model' in the MGCV package and I want to plot the different smoothers I get for each factor level in one graph. So, I do something like this to fit the gam: Mtest <- gam(outcome ~ s(age, by=as.numeric(gender==0)) + s(age,by=as.numeric(gender=