diff --git a/FinalProj.Rmd b/FinalProj.Rmd index 118e6b2f6a633c97afb2f81f12cffa2e1e3c4562..f803b2529965f71ba10482afd5e859f588f1019f 100644 --- a/FinalProj.Rmd +++ b/FinalProj.Rmd @@ -198,8 +198,7 @@ round(cor(data[, -c(1, 2, 3, 4, 6)], 3)) ## Drinks Model(s) -Using the wald-test, liklihood ratio test, and the drop-in-deviance tests, we prefer drinks_mod_2. - +Using the wald-test, liklihood ratio test, and the drop in deviance tests, we prefer drinks_mod_2. ```{r} # making models drinks_threshold <- mean(data$X30drink) @@ -207,7 +206,7 @@ data$drinks_var <- ifelse(data$X30drink >= drinks_threshold, 1, 0) # total model drinks_total_mod <- glm(drinks_var ~ pride + truth + responsibility + friends + fix.problems + decision + excite + hard.work + safe + best.school + talk.adult +grades + Wpdrink + N.safe, data = data, family = "binomial") -summary(fiveDrinks_mod) +summary(drinks_total_mod) # dropped p > 0.1 drinks_mod_1 <- glm(drinks_var ~ truth + decision + excite + safe + best.school + grades + Wpdrink, data = data, family = "binomial") @@ -220,9 +219,9 @@ summary(drinks_mod_2) #likelihood ratio test to test whether the observed difference in model fits is statistically significant # source: https://www.listendata.com/2016/07/insignificant-levels-of-categorical-variable.html anova(drinks_total_mod, drinks_mod_1, test="LRT") -#Not significant, which means we ,ay prefer the smaller model +#Not significant, which means we may prefer the smaller model anova(drinks_mod_1, drinks_mod_2, test = "LRT") -#Significant, which means we may prefer the larger model +#Not significant, which means we may prefer the smaller model # Drop in deviance test anova(drinks_mod_2, drinks_mod_1, test="Chisq")