Closed Dannyzhd closed 1 year ago
Hi @Dannyzhd ,
thanks for reaching out!
vcov = "Empirical"
, cf. https://openpharma.github.io/mmrm/main/reference/mmrm_control.htmlemmeans
is supported and the interface is defined in this package, see https://openpharma.github.io/mmrm/main/reference/emmeans_support.htmlDoes that help?
Cheers Daniel
Thanks @danielinteractive, for the so swift and helpful response.
Following the link I explored the development version and successfully extracted the Empirical covariance matrix, and I look forward to exciting updates in the future including between-within degree of freedom.
Once again, thanks for the significant contribution to the R community!
Warm regards Daniel Zhang
Dear mmrm Development Team,
First and foremost, I would like to extend my gratitude for your dedicated work on the mmrm package. It has been a valuable resource for many R users, myself included.
I am currently transitioning from SAS to R for conducting mixed models for repeated measures (MMRM). My aim is to replicate the results from SAS's proc mixed in MMRM using R. Below is the SAS code I've been working with:
When attempting to mirror the above in R using mmrm and emmeans, I arrived at the following:
While the results from lsmeans matched, I noticed discrepancies in the Standard Error and the degrees of freedom when compared to SAS, primarily due to my uncertainty on how to incorporate the empirical covariance matrix in the model fitting process.
In my previous endeavors, I was able to obtain results in alignment with SAS using nlme::gls combined with clubsandwich::vcovCR. However, certain limitations, such as replicating the degree of freedom using SAS’s DDFM = BETWITHIN, remain unresolved.
As of today, August 9th, 2023:
The clubsandwich::vcovCR function, based on the manual, does not currently support the mmrm model object.
The Models supported by emmeans documentation doesn't list mmrm as a recognized model, even though my attempts suggest a smooth integration.
With all this in mind, I noticed that the empirical covariance matrix has been incorporated into the mmrm package based on the github log. However, I couldn't locate this feature in the introduction vignette. Could you kindly provide insights into whether this is still under development or if it's readily available? Furthermore, is there a possibility that the mmrm package might support replicating the DDFM statements from SAS, especially DDFM = BETWITHIN, to determine the degrees of freedom?
I truly appreciate any guidance you can offer on this. Thank you for your invaluable contributions to the R community and for taking the time to read my query.
Warm regards, Daniel Zhang