3.2 Logistic model
Examine the bivariate relationship first among variables to high protein status of milk. Check for quasi or complete separation of categories. Shout out to Lisa Avery for this function!
plotuv(data=Milk, response='High_Protein', covs=c('Cow', 'Yard', 'Diet', 'Time', 'protein'));
Below logistic model does not account for clustering of repeat observations by cow to high protein status of milk.
rm_mvsum(model=glm(High_Protein ~ Diet + Yard + Time, data=Milk, family='binomial'), showN=T, vif=T);
OR(95%CI) | p-value | N | Event | VIF | |
---|---|---|---|---|---|
Diet | 1337 | 386 | 1.02 | ||
barley | Reference | 425 | 183 | ||
barley+lupins | 0.45 (0.34, 0.60) | <0.001 | 459 | 119 | |
lupins | 0.29 (0.21, 0.40) | <0.001 | 453 | 84 | |
Yard | 1337 | 386 | 1.01 | ||
1 | Reference | 251 | 66 | ||
2 | 1.29 (0.86, 1.92) | 0.21 | 276 | 76 | |
3 | 1.71 (1.16, 2.53) | 0.007 | 272 | 92 | |
4 | 1.31 (0.89, 1.95) | 0.17 | 268 | 87 | |
5 | 1.08 (0.72, 1.63) | 0.70 | 270 | 65 | |
Time | 0.98 (0.95, 1.00) | 0.044 | 1337 | 386 | 1.00 |