Skip to content
Prev 516 / 20628 Next

Can we do b-spline within lmer function?

Dear Zhong,
Two (probably) minor comments:
(i) As stated in ?bs, "bs(x)" defaults to a simple third degree 
polynomial, therefore if you wants real splines you have to play with 
the argument df and/or knots.

(ii) In theory you can move to penalized B-splines (i.e., P-splines 
which appear to be preferable to simple b-splines) in a mixed model 
framework. However lmer and friends may not be used because it does not 
appear possible to specify the proper covariance matrix for the random 
effects (you should use a multiple of identity matrix as pdDiag in 
nlme::lme())

all the best,
vito



Zhong, Xiao ha scritto: