# Explaining Fixed and Random Effects

Let's say that I am trying to predict the Sepal Length in Iris data from Sepal Width, Petal Width, and Petal Length variables.

Say, we noted that Petal Length and Petal Width are grouped as described by the Species variable.

I am using the following mixed-effects model for this.

libraray(lme4)

fit <- lmer(Sepal.Length ~ Sepal.Width + Petal.Length +  Petal.Width +
(1 + Petal.Length + Petal.Width | Species), data = iris)


My question is how to explain this model concisely in plain language?

For example: In our mixed-effect model, we considered Petal Length and Petal Width to be random effect variables as they may contain variation that can be explained from the Species variable. Further, we assumed all three Sepal Width, Petal Length, and Petal Width are fixed-effect variables.

• I probably wouldn't fit a mixed model to a situation like this (see here, eg), although this may be just an example to illustrate your question. Aug 23 '19 at 19:26
• @gung, thanks a lot for pointing this out. Although this is an example, I did not realize that the number of "Species" levels has to be large. Any idea on how to determine which would be a sufficiently large number? Aug 24 '19 at 6:40
• I don't know that there's a fixed number. You'll see different recommendations: some will say 30, others will say 100. I just wouldn't do it with 3. Aug 24 '19 at 11:51

I typically suggest to people to write it is as follows:

To account for the correlations of sepal length measurements within a flower species we fitted a linear mixed-effects model. In the fixed-effects part, we included the linear effects of sepal width, petal length, and petal widths. In the random-effects part, we included intercepts and linear random slopes for petal length and petal width.

In case you have done so, you can also write:

The assumptions of the model were evaluated using residuals plots. The random-effects structure was selected using likelihood ratio tests, and p-values for the fixed effects coefficients are based on F- and t-tests using the Satterthwaite's approximation for the degrees of freedom. The models were fitted in R using packages lme4 and lmerTest.