4
$\begingroup$

I have 2 Groups (Control and TRT, n=6x2) run in parrallel and I would like to highligh the potential effect of the treatement on variables (mydata[,ii]) measured daily (Day) during 80 days.

  • If I expect different reponses among the time, should I group my days by "Week" or should I keep "Days"?

  • Some variables are with high inter-animal variability at the begining of the experiment and with different slopes so I plan to use a random and slope intercept model

RandomIntercept <- lmer(mydata[,ii] ~ Group* Week* Days + (Days|Animal), mydata)

But for some variable, this model does not converge...

Other variables that I would like to test are normalized at the begining of the experiment meaning that each animal starts with the same intercept already.

  • Which model/test do you recommand for this type of data (I also have daily measure over 80days)?

Is it possible to run a mixed model with only random slope?

Many thanks in advance!

Edit following comments: Good point Robert, I added Days as a fixed effect , I am working on the quadratic effect, I never used splines, I need to do some research.

I can defintely share a subset of my data:

Random Intercept and slope model: (does not converge)

   > RandomInterceptNSlope <- lmer(pHF48h ~ Group*Week*Days + (Days|Animal), mydata)
Warning messages:
1: Some predictor variables are on very different scales: consider rescaling 
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.758143 (tol = 0.002, component 1)
3: Some predictor variables are on very different scales: consider rescaling
> RandomInterceptNSlope
Linear mixed model fit by REML ['lmerModLmerTest']
Formula: pHF48h ~ Group * Week * Days + (Days | Animal)
   Data: mydata
REML criterion at convergence: -1613.638
Random effects:
 Groups   Name        Std.Dev.  Corr
 Animal   (Intercept) 0.1407557     
          Days        0.0009194 0.58
 Residual             0.1047559     
Number of obs: 1056, groups:  Animal, 12
Fixed Effects:
       (Intercept)            GroupTRT                Week                Days       GroupTRT:Week       GroupTRT:Days           Week:Days  GroupTRT:Week:Days  
         5.049e+00          -1.838e-01           1.717e-02           6.035e-03           5.243e-03          -2.562e-03          -1.495e-04           2.276e-05  
fit warnings:
Some predictor variables are on very different scales: consider rescaling
convergence code 0; 1 optimizer warnings; 0 lme4 warnings
> TabResMMrIntercept
Type III Analysis of Variance Table with Kenward-Roger's method
                  Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Group           0.000428 0.000428     1  1042  0.0374 0.8466918    
Week            0.031788 0.031788     1  1038  2.7788 0.0958187 .  
Days            0.043107 0.043107     1  1038  3.7683 0.0525044 .  
Group:Week      0.000558 0.000558     1  1038  0.0488 0.8252454    
Group:Days      0.003130 0.003130     1  1038  0.2736 0.6010502    
Week:Days       0.137525 0.137525     1  1038 12.0220 0.0005473 ***
Group:Week:Days 0.000934 0.000934     1  1038  0.0816 0.7751391    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Random Intercept only:

    RandomIntercept <- lmer(pHF48h ~ Group*Week*Days + (1|Animal), mydata)
    > RandomIntercept
Warning messages:
1: Some predictor variables are on very different scales: consider rescaling 
2: Some predictor variables are on very different scales: consider rescaling 
> RandomIntercept
Linear mixed model fit by REML ['lmerModLmerTest']
Formula: pHF48h ~ Group * Week * Days + (1 | Animal)
   Data: mydata
REML criterion at convergence: -1576.855
Random effects:
 Groups   Name        Std.Dev.
 Animal   (Intercept) 0.2138  
 Residual             0.1070  
Number of obs: 1056, groups:  Animal, 12
Fixed Effects:
       (Intercept)            GroupTRT                Week                Days       GroupTRT:Week       GroupTRT:Days           Week:Days  GroupTRT:Week:Days  
         5.049e+00          -1.838e-01           1.717e-02           6.035e-03           5.243e-03          -2.562e-03          -1.495e-04           2.276e-05  
fit warnings:
Some predictor variables are on very different scales: consider rescaling
> anova(RandomIntercept, ddf="Kenward-Roger")
Type III Analysis of Variance Table with Kenward-Roger's method
                  Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Group           0.000428 0.000428     1  1042  0.0374 0.8466918    
Week            0.031788 0.031788     1  1038  2.7788 0.0958187 .  
Days            0.043107 0.043107     1  1038  3.7683 0.0525044 .  
Group:Week      0.000558 0.000558     1  1038  0.0488 0.8252454    
Group:Days      0.003130 0.003130     1  1038  0.2736 0.6010502    
Week:Days       0.137525 0.137525     1  1038 12.0220 0.0005473 ***
Group:Week:Days 0.000934 0.000934     1  1038  0.0816 0.7751391    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
$\endgroup$
1
  • $\begingroup$ It would be better to show data than to ask an open ended question that depends on what is in the data. It is not possible to sort through what assumptions are and are not valid without testing. $\endgroup$ – Carl Jan 13 '20 at 14:52
3
$\begingroup$

It doesn't make sense to fit random slopes for Days without including it also as a fixed effect, unless you know the the overall effect of Days is zero. Try including it also a a fixed effect.

If it still doesn't converge, try removing Days as a random slope, and just keeping it fixed.

If the first measurement of Days is much above zero, then you might also want to center it.

Also, you may want to allow Days to enter the model non-linearly, so try including quadratic and/or higher order terms, or perhaps even better, splines.

Finally, you have Days and Week in your model - this could also be a problem - you probably need one, or the other, but not both.

$\endgroup$
5
  • $\begingroup$ I agree for Days and Week in the model that can be a problem, one of my question is that should I keep Days or Week in this kind of model? - I do not expect a diferrenece within days but potentially within Weeks. -Sorry, quite new user of this forum- $\endgroup$ – Nicheca Nicheca Jan 14 '20 at 8:53
  • $\begingroup$ I would want to use Day if possible, since you have daily measurements. $\endgroup$ – Robert Long Jan 14 '20 at 9:40
  • $\begingroup$ Thanks Robert, If I use Day, I can not highlight a potential difference of TRT between week, correct? $\endgroup$ – Nicheca Nicheca Jan 14 '20 at 10:25
  • $\begingroup$ @NichecaNicheca does this answer your question ? If so please consider marking it as the accepted answer. If not, please let me know why $\endgroup$ – Robert Long Jan 22 '20 at 13:29
  • $\begingroup$ I am still not sure how will be the best to investigate the week effect? $\endgroup$ – Nicheca Nicheca Jan 22 '20 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.