[R-sig-ME] Questions regarding bs() interaction in lmer()

Hedyeh Ahmadi hedyeh@h @end|ng |rom u@c@edu
Fri May 27 20:17:59 CEST 2022


Hello All,
I am running a lmer() model as follows. The following model gives all the interactions for before and after knots shown below. I have 3 questions:

  1.  I would like to suppress the highlighted interactions that is before and after the knot. I have tried the update() command with -bs(reshist, knots = 7, degree = 1)2:bs(age, knots = 126, degree = 1)1, which did not work.
  2.  How would I define the knots for the interaction term and is what I have a correct specification?
  3.  Is there a package that would take this model and output interpretable parameter estimates for splines?

Thank you in advance for your time

smri_left <-
  lmer(smri ~ 1 +
         bs(reshist, knots=7, degree = 1)+
         bs(age, knots=126, degree = 1)+
         bs(reshist, knots=7.787, degree = 1)*bs(age, knots=126, degree = 1)+
         ethnicity.1_bl + high.bl + neighb_avg_p_bl
         (1|site/subject)  ,
         REML = FALSE,
         control = lmerControl(optimizer = "Nelder_Mead"),
         data=WG)

Fixed effects:
                                                                                                                            Estimate         Std. Error     df                      t value             Pr(>|t|)
(Intercept)                                                                                                         2.6679353    0.0114634  652.5132635    232.736        < 0.0000000000000002 ***
bs(reshist, knots = 7, degree = 1)1                                                                0.0090600    0.0100475 1059.5955954   0.902              0.36741
bs(reshist, knots = 7, degree = 1)2                                                                0.0082266    0.0132667  559.1847547   0.620              0.53545
bs(age, knots = 126, degree = 1)1                                                                -0.0137868    0.0081986 6143.2470351  -1.682              0.09270 .
bs(age, knots = 126, degree = 1)2                                                                -0.0834209    0.0094686 5534.8186306  -8.810          < 0.0000000000000002 ***
ethnicity.1_blHispanic                                                                                     0.0154627    0.0030354 3492.3232613   5.094           0.00000036893 ***
ethnicity.1_blOther                                                                                          0.0158286    0.0033031 8304.5129245   4.792             0.00000167908 ***
high.blBachelor                                                                                                 0.0022701    0.0044227 8691.0032954   0.513              0.60777
high.blHS Diploma/GED                                                                                  -0.0009402    0.0045056 8757.0427133  -0.209              0.83472
neighb_avg_p_bl                                                                                              0.0001371    0.0009128 8628.5294654   0.150              0.88060
bs(reshist, knots = 7, degree = 1)1:bs(age, knots = 126, degree = 1)1   -0.0091887    0.0095058 6161.8339520  -0.967              0.33376
bs(reshist, knots = 7, degree = 1)2:bs(age, knots = 126, degree = 1)1   -0.0148081    0.0128074 6412.6567741  -1.156              0.24764
bs(reshist, knots = 7, degree = 1)1:bs(age, knots = 126, degree = 1)2    0.0080632    0.0109929 5538.9731189   0.733              0.46329
bs(reshist, knots = 7, degree = 1)2:bs(age, knots = 126, degree = 1)2   -0.0592144    0.0150237 5595.8147976  -3.941        0.00008199861 ***
---
Signif. codes:  0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Best,

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

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





	[[alternative HTML version deleted]]



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