drizopoulos / GLMMadaptive

GLMMs with adaptive Gaussian quadrature
https://drizopoulos.github.io/GLMMadaptive/
60 stars 14 forks source link

Error: No glance method for objects of class MixMod #42

Closed reiniervlinschoten closed 2 years ago

reiniervlinschoten commented 2 years ago

Hi,

I am trying to work with multiply imputed data and the GLMMAdaptive package. However, it seems that the glance() method is missing for MixMod objects, which complicates pooling and testing of model parameters over multiply imputed data. Is there a glance() method for MixMod in any package?

Kind regards, Reinier

reiniervlinschoten commented 2 years ago

There seem to be experimental functions in broom.mixed, but these don't seem to work?

Moreover, I can't seem to find any other way to extract the residual degrees of freedom from the model (normally this would be given by glance()), is there any other way to extract this?

drizopoulos commented 2 years ago

I’m not aware of any package offering this.

—— Professor of Biostatistics Erasmus Medical Center Rotterdam The Netherlands


Από: Reinier van Linschoten @.> Στάλθηκε: Thursday, April 28, 2022 9:05:44 AM Προς: drizopoulos/GLMMadaptive @.> Κοιν.: Subscribed @.***> Θέμα: Re: [drizopoulos/GLMMadaptive] Error: No glance method for objects of class MixMod (Issue #42)

Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is. Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

There seem to be experimental functions in broom.mixedhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbbolker%2Fbroom.mixed&data=05%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Cc050b7bc59ae49dc7dbf08da28e5841d%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637867263483371374%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OkZ90hpe9Sfks2JlRjPKSUaHhnXN9CG4tVoxiNjHjcM%3D&reserved=0, but these don't seem to work?

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos%2FGLMMadaptive%2Fissues%2F42%23issuecomment-1111825537&data=05%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Cc050b7bc59ae49dc7dbf08da28e5841d%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637867263483371374%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yq%2FL7JhMqX45KZoDBCqjNQhNHKML5dccgAzPZhDdhFs%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TT7WM6LLNXSI57IMVTDVHI2ERANCNFSM5URK4QHQ&data=05%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Cc050b7bc59ae49dc7dbf08da28e5841d%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637867263483371374%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yYlcHNLF7hni58YOQU8qe1echAvEJD6LtRqvZu97q9A%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

reiniervlinschoten commented 2 years ago

Thank you for the quick response. Is there any way to extract the residual df from a MixMod object?

drizopoulos commented 2 years ago

AFAIK, residual degrees of freedom are not that easily defined in general mixed-effects models settings.

reiniervlinschoten commented 2 years ago

Yeah, I ran into that too, maybe a temporary workaround can be added to allow functionality that depends on residual degrees of freedom?

For example from the glmmTMB package? (Don't know if this is an acceptable solution, but this would allow the package to be used with for example MICE).

##' @importFrom stats df.residual
##' @method df.residual glmmTMB
##' @export
##  TODO: not clear whether the residual df should be based
##  on p=length(beta) or p=length(c(theta,beta)) ... but
##  this is just to allow things like aods3::gof to work ...
##  Taken from LME4, including the todo
##
df.residual.glmmTMB <- function(object, ...) {
  nobs(object)-length(object$fit$par)
}
drizopoulos commented 2 years ago

Perhaps it would allow it to work with MICE, but the relevant questions are where these degrees of freedom will be used and whether giving these degrees of freedom may lead to incorrect results.