Skip to content
Prev 19285 / 20628 Next

Natural spline (i.e. ns() ) with glmer()/lmer()

Hello All,

I would like to double check my understanding with the followings:

1 - In a linear mixed model if I use ns() for a continuous variable with for example one knot then I'll have two pieces of natural splines (i.e. third degree polynomial) one before the knot and one after the knot.

2 - But if I run the same ns() in a linear mixed model without any knots, does that mean I am fitting one 3rd degree polynomial between the boundaries (i.e. over the range of my continuous variable)?

Best,

Hedyeh Ahmadi, Ph.D.
Applied Statistician
Keck School of Medicine
Department of Preventive Medicine
University of Southern California

Postdoctoral Scholar
Institute for Interdisciplinary Salivary Bioscience Research (IISBR)
University of California, Irvine

LinkedIn
www.linkedin.com/in/hedyeh-ahmadi<http://www.linkedin.com/in/hedyeh-ahmadi>