Statistical inference with Maryland crime data

Model Hierarki dan Mixed Effects di R

Richard Erickson

Data Scientist

Maryland crime data

  • Number of violent crimes per year by County
             County    Year Crime
        ANNE ARUNDEL   2006  3167
        BALTIMORE CITY 2006 10871
  • Useful for policy/crime analysis or insurance
  • Is the crime rate changing through time across counties?
Model Hierarki dan Mixed Effects di R

Null hypothesis test

  • $H_0$ : No difference exists
  • $H_a$: A difference exists
Model Hierarki dan Mixed Effects di R

P-values with lmer

library(lmerTest)
summary(lmer(...))
Model Hierarki dan Mixed Effects di R

ANOVA

  • Analysis of Variance (ANOVA)
  • Compare variability of model with and without parameter
  • lmer(response ~ (1 | group)) vs. lmer(response ~ predictor + (1 | group))
Model Hierarki dan Mixed Effects di R

Summary

  • Null hypothesis testing and ANOVAs
  • Build and compare models
  • High-level details, important assumptions covered in other DataCamp courses
Model Hierarki dan Mixed Effects di R

Let's practice!

Model Hierarki dan Mixed Effects di R

Preparing Video For Download...