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.08 | ||
barley | Reference | 425 | 183 | ||
barley+lupins | 0.47 (0.35, 0.65) | <0.001 | 459 | 119 | |
lupins | 0.32 (0.23, 0.44) | <0.001 | 453 | 84 | |
Yard | 1337 | 386 | 1.04 | ||
1 | Reference | 312 | 94 | ||
2 | 1.06 (0.69, 1.62) | 0.80 | 187 | 50 | |
3 | 1.15 (0.79, 1.67) | 0.47 | 295 | 110 | |
4 | 0.79 (0.51, 1.24) | 0.30 | 193 | 47 | |
5 | 0.88 (0.61, 1.26) | 0.47 | 350 | 85 | |
Time | 0.97 (0.95, 1.00) | 0.036 | 1337 | 386 | 1.00 |