Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
4
403FinalProj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
irisqlin
403FinalProj
Commits
20fc1cc4
Commit
20fc1cc4
authored
3 years ago
by
irisqlin
Browse files
Options
Downloads
Patches
Plain Diff
Update FinalProj.Rmd
parent
03a4b8c8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FinalProj.Rmd
+11
-9
11 additions, 9 deletions
FinalProj.Rmd
with
11 additions
and
9 deletions
FinalProj.Rmd
+
11
−
9
View file @
20fc1cc4
...
...
@@ -197,6 +197,9 @@ 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.
```{r}
# making models
drinks_threshold <- mean(data$X30drink)
...
...
@@ -210,27 +213,26 @@ summary(fiveDrinks_mod)
drinks_mod_1 <- glm(drinks_var ~ truth + decision + excite + safe + best.school + grades + Wpdrink, data = data, family = "binomial")
summary(drinks_mod_1)
# dropped p > 0.1
# dropped p > 0.1
,
drinks_mod_2 <- glm(drinks_var ~ truth + decision + excite + safe + best.school + Wpdrink, data = data, family = "binomial")
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
anova(drinks_mod_1, drinks_mod_2, test = "LRT")
#
Both of these are not s
ignificant, which means
dropping
the
v
ar
iables we did was not significant.
#
S
ignificant, which means
we may prefer
the
l
ar
ger model
# TODO: idk what this does
anova(drinks_total_mod, drinks_mod_1, test="Chisq")
# Drop in deviance test
anova(drinks_mod_2, drinks_mod_1, test="Chisq")
# The difference in deviance is significantly significant, the drop in dev test prefers the smaller model
#drop in deviance test compares residual de
i
vance
s
from two models
#drop in deviance test compares residual dev
i
ance 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(drinks_mod_1, drinks_mod_2, test = "Chisq")
```
## Cig model
```{r}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment