Null hypothesis testing

Null hypothesis testing uses p-values to test if a variable differs significantly from zero. Recently, the abuse and overuse of null hypothesis testing and p-values has caused the American Statistical Association to issue a statement about the use of p-values.

Because of criticisms such as these and other numerical challenges, Doug Bates (the creator of the lme4 package) does not include p-values as part of his package. Yet, you may still want or need to estimate p-values. To fill this need, several packages exist, including the lmerTest package.

lmerTest uses the same lmer() syntax as the lme4 package, but includes different outputs. During this exercise, you will fit a lmer() model using lmerTest and lme4.

This exercise is part of the course

Hierarchical and Mixed Effects Models in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Load lmerTest
library(___)

# Fit a lmer use lme4
out_lme4 <- 
	lme4::___(Crime ~ Year2 + (1 + Year2 | County), 
              data = md_crime)

# Fit a lmer use lmerTest
out_lmerTest <- 
	lmerTest::___(Crime ~ Year2 + (1 + Year2 | County), 
                  data = md_crime)

# Look at the summaries
summary(out_lme4)
summary(out_lmerTest)