[R-sig-ME] Can we do b-spline within lmer function?

Zhong, Xiao xiaozh at WPI.EDU
Mon Jan 14 23:42:00 CET 2008


Thanks, Ken.

I tried your advice on my model:

model2.growth.mcas5 <- lmer(response ~ bs(monthElapsed) + skills + (1|studentID), data= mcas5, family=binomial(link="logit"), control =
list(msVerbose = 1, usePQL = FALSE))

It worked! What it gave me is:

                      (Intercept)                  bs(monthElapsed)1                  bs(monthElapsed)2                  bs(monthElapsed)3
                        -0.1509712                          0.7019262                         -0.1934738                          0.6257330
                  skillsG-Geometry                skillsM-Measurement    skillsN-Number-Sense-Operations skillsP-Patterns-Relations-Algebra
                        -0.4333880                         -0.9468761                          0.5263370                          0.1897903

Since I am trying to use design matrix to predict after that glmm fitting, could you tell me if there is some function/command that I can use to find what the three "bs" did to my "monthElapsed" variable?

Thanks!

Xiao


________________________________________
From: Ken Beath [kjbeath at kagi.com]
Sent: Monday, January 14, 2008 3:29 PM
To: Zhong, Xiao
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] Can we do b-spline within lmer function?

On 15/01/2008, at 2:59 AM, Zhong, Xiao wrote:

> Hello,
>
> I am working on a project that uses glmm. I would like to consider b-
> spline in the original glmm but I couldn't find how to add b-spline
> terms to the normal lmer function. Is there anybody who could help
> me with that?
>

library(splines)
fm2 <- lmer(Reaction ~ bs(Days) + (1|Subject), sleepstudy)

Ken




More information about the R-sig-mixed-models mailing list