Skip to content
Snippets Groups Projects
Commit eda8ea55 authored by irisqlin's avatar irisqlin
Browse files

Update finalproject

parent 2fef1155
No related branches found
No related tags found
No related merge requests found
......@@ -199,10 +199,10 @@ fiveDrinks_mod <- glm(fiveDrinks_var ~ pride + truth + responsibility + friends
summary(fiveDrinks_mod)
fiveDrinks_mod_1 <- glm(fiveDrinks_var ~ Wpdrink + friends, data = data, family = "binomial")
summary(fiveDrinks_mod_1)
#summary(fiveDrinks_mod_1)
fiveDrinks_mod_2 <- glm(fiveDrinks_var ~ friends, data = data, family = "binomial")
summary(fiveDrinks_mod_2)
#summary(fiveDrinks_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
......@@ -211,13 +211,19 @@ anova(fiveDrinks_mod_1, fiveDrinks_mod_2, test="LRT")
fiveDrinks_mod_3 <- glm(fiveDrinks_var ~ Wpdrink + friends, data = data, family = "binomial")
summary(fiveDrinks_mod_3)
#summary(fiveDrinks_mod_3)
fiveDrinks_mod_4 <- glm(fiveDrinks_var ~ Wpdrink, data = data, family = "binomial")
summary(fiveDrinks_mod_4)
#summary(fiveDrinks_mod_4)
anova(fiveDrinks_mod_3, fiveDrinks_mod_4, test="LRT")
#drop in deviance test compares residual deivances from two models
# source: https://bookdown.org/roback/bookdown-BeyondMLR/ch-poissonreg.html#cs-philippines
# source: https://bookdown.org/roback/bookdown-BeyondMLR/ch-logreg.html
anova(fiveDrinks_mod_3, fiveDrinks_mod, test = "Chisq")
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment