I’m new to logistic regression and was hoping for some help in picking a "best fit model". Say I have a group of students who are assigned a job after college. Everyone can request their top 5, but there's no telling if they'll receive it or not.
Say I use logistic regression to see if a student receives their top job choice or not (0=no, 1=yes) and then a variety of independent variables
- gender (Male or Female)
- race (White, Asian, Black, Hispanic, Other)
- math gpa (continuous 0-100)
- English gpa (continuous 0-100)
- tier (top, middle, or bottom of class)
How do I know which variables I should keep in the model for best fit?
So if I run the model with all the variables and I get an output like this
Call:
glm(formula = receive_top1 ~ gender + race + tier + math_gpa +
English_gpa, family = "binomial", data = data)
Coefficients:
Estimate Std. Error. Z Value Pr(>|z|)
(Intercept) -16.7. 2.95. -5.66. 0.00000000015
genderFemale 0.09 0.19 0.48 0.63416
raceAsian -0.26 0.40 -0.66 0.50936
raceBlack 0.33 0.35 0.94 0.34580
raceHispanic 0.23 0.26 0.88 0.38112
raceOther 0.43 0.32 1.35 0.17610
tierMiddle -0.13 0.23 -0.55 0.57952
tierTop -0.64 0.35 -1.85 0.06433
math_gpa 0.10 0.02 4.92 0.00000000888
English_gpa 0.06 0.02 2.80 0.00504
Null Deviance: 1327.5 on 967 degrees of freedom
Residual Deviance: 1249.6 on 957 degrees of freedom
AIC: 1271.6
And I'm using a p-value of 0.05, how do I know which variables are important to the model? It seems to me like the intercept, math_gpa
and English_gpa
are significant.
However when I run anova(model, test = "Chisq") I get confused.
Model: binomial, link: logit
Response: receive_top1
Terms added sequentially (first to last)
DF Deviance Resid. DF Resid. Dev Pr(>Chi)
NULL 967 1327.5
gender 1 1.15 966 1326.4 0.2836
race 4 1.39 962 1325.0 0.8467
tier 2 40.44 960 1284.5 0.00000001657
math_gpa 1 23.06 959 1261.5 0.00000015
English_gpa 1 7.96 957 1249.7 0.00478
But now looking at the anova output this makes it seems like tier is also significant as well as math_gpa
and English_gpa
. Could someone also explain what the null hypothesis is in this case for the anova function?
How do I know what independent variables to keep in my model? Should I keep tier in? Take it out?
Anova()
is a good basic background on different types of tests and that function may be a good option for you to get the overall tests you want. But I also agree that Cross Validated is likely a better fit for this question overall. $\endgroup$