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

New vignette: exemplary comparison of Bayesian and frequentist MMRM fits #71

Merged
merged 27 commits into from
Nov 14, 2023

Conversation

chstock
Copy link
Collaborator

@chstock chstock commented Nov 6, 2023

This is a new vignette with an exemplary comparison of Bayesian and frequentist MMRM fits as suggested in issue #68.

I used the the FEV1 dataset (fev_data) from the {mmrm} package. The endpoint is 'change from baseline in FEV1'. For different reasons, the alternative datasets we had identified appeared not as convincing. We may decide to change the dataset later. Alternatively, we could (later) use a dataset from the new {clindata} package or a simulated one based on realistic parameters as described e.g. here. However, this does not seem urgent or necessary from my point of view. I adapted the code used in the analysis of the orthodont dataset (#66).

Please let me know what you think.

Copy link
Collaborator

@wlandau wlandau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, @chstock! Just some minor comments here.

DESCRIPTION Outdated Show resolved Hide resolved
@@ -0,0 +1,189 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be okay to move files asa.csl and bibliography.bib to the vignettes folder?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, does having them in inst/ help with the citations in Rd files too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we had references only in vignettes, I would prefer the vignettes/ folder. However, since we use references elsewhere in the package documenation too, I suggest to use inst/ as a central location. This is also how it was done in the mmrmpackage, see here.

vignettes/comparison.Rmd Outdated Show resolved Hide resolved

## Pre-processing

The `fev_dat` dataset is used that is contained in `{mmrm}`:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to include a short description of the dataset, e.g. the "Note" in https://openpharma.github.io/mmrm/latest-tag/reference/fev_data.html.

Also, I see on that page:

This is an artificial dataset.

Would be nice to use a real clinical dataset in addition.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Other datasets in the end did not convince me as good (educational) examples, and I also wanted to avoid further dependencies. OK for you to leave it with fev_data for now and add or switch to another dataset later, perhaps one from clindata?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A short description has now been added (1a28cb7). OK to add or switch to another dataset later, perhaps one from the clindata-package? The current alternatives weren't convincing for me as good (educational) examples and I also wanted to avoid further dependencies, this is why I sticked to the mmrm-package.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chstock. I like your idea to align with the mmrm package. Indeed, I see a lot of work at https://openpharma.github.io/mmrm/latest-tag/articles/mmrm_review_methods.html which uses both the FEV and BCVA datasets. In the end, I think it would be sufficient to analyze both and refer readers to the results from https://openpharma.github.io/mmrm/latest-tag/articles/mmrm_review_methods.html#marginal-treatment-effect-estimates-comparison. But that could be a future PR.

R/brm_package.R Show resolved Hide resolved

# About {.unnumbered}

This vignette provides an exemplary comparison of a Bayesian MMRM fit,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It this point, it might be good to refer readers to the section at the very bottom, where the differences between models are shown parameter by parameter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, this has now been addressed in 6fb042a.

vignettes/comparison.Rmd Outdated Show resolved Hide resolved
@chstock
Copy link
Collaborator Author

chstock commented Nov 9, 2023

Thanks for the review, @wlandau! I believe I have addressed all comments and the PR should be ready for another round of review.

@wlandau
Copy link
Collaborator

wlandau commented Nov 14, 2023

Looks great, @chstock. I think this PR is in great shape for a merge. Going forward, we could think about aligning with #72 and discussing https://openpharma.github.io/mmrm/latest-tag/articles/mmrm_review_methods.html.

@wlandau wlandau merged commit fe8f4d6 into main Nov 14, 2023
15 checks passed
@wlandau wlandau deleted the mmrm_comparison branch December 11, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide comparison of Bayesian and frequentist MMRM fits in a new vignette
2 participants