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>
Natural spline (i.e. ns() ) with glmer()/lmer()
2 messages · Hedyeh Ahmadi
Just a clarification, when I say "third degree polynomial" I mean, it generates a basis matrix for representing the family of piecewise-cubic splines with the specified sequence of interior knots, and the natural boundary conditions. Best, Hedyeh Ahmadi, Ph.D. 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>
From: R-sig-mixed-models <r-sig-mixed-models-bounces at r-project.org> on behalf of Hedyeh Ahmadi <hedyehah at usc.edu>
Sent: Friday, May 21, 2021 7:47:48 PM
To: r-sig-mixed-models at r-project.org <r-sig-mixed-models at r-project.org>
Subject: [R-sig-ME] Natural spline (i.e. ns() ) with glmer()/lmer()
Sent: Friday, May 21, 2021 7:47:48 PM
To: r-sig-mixed-models at r-project.org <r-sig-mixed-models at r-project.org>
Subject: [R-sig-ME] 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 https://urldefense.com/v3/__http://www.linkedin.com/in/hedyeh-ahmadi__;!!LIr3w8kk_Xxm!6PUpiQYPrgA3Fbz27Esf9awfY2HmnPLrPbPDJqoI4oUYiCY8mKXv0w7CCGwAYgU$ <https://urldefense.com/v3/__http://www.linkedin.com/in/hedyeh-ahmadi__;!!LIr3w8kk_Xxm!6PUpiQYPrgA3Fbz27Esf9awfY2HmnPLrPbPDJqoI4oUYiCY8mKXv0w7CCGwAYgU$ > [[alternative HTML version deleted]] _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models__;!!LIr3w8kk_Xxm!6PUpiQYPrgA3Fbz27Esf9awfY2HmnPLrPbPDJqoI4oUYiCY8mKXv0w7CEqjBXMs$