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.05
barley Reference 425|25 183|24
barley+lupins 0.46 (0.26, 0.81) 0.006 459|27 119|26
lupins 0.32 (0.18, 0.56) <0.001 453|27 84|22
Yard 1337|79 386|72 1.03
1 Reference 188|12 56|10
2 1.20 (0.59, 2.43) 0.62 307|18 78|17
3 0.90 (0.42, 1.91) 0.78 263|15 63|12
4 1.07 (0.54, 2.13) 0.85 324|19 86|19
5 1.75 (0.85, 3.61) 0.13 255|15 103|14
Time 0.92 (0.89, 0.96) <0.001 1337|79 386|72 1.05