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

Update finalproject

parent 42b3ed5f
No related branches found
No related tags found
No related merge requests found
......@@ -185,11 +185,22 @@ hist(as.numeric(data$X30marijuana))
summary(data)
# TODO: as numeric all the predictor variables
round(cor(data[, -c(1, 2, 3, 4, 6)], 3))
```
```{r}
# making models
fiveDrinks_threshold <- mean(data$X30.5drinks)
data$fiveDrinks_var <- ifelse(data$X30.5drinks >= fiveDrinks_threshold, 1, 0)
#fiveDrinks_mod <- glm(fiveDrinks_var ~ pride + truth + responsibility + friends + fix.problems + decision + excite + hard.work + safe + best.school + talk.adult + grades + Wpdrink + N.safe, data = data, family = "binomial")
fiveDrinks_mod <- glm(fiveDrinks_var ~ Wpdrink, data = data, family = "binomial")
summary(fiveDrinks_mod)
fiveDrinks_mod <- glm(fiveDrinks_var ~ friends, data = data, family = "binomial")
summary(fiveDrinks_mod)
```
......
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