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
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=
2 matches
Mail list logo