-
Notifications
You must be signed in to change notification settings - Fork 2
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
Informative prior archetypes #100
Conversation
@yonicd, I added archetypes to parameterize the average across time within each treatment group. Using the FEV data: library(brms.mmrm)
library(dplyr)
data("fev_data", package = "mmrm")
data <- brm_data(
data = fev_data,
outcome = "FEV1",
role = "response",
group = "ARMCD",
time = "AVISIT",
reference_group = "PBO",
reference_time = "VIS1"
)
cells <- brm_archetype_average_cells(data)
summary(cells)
# This object is an informative prior archetype in brms.mmrm.
# The fixed effect parameters of interest express the
# marginal means as follows (on the link scale):
#
# PBO:VIS1 = 4*x_PBO_VIS1 - x_PBO_VIS2 - x_PBO_VIS3 - x_PBO_VIS4
# PBO:VIS2 = x_PBO_VIS2
# PBO:VIS3 = x_PBO_VIS3
# PBO:VIS4 = x_PBO_VIS4
# TRT:VIS1 = 4*x_TRT_VIS1 - x_TRT_VIS2 - x_TRT_VIS3 - x_TRT_VIS4
# TRT:VIS2 = x_TRT_VIS2
# TRT:VIS3 = x_TRT_VIS3
# TRT:VIS4 = x_TRT_VIS4 Above, I also threw in a treatment effect version: effects <- brm_archetype_average_effects(data)
summary(effects)
# This object is an informative prior archetype in brms.mmrm.
# The fixed effect parameters of interest express the
# marginal means as follows (on the link scale):
#
# PBO:VIS1 = 4*x_PBO_VIS1 - x_PBO_VIS2 - x_PBO_VIS3 - x_PBO_VIS4
# PBO:VIS2 = x_PBO_VIS2
# PBO:VIS3 = x_PBO_VIS3
# PBO:VIS4 = x_PBO_VIS4
# TRT:VIS1 = 4*x_PBO_VIS1 - x_PBO_VIS2 - x_PBO_VIS3 - x_PBO_VIS4 + 4*x_TRT_VIS1 - x_TRT_VIS2 - x_TRT_VIS3 - x_TRT_VIS4
# TRT:VIS2 = x_PBO_VIS2 + x_TRT_VIS2
# TRT:VIS3 = x_PBO_VIS3 + x_TRT_VIS3
# TRT:VIS4 = x_PBO_VIS4 + x_TRT_VIS4 Above, This brings us up to 6 different archetypes:
I believe this completes this PR, unless others have comments (please let me know). Archetypes are cheap, and it is easy for me to add more. |
I also added a section to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new functions seem very useful and the vignette describes their use very clearly - it will definitely be helpful for users. I didn't spot any potential major issues.
One thing I kept thinking about: we regularly use MMRMs with baseline:time
and treatment:time
interactions. Elicitation seems to be more challenging then (due to the second interaction). Which archetype would I use, or how would a I construct a suitable one? Apologies if this is already covered and I missed it.
Is there usually a reason to set informative priors on baseline:time interactions? I would think these are nuisance parameters and solely used to explain noise. The current approach in the archetype interface is to manually compute the model matrix columns for these interactions and center them at their means. (Centering protects the interpretation of the parameters of interest against subtle reference level issues like the one from #24 (comment).) As for treatment:time, the three current |
Thanks, I can see how this would complicate things. In some situations, in my experience, baseline has been essentially the only known or the strongest prognostic variable (it often seems to correlate strongly with other (un)observered prognostic variables). So it often has a special role among the nuisance variable, I believe. Evidence might exist from natural history studies or (more frequently and increasingly) from historical trial data to which MMRMs with baseline x time interactions had been fit. Fully fine if we do not address this at the moment. |
You do make a good case for borrowing information on baseline:time interactions in some circumstances. And since these parameters are time-specific slopes, the centering I described above should not interfere with interpretation or priors. ( Using |
I'd be fine if we wait and see whether substantial demand for such custom priors comes up. Maybe the case with the |
a7b9126 adds this to the "Informative priors" section of the existing
Thanks, it would be great to discuss.
|
This pull request lays the groundwork for informative prior archetypes. It fixes #96 and #99, and adds a citation for https://opensource.nibr.com/bamdd/src/02h_mmrm.html.
@andrew-bean, @chstock, and @yonicd, would you please have a look? The new
vignettes/archetypes.Rmd
vignette has the key features.