[R-sig-ME] question regarding output using lme4
Ben Bolker
bbolker at gmail.com
Sat Jan 11 15:54:18 CET 2014
On 14-01-11 09:23 AM, Elin Renborg wrote:
> I wonder if someone could help me… I get the output below when I use
> the lmer function from the lme4 package, and I don’t seem to find an
> answer to what dam.1 and sire.1 stand for.
>
> Best regards,
>
> Elin Renborg
>
>
Your problem is that you have inadvertently specified the 'sire' and
'dam' random effects twice; since (1 | sire/salt) (for example) expands
to (1|sire) + (1|sire:salt) (where sire:salt indicates an *interaction*
between sire and salt), (1 | sire ) + (1 |sire/salt) expands to (1 |
sire) + (1| sire) + (1|sire:salt).
It would be nice if we could (1) automatically detect and
collapse/drop redundant terms; (2) do a better job warning on redundant
terms, but so far we can't.
The solution is simply to use (1|sire/salt) + (1|dam/salt), leaving
out the (1|sire) and (1|dam) terms.
>> lmer.tot <- lmer(metsucc ~ matrix + salt + (1 | sire) + (1 | dam) +
>> (1 | sire/salt) + (1 | dam/salt), weights=baseS, data = gf)
>> summary(lmer.tot)
> Linear mixed model fit by REML ['lmerMod'] Formula: metsucc ~ matrix
> + salt + (1 | sire) + (1 | dam) + (1 | sire/salt) + (1 |
> dam/salt) Data: gf
>
> REML criterion at convergence: 240.7323
>
If you look at the variance estimates here, and just focus on the orders
of magnitude, you'll see that both 'dam' terms (dam and dam.1) are tiny,
and one of the sire terms is much smaller than the
Groups Name Variance Std.Dev.
salt.dam (Intercept) 1.073e-03 3.275e-02
salt.sire (Intercept) 5.051e-05 7.107e-03
dam (Intercept) 2.313e-19 4.810e-10
sire (Intercept) 1.943e-10 1.394e-05
dam.1 (Intercept) 2.249e-18 1.500e-09
sire.1 (Intercept) 7.323e-05 8.558e-03
Residual 6.299e-03 7.936e-02
> Fixed effects: Estimate Std. Error t value (Intercept) 0.15144
> 0.01336 11.34 matrixF2 0.07083 0.01530 4.63 matrixF3
> -0.03134 0.01525 -2.06 matrixF4 0.04096 0.01529 2.68
> matrixF5 0.03625 0.01527 2.37 matrixF6 0.03222
> 0.01522 2.12 salt27.5 0.63279 0.01219 51.90 salt30.5
> 0.61029 0.01220 50.01 salt33.5 0.02474 0.01223 2.02
> salt36.5 -0.17741 0.01228 -14.45
>
> The experimental design is as follows (with one family missing): 6
> matrices of 9 crosses (3 males x 3 females) yielding 53 families (one
> missing). All families were exposed to 5 different salinities (salt)
> yielding 265 observations. Male/sire and female/dam effects are
> treated as random and matrix and salt as fixed.
>
>> str(gf)
> 'data.frame': 265 obs. of 16 variables: $ pop : Factor w/ 1 level
> "Gullmarsfjorden": 1 1 1 1 1 1 1 1 1 1 ... $ date : Factor w/ 3
> levels "17/07/2011","18/07/2011",..: 1 1 1 1 1 1 1 1 1 1 ... $ matrix
> : Factor w/ 6 levels "F1","F2","F3",..: 1 1 1 1 1 1 1 1 1 1 ... $
> animal : Factor w/ 53 levels "GF01","GF02",..: 1 1 1 1 1 2 2 2 2 2
> ... $ sire : Factor w/ 18 levels "GS01","GS02",..: 1 1 1 1 1 1 1 1
> 1 1 ... $ dam : Factor w/ 18 levels "GD01","GD02",..: 1 1 1 1 1 2
> 2 2 2 2 ... $ sal : num 24.5 27.5 30.5 33.5 36.5 24.5 27.5 30.5
> 33.5 36.5 ... $ cleav : int 28 45 24 22 0 42 47 33 27 0 ... $ fert
> : int 14 4 3 16 22 14 4 13 14 5 ... $ tot : int 67 71 57 54 38
> 88 72 78 66 9 ... $ met : int 14 31 19 6 0 29 38 24 0 0 ... $
> larv : int 0 6 5 1 0 1 6 14 0 0 ... $ base : int 42 49 27 38 22
> 56 51 46 41 5 ... $ metsucc: num 0.333 0.633 0.704 0.158 0 ... $
> salt : Factor w/ 5 levels "24.5","27.5",..: 1 2 3 4 5 1 2 3 4 5
> ... $ baseS : num 6.48 7 5.2 6.16 4.69 …
>
> __________________________________
>
> Elin Renborg, PhD Student Dept of Biological & Environmental Sciences
> - Tjärnö University of Gothenburg SE-452 96 Strömstad, Sweden
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
>
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list