1. Statistical inference with Maryland crime data
Applying mixed-effect models requires the use of statistical inferences. During this lesson, we will talk about two different methods with mixed effect models: Null-hypothesis testing of covariates and applying analysis of variance or ANOVAs to compare models. We'll also introduce a new dataset, the Maryland crime dataset.
2. Maryland crime data
Maryland provides their annual crime data on data dot gov. Their data include the number of violent crimes per county. Policy analysts, academics, and private sector interests, such as insurance companies, are interested in how these numbers change over time. These numbers are reported on the county-level. Each county can, and likely does, have its own changes over time. We will be exploring this data and comparing different methods for statistical inferences using it.
3. Null hypothesis test
Most introductory statistics courses cover null hypothesis testing as part of frequentist statistics. This approach compares a model or parameters within a model to a straw man hypothesis in that no effect occurs. These can be used within mixed-effect models to estimate if parameters vary due to chance alone. You will see how to view the output from lmer models in the exercises.
4. P-values with lmer
By default, the lme4 package does not include p-values. There are several reasons for this. First, p-values cannot be estimated for the random-effects because these are latent variables without standard deviations. Second, estimating p-values for fixed-effects within a mixed-effect model is currently an open research question, which includes an on-going debate on the best practices for how to calculate degrees of freedom. However, several ad-hoc packages do exist. One such package is lmerTest. We'll use this package in our exercises.
5. ANOVA
Analysis of variance or ANOVA is a powerful statistical tool. Usually, it is used to compare variance within and between groups to see if the groups differ from each other. ANOVA can also be used to compare mixed-effect models. When applying ANOVAs to mixed-effect models, we compare the variability explained by one model to the variability explained by another model. The model that best explains the variability is the one we use. For example, if we wondered whether a specific response variable was important, we could build two models, one with the parameter and one without. The model that the ANOVA said did a better job of explaining the variability would be the model we want to use with our data.
6. Summary
We've gone over two methods for comparing mixed-effect models. These methods allow us to build and compare models as well as determine what predictor variables are important. I've only provided a high-level overview of these approaches.
7. Let's practice!
Now, let's use these methods to compare mixed-effect models!