Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return frequentist MMRM model object #274

Open
gowerc opened this issue Jan 10, 2022 · 9 comments
Open

Return frequentist MMRM model object #274

gowerc opened this issue Jan 10, 2022 · 9 comments
Labels
enhancement New feature or request priority priority due to tight deadlines

Comments

@gowerc
Copy link
Collaborator

gowerc commented Jan 10, 2022

Hi @wolbersm ,

We have been asked a few times by Paul to add return the model object of the MMRM fit for the bootstrap methods for diagnostic / residual purposes.

Talking to @nociale our current proposal would be that we return the MMRM fit to the original dataset (only) for the condmean jackknife + bootstrap methods, for all other methods (bayesian, approx bayes, blmi) we would carry on returning nothing.

What do you think ?

@gowerc gowerc added the enhancement New feature or request label Jan 10, 2022
@wolbersm
Copy link
Collaborator

We need to fit an MMRM model to the original data for all methods, right?
Therefore, I'd suggest to return the original MMRM fit for all methods.
Does this work or would it cause extra complications.

One totally separate issue is that the MMRM to the original data does exclude "non-MAR" post-ICE data but I guess this is unavoidable. Also, it's not 100% clear to me how to do good residual diagnostics for an MMRM model but I leave that to Paul for now.

@gowerc
Copy link
Collaborator Author

gowerc commented Jan 10, 2022

@wolbersm ,

Currently we do not fit the MMRM to the original dataset for the bmlmi or approx_bayes methods. Additionally I'm not sure it makes any sense to return it for the bayes method as its only used to initalise the stan sampler.

@wolbersm
Copy link
Collaborator

Thanks for clarifying @gowerc
I am not 100% sure what Paul wants to do with the MMRM fit in any case but after some consideration, your original proposal sounds reasonable.

@nociale
Copy link
Collaborator

nociale commented Jan 10, 2022

@gowerc @wolbersm Just to be clear, currently drawsObj$fit is NULL for all the methods except bayes for which the stanfit object is returned. We could return the fit object from the glmmTMB() function for the MMRM fit on the original dataset for the condmean method (either bootstrap or jaccknife). drawsObj$fit would still be NULL for bmlmi and approxbayes. Even though we do fit MMRM on the original dataset also when these methods are called, in these cases (as for bayes) this fit serves only for initialization / setting starting values, so I would personally not output this fit object.

@wolbersm
Copy link
Collaborator

Thanks, as long as the content of drawsObj$fit is properly documented, this sounds ok for me.

@gowerc
Copy link
Collaborator Author

gowerc commented Jan 11, 2022

I'm not sure we would be able to document it other than saying its a "glmfit" object. Otherwise we have a moving target that our documentation is dependent on another teams implementation details.

@wolbersm
Copy link
Collaborator

Yes, I think it's fine to just say that this contains the result of the imputation model fit returned by glmmTMB() or stan().

@gowerc gowerc added this to the CRAN Release milestone Jan 17, 2022
@delmarp
Copy link

delmarp commented Jan 18, 2022

sounds good. I would also return the full object from the ancova function for the same reason to check residuals

@gowerc gowerc changed the title Returning frequentist MMRM model object Return frequentist MMRM model object Jan 24, 2022
@gowerc gowerc removed this from the CRAN Release milestone Jan 24, 2022
@nociale nociale added the priority priority due to tight deadlines label Jan 26, 2022
@pengguanya
Copy link
Collaborator

Just add here the relevant functions in case I forgot. There is a kind of chain relation among them

1. draws.condmean
2. get_draws_mle
3. get_mmrm_sample
4. fit_mmrm_multiopt
5. fit_mmrm
6. glmmTMB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority priority due to tight deadlines
Projects
None yet
Development

No branches or pull requests

5 participants