Skip to content
Prev 172218 / 398506 Next

gamm (mgvc) and time-varying coefficient model

Looks correct to me. You get a smooth of time for each level of "x", so the 
smooths describe the way in which each coefficient of x varies in time.

Note that the time varying coefficient for some level of a factor is actually 
given by the sum of the smooth for that factor level, and the estimate of the 
coefficient for that factor level from the parametric part of the model. For 
this reason it might actually be slightly better to use model formula:

y ~  factor(x) + s(time, by=factor(x)) - 1

which will ensure that the coefficients for factor(x) are directly 
interpretable as the `average' values of the coefficents for each factor 
level. 

best,
Simon
On Sunday 01 March 2009 23:52, Marie-Pierre Sylvestre wrote: