3.3 Generalized estimating equations model

Below logistic model takes account of repeat observation by cow. Examine different correlation structures. It is of interest to note that (odds of) high protein content in milk appears to decrease as time since calving increases.

Milk <- Milk |> modify_if(is.character, as.factor);
Milk <- Milk |> tidyr::drop_na()
Milk <- droplevels(Milk);
Milk <- Milk |> dplyr::arrange(Yard, Cow, Time);

rm_mvsum(model=geeglm(HP ~ Diet + Yard + Time, id=c(Cow), data=Milk, family=binomial, corstr="ar1"), data=Milk, showN=T, CIwidth=0.95);
OR(95%CI) p-value N Event VIF
Diet 1337 386 1.05
barley Reference 425 183
barley+lupins 0.50 (0.29, 0.87) 0.014 459 119
lupins 0.33 (0.19, 0.59) <0.001 453 84
Yard 1337 386 1.03
1 Reference 369 92
2 1.22 (0.63, 2.35) 0.56 355 113
3 1.96 (1.07, 3.60) 0.030 298 113
4 1.51 (0.72, 3.14) 0.28 159 53
5 0.52 (0.26, 1.02) 0.057 156 15
Time 0.92 (0.89, 0.96) <0.001 1337 386 1.02