Get Started

Understanding and reporting the outputs of a lmer

1. Understanding and reporting the output of a lmer

Previously in the chapter, we have gone over how to fit a linear mixed-effects model. In this section, we will go over how to extract and understand the output from these models. We will then examine the results from the model with a correlated random-effect.

2. The model

As a refresher, remember we built a model to predict the birth rate for each county that included the average age of the mother within each county as a fixed-effect and also included the average age of the mother of each county as a random-effect within each state. The model also fits State as a random-effect intercept. We saved this model as out so we can explore it in this video.

3. Print

Typing "out" in the console prints the model's output. We could also have used the print function: print(out). This output is similar to the output from a linear model, but includes some extra features. First, it tells us that we fit the model using REML, which stands for restricted maximum likelihood method. LMER uses this because numerically fitting a mixed-effects model can be difficult and the maximum likelihood approach often fails. Second, we see our input formula. Third, we see the REML criterion at convergence, which can be a helpful model diagnostic if our model is not converging. Fourth, we see the standard deviations for the random-effect and the residuals. Fifth, we get the number of observations and groups. Lastly, we get the fixed-effect, which is similar to the output of a linear model.

4. Summary

Summary produces output similar to the print option. However, summary provides additional details. To save screen space, I have replaced the duplicated material with three-dots. There are three main differences worth highlighting between summary and print. First, notice the summary details on residuals. Second, the fixed effects now include standard errors and t-values, but not p-values. We'll talk about why there are no p-values in the next video. Third, we are also given correlations of the estimators. If we were to "repeat" our experiment, we would expect a negative correlation between our fixed-effect and intercept, however, this output is usually not of interest to us.

5. Extracting fixed-effects estimates

If we only want the point estimates for the fixed-effect parameters, we can use the fixef function to call them. However, if we want the confidence intervals, we need a different function.

6. Extracting fixed-effects confidence intervals

We can get confidence intervals using the confint function in R for fixed effects. This function operates similar to the confint function on a linear model output.

7. Extracting random-effects

We can use the ranef function to call the random effect estimates, but we cannot extract the confidence intervals for these estimates. Doug Bates, author of the lme4 packages writes that "the way that I view a mixed-effects model, the random effects are unobserved random variables, not parameters, so standard errors are not defined." Bates goes on to suggest bootstrapping confidence intervals and points people on to Bayesian methods.

8. Reporting lmer output

When reporting the results from a lmer, the most important consideration is to know your audience. Reporting results in a popular press article differs greatly from a peer-reviewed scientific article. Additionally, different scientific fields have different expectations for reporting results. For technical and semi-technical reports, using figures to plot coefficients can be an effective method. Other times, a table can effectively display the results. Lastly, for non-technical audiences, inline descriptions might be the best method.

9. Let's practice!

Now, let's use lmer some more!