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 |> modify_if(is.character, as.factor);
Milk <- Milk |> tidyr::drop_na()
Milk <- droplevels(Milk);
Milk <- Milk |> dplyr::arrange(Yard, Cow, Time);
Milk
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.46 (0.26, 0.79) | 0.005 | 459 | 119 |
lupins | 0.31 (0.17, 0.56) | <0.001 | 453 | 84 |
Yard | 1337 | 386 | ||
1 | Reference | 251 | 66 | |
2 | 1.27 (0.57, 2.85) | 0.56 | 276 | 76 |
3 | 1.45 (0.75, 2.81) | 0.27 | 272 | 92 |
4 | 1.11 (0.50, 2.47) | 0.80 | 268 | 87 |
5 | 1.10 (0.53, 2.26) | 0.80 | 270 | 65 |
Time | 0.92 (0.89, 0.95) | <0.001 | 1337 | 386 |