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.42 (0.25, 0.72) 0.001 459 119
lupins 0.31 (0.18, 0.53) <0.001 453 84
Yard 1337 386 1.02
1 Reference 193 56
2 1.13 (0.59, 2.18) 0.71 244 84
3 0.80 (0.38, 1.69) 0.56 222 71
4 0.51 (0.24, 1.11) 0.092 346 76
5 0.83 (0.42, 1.65) 0.60 332 99
Time 0.92 (0.88, 0.95) <0.001 1337 386 1.05