Open kkmann opened 1 month ago
Thanks @kkmann , did you check the vignette details? I remember @clarkliming described known differences between our implementation and SAS: https://openpharma.github.io/mmrm/latest-tag/articles/hypothesis_testing.html#hypothesis-testing-in-sas
this is a bug that the order of the interaction term will design matrix. using the following model it is correct
mod2 <- mmrm(
formula = FEV1 ~ AVISIT + RACE + AVISIT * RACE + FEV1_BL + us(AVISIT|USUBJID),
data = fev_data,
control = mmrm_control(
method = "Kenward-Roger",
vcov = "Kenward-Roger-Linear"
),
reml = TRUE
)
apply(mmrm:::h_get_contrast(mod2, "AVISIT", "3", 1e-8), 1, \(x) names(coef(mod2))[x != 0])
I will fix this issue
Hey, sry - just coming back from holidays :)
Thanks for looking into it @clarkliming!
Hi @kkmann I have complete my fix in #460, would you please also have a look? (maybe there are corner cases that I did not cover)
will take a look asap, maybe we can stall merging until next week?
will take a look asap, maybe we can stall merging until next week?
thank you, we can wait until the checks are finished
Summary
When using KR for df a type 3 ANOVA produces different results between PROC MIXED and
{mmrm}
. Reordering contrasts manually seems to fix the issue (see below).Is there a problem / inconsistency with the way contrasts for interaciton terms are sorted?
I am raising this issue on behalf of @InkaRo (thanks again for making me aware of the issue and the excellent diagnosis!).
SAS Program (fev data imported via csv)
SAS output![image](https://github.com/user-attachments/assets/fdcf135c-79f4-4fd0-8457-03e60dffba44)
R code to show discrepancy & manual fix.
R session info