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);

Milk <- Milk[order(Milk$Cow), ]; 
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 (obs|clusters) Event (total|clusters with event) VIF
Diet 1337|79 386|72 1.08
barley Reference 425|25 183|24
barley+lupins 0.48 (0.28, 0.85) 0.011 459|27 119|26
lupins 0.34 (0.19, 0.59) <0.001 453|27 84|22
Yard 1337|79 386|72 1.04
1 Reference 169|10 45|10
2 0.79 (0.39, 1.62) 0.52 304|19 83|15
3 1.13 (0.56, 2.28) 0.73 308|18 103|17
4 0.61 (0.29, 1.31) 0.20 262|15 49|13
5 1.32 (0.68, 2.57) 0.41 294|17 106|17
Time 0.92 (0.88, 0.95) <0.001 1337|79 386|72 1.07