Skip to content
Prev 296047 / 398525 Next

GAM interactions, by example

Geraldine,

They really are the same fit, try...

range(fitted(b)-fitted(b1))
  [1] -3.333782e-10  4.173699e-10

... for example.

The edf differences are just down to differences in how identifiability 
constraints are handled in the two cases. For b1 the smooths of x2 do 
not have centring constraints applied (see ?gam.models) so each such 
smooth has one more degree of freedom than in b, where centering 
constraints are applied. If you look at the total edf for the two 
versions they are identical.

The explained deviance difference is down to what is counted as the 
"null deviance" when you have a `-1' in the model formula (it's the same 
behaviour as with r^2 in lm, for example)... arguably this behaviour is 
not so sensible, but it is consistent with other modelling functions...

best,
Simon
On 29/05/12 10:29, Mabille, Geraldine wrote: