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
Diet 1337 386
barley Reference 425 183
barley+lupins 0.48 (0.26, 0.89) 0.019 459 119
lupins 0.34 (0.19, 0.63) <0.001 453 84
Yard 1337 386
1 Reference 312 94
2 1.01 (0.47, 2.15) 0.99 187 50
3 1.16 (0.54, 2.48) 0.70 295 110
4 0.73 (0.29, 1.85) 0.51 193 47
5 0.92 (0.45, 1.91) 0.83 350 85
Time 0.92 (0.89, 0.96) <0.001 1337 386