[R-sig-ME] Lmer model drops one parameter

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Wed Mar 17 19:29:57 CET 2021


    This is a classic issue with any model based on linear models (LMs, 
GLMs, LMMs, GLMMs, ...).  When you have a categorical predictor (factor) 
with n levels in a model with an intercept, there are only (n-1) 
*independent* parameters that can be fitted. There are lots of ways 
these parameters can be organized (called "contrasts"). R's default is 
to make the intercept equal to the expected value for the first level in 
the factor (by default, the first category in alphabetical order) and to 
the make the other (n-1) parameters correspond to the differences 
between levels 2 and 1, 3 and 1, ... n and 1.

   If you want the model to estimate the means of each group, include -1 
or +0 in your formula - this will suppress the intercept (but make the 
parameters basically useless for statistical inference, as you'll be 
comparing against a null hypothesis that the mean response in each group 
is zero).

    The emmeans and effects packages are useful (so is Rob Robinson's 
answer).

On 3/17/21 1:59 PM, Pierre Marle wrote:
> Dear everyone,
> 
> I have a lmer model to predict [Hg] according to a categorical variable (7 parameters for 134 observations) as fixed effects and the species as random effect.
> 
> The issue that I have is that the summary of model dropped one parameter of the qualitative variable. This is not a problem of unsufficient data of the dropped parameter because it has a high number of observations comparing with other parameters. Moreover, I don’t have any warning message after the model processing.
> 
> lme <- lmer(Hg ~ Feeding_type + (1|Sp), data=sp, REML=T)
> 
> Fixed effects:
>                                               Estimate    Std. Error       df t value Pr(>|t|)
> (Intercept)                              0.08404    0.01344 28.13392   6.254 9.06e-07 ***
> Feeding_typeGatherer          -0.06692    0.02261 27.57559  -2.960  0.00626 **
> Feeding_typeGrazer             -0.06701    0.02084 20.31009  -3.216  0.00427 **
> Feeding_typePiercer             -0.07752    0.03093 18.71971  -2.506  0.02161 *
> Feeding_typePredator           -0.03889    0.02026 25.21664  -1.919  0.06634 .
> Feeding_typeShredder          -0.04154    0.01722 27.41420  -2.413  0.02278 *
> Feeding_typeSponge-feeder  0.01674    0.02157 23.04972   0.776  0.44566
> 
> As you can see I’m using the lme4 package with REML=T. Should I change something to have the coefficients of all the feeding types in the summary?
> 
> I will be very grateful if someone could help me.
> 
> Kind regards
> 
> Pierre Marle
> Phd student / Research assistant
> pierre.marle using unige.ch<mailto:pierre.marle using unige.ch> / +41 22 379 0487
> 
> Département F.-A. Forel des sciences de l’environnement et de l'eau
> Laboratoire d’Ecologie et de Biologie Aquatique
> Sciences de la Terre et de l’Environnement
> Université de Genève
> 
> ADRESSE POSTALE:
> Université de Genève
> Carl-Vogt 66
> CH-1211 Genève 4
> SWITZERLAND
> __________________________________________
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models using 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