1

I am running mixed linear models using lmer from lme4. We are testing the effect of family, strain and temperature on several growth factors for brook trouts. I have 4 families (variable FAMILLE) form which we sampled our individuals. 2 are from the selected strain and 2 are from the control strain (variable Lignee). For each strain, the 2 families were either marked as resistant (Res) or sensible (Sens). So my fixed effect variable (FAMILLE), is nested in my variable Lignee. The expermiment was conducted at 3 different temperatures.

Here is what my dataframe looks like :

structure(list(BASSIN = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("1", 
"2", "3", "4"), class = "factor"), t.visee = structure(c(2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L), .Label = c("15", "17", "19"), class = "factor"), FAMILLE = structure(c(2L, 
2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 
1L), .Label = c("RES", "SENS"), class = "factor"), Lignee = structure(c(2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L), .Label = c("CTRL", "SEL"), class = "factor"), taux.croiss.sp.poids = c(0.8, 
1.14285714285714, 1.42857142857143, 0.457142857142857, -0.228571428571429, 
0.628571428571429, 0.971428571428571, 0.742857142857143, 1.08571428571429, 
0.8, 0.571428571428571, 1.02857142857143, 0.8, 0.285714285714286, 
0.285714285714286, 0.571428571428571, 0.742857142857143, 1.14285714285714, 
0.628571428571429, 0.742857142857143, 1.02857142857143, 0.285714285714286, 
0.628571428571429, 0.628571428571429, 0.857142857142857, 0.8, 
1.08571428571429, 1.37142857142857, 0.742857142857143, 1.08571428571429, 
0.0571428571428571, 0.571428571428571, 0.171428571428571, 0.8, 
0.685714285714286, 0.285714285714286, 0.285714285714286, 0.8, 
0.457142857142857, 1.02857142857143, 0.342857142857143, 0.742857142857143, 
0.857142857142857, 0.457142857142857, 0.742857142857143, 1.25714285714286, 
0.971428571428571, 0.857142857142857, 0.742857142857143, 0.514285714285714
)), row.names = c(NA, -50L), class = c("tbl_df", "tbl", "data.frame"
))
          

Lignee has 2 levels (Sel and Ctrl) FAMILLE has 2 levels (Sens and Res)

So I have 4 distinct levels :

  1. Lignee Sel and FAMILLE Sens
  2. Lignee Sel and FAMILLE Res
  3. Lignee Ctrl and FAMILLE Sens
  4. Lignee Ctrl and FAMILLE Res

when I run for example this line to test the effect of the variables on the rate of weight gain:

model6 <- lmer((taux.croiss.sp.poids) ~ t.visee + Lignee/FAMILLE + (1 |BASSIN), data = mydata1, REML = FALSE)

and then

summary(model6)

<Linear mixed model fit by maximum likelihood . t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: (taux.croiss.sp.poids) ~ t.visee + Lignee/FAMILLE + (1 | BASSIN)
   Data: mydata1

     AIC      BIC   logLik deviance df.resid 
   115.2    139.5    -50.6    101.2      228 

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-3.11527 -0.59489  0.05557  0.69775  2.79920 

Random effects:
 Groups   Name        Variance Std.Dev.
 BASSIN   (Intercept) 0.01184  0.1088  
 Residual             0.08677  0.2946  
Number of obs: 235, groups:  BASSIN, 4

Fixed effects:
                         Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)              0.770942   0.209508 194.702337   3.680 0.000302 ***
t.visee                 -0.019077   0.011682 231.005933  -1.633 0.103809    
LigneeSEL                0.214062   0.054471 231.007713   3.930 0.000112 ***
LigneeCTRL:FAMILLESENS  -0.008695   0.054487 231.038877  -0.160 0.873358    
LigneeSEL:FAMILLESENS   -0.205001   0.054242 231.016973  -3.779 0.000200 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) t.vise LgnSEL LCTRL:
t.visee     -0.948                     
LigneeSEL   -0.131  0.000              
LCTRL:FAMIL -0.124 -0.007  0.504       
LSEL:FAMILL  0.000  0.000 -0.498  0.000>

From what I can understand, the model chooses 1 family as the reference group, which won't be in the output. But the problem here is that 2 groups are missing :

  • LigneeCTRL:FAMILLERES AND
  • LigneeSEL:FAMILLERES

Does somebody knows why my output is missing not ONE but TWO of the groups?

I'm french canadian so don't hesitate if some things are not clear, I will try to re-explain in other words!

Also, this is my 1st message on Stack, I tried to include everything needed but dont hesitate if I need to include some other things!

Thanks in advance

  • Your model includes a variable called `t.visee`, but this is missing from your data. Also, what is the role of `BASSIN` in your model? – zephryl Feb 18 '22 at 21:12
  • T.visee is the same as t.apex (which is the temperature) there are 3 levels : 15, 17 and 19. Bassin is the tank in which the fishes were during the experiment and is treated as a random variable. – Christophe Jourdain Bonneau Feb 18 '22 at 21:51
  • this is a fairly standard question (and is not specific to mixed models). Does this answer your question ... https://stackoverflow.com/questions/71055840/why-does-the-output-of-of-a-linear-mixed-model-using-lme4-show-one-level-of-a-fa#comment125630351_71055840 ? – Ben Bolker Feb 18 '22 at 22:06
  • Upon reading the thread you mentionned, it seems to me that I should have 1 group (the reference group alphabetically chosen by the function) missing from the output and acting as the intercept. Here, however, I have 2 groups missing from my output. The output is missing : LigneeCTRL:FAMILLERES AND LigneeSEL:FAMILLERES. – Christophe Jourdain Bonneau Feb 18 '22 at 23:03
  • I have modified the message so you guys can access a bigger chunk of my dataframe – Christophe Jourdain Bonneau Feb 20 '22 at 22:50

0 Answers0