# Summary

Let's summarize the essential points from the chapter we just covered.

Let’s summarize what we’ve learned so far in this chapter.

**Mixed-effects models:** We learned that mixed-effects models allow us to partition the variance in data into two groups: the data that we’re interested in, called the fixed effects, and the data that we aren’t interested in, called the random effects.

**Fixed versus random:** We saw that fixed effects influence the mean of the data, whereas random effects influence the variance.

**The lmer() and glmer() functions:** We looked at many functions that are used to run mixed-effects models in R. The most widely used of these functions are

`lmer()`

and `glmer()`

in the lme4 package.**Mixed-effects models versus linear models:** We learned to code a mixed-effects model, which is essentially the same as coding a linear model or generalized linear model, with the exception that the specified random effects are included inside a set or sets of parentheses when coding a mixed-effects model.

**Random effects:** We also learned that creating overly complicated random effects structures may prevent the model from running. Therefore, we must try to keep the random effects as simple as possible.

**Marginal means:** We discovered that estimating marginal means with the emmeans package can be useful with mixed-effects models because accounting for the variance due to random effects can sometimes significantly alter the estimates of regression coefficients.

Get hands-on with 1200+ tech skills courses.