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.04
barley Reference 425 183
barley+lupins 0.47 (0.27, 0.82) 0.008 459 119
lupins 0.31 (0.17, 0.55) <0.001 453 84
Yard 1337 386 1.02
1 Reference 290 80
2 0.88 (0.44, 1.77) 0.72 317 86
3 1.03 (0.45, 2.34) 0.94 173 53
4 0.93 (0.42, 2.08) 0.86 231 67
5 1.20 (0.63, 2.27) 0.58 326 100
Time 0.92 (0.88, 0.95) <0.001 1337 386 1.03