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

Option to plot non-linear meta-regressions in bubble_plot() #52

Open
befriendabacterium opened this issue Sep 19, 2023 · 1 comment
Open

Comments

@befriendabacterium
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently there's no way to plot commonly used non-linear meta-regressions via bubble_plot().

Describe the solution you'd like
Would be good if bubble_plot() could at least handle the four non-linear options given in https://www.metafor-project.org/doku.php/tips:non_linear_meta_regression (polynomial, restricted cubic spline, natural cubic spline, or thin plate spline).

Describe alternatives you've considered
You can do this outside the function and then add your predictions a blank bubble plot without any model predictions (I added this option here: #51), but it's much preferable if the model could automatically handle it.

Additional context
I've made a start on doing this for restricted cubic splines for my own purposes here (https://github.com/befriendabacterium/orchaRd/tree/nonlinear), but needs improvement and the other non-linear options done too.

@befriendabacterium
Copy link
Contributor Author

Hi @daniel1noble and @itchyshin - me again ... sorry...

So I've been revisiting this the last couple of days and come up with what I think is a better solution - well, borrowed/adapted this one: https://stackoverflow.com/a/64493228/8349925.

Basically, instead of having different solutions for predicting and plotting model fits for each different model specification (e.g. linear, polynomial, restricted cubic spline), we can read the model's formula and then use predict.rma() in such a way as to predict for any model specification. I've implemented and done some testing of this at befriendabacterium@bea9409 and it seems to work well, producing equivelent plots to the emmeans method that currently only works for linear models.

When you get a chance, have a look as I think it could allow orchard_plot() to work a bit more universally and also saves a few lines of code I think!

Cheers
Matt

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

No branches or pull requests

1 participant