-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.Rhistory
33 lines (33 loc) · 1.3 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#import the binary.csv file from canvas. Make sure to include headers
read.csv("~/binary")
library(readr)
binary <- read_csv("~/multivariate/binary.csv")
View(binary)
#Question 1
#Run a frequency analysis to see how many students were admitted. Include code below.
frequency(binary$admit)
#Question 1
#Run a frequency analysis to see how many students were admitted. Include code below.
hist(binary$admit)
#Question 2
#Use the glm() function to perform a logistic regression with admit as the DV
#and gre, gpa, and rank as the predictors. Include code below.
glm(admit ~ gre + gpa + rank, data = binary, family = "binomial")
summary(binary)
#Question 3
#Compute the odds ratios and 95% confidence interval for the predictor coefficients.
#Include code below.
exp(coef(binary))
#Question 2
#Use the glm() function to perform a logistic regression with admit as the DV
#and gre, gpa, and rank as the predictors. Include code below.
model <- glm(admit ~ gre + gpa + rank, data = binary, family = "binomial")
summary(model)
#Question 3
#Compute the odds ratios and 95% confidence interval for the predictor coefficients.
#Include code below.
exp(coef(model))
#Question 4
# Based on the odds ratios, which (if any) predictors were statistically significant?
exp(cbind(OR = coef(model), confint.default(model)))
frequency(binary$admit)