-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add support for starting with model fits rather than data #22
Comments
Hi @marcora Thank you for using tidyplots! I fear that that the support of data types other than tidy data frames is beyond the scope of tidyplots. I would suggest to try to extract a data frame out of your upstream analysis and use this for plotting. Best |
Most model fit objects can be made into tidy data frames, with the original data, model predictions, and statistical details. Packages like |
You are probably referring to the function It supports a number of choices for the argument However, I have to admit I am not an expert in modeling, so you might have to explain in a little more detail how you would implement the functionality you are looking for. |
I am talking mainly about `add_test_pvalue
<https://jbengler.github.io/tidyplots/reference/add_test_pvalue.html>`.
`emmeans` and similar packages (e.g., `ggeffects` and `marginaleffects`)
can perform tests using as input a large variety of different model fit
objects, including those generated by `lmer` and similar packages that
handle generalized linear mixed models, which are becoming more and more
necessary given the complexity of many biological experiments (that include
pseudoreplicates, batch effects, etc.). My request was, since you are
already supporting some simple model testing using `emmeans`, to extend
that support to more complex models.
…On Wed, Dec 11, 2024 at 5:26 PM Jan Broder Engler ***@***.***> wrote:
You are probably referring to the function add_curve_fit(). Right?
This is basically a wrapper around ggplot2::geom_smooth()
<https://ggplot2.tidyverse.org/reference/geom_smooth.html>.
It supports a number of choices for the argument methods:
https://jbengler.github.io/tidyplots/reference/add_curve_fit.html
However, I have to admit I am not an expert in modeling, so you might have
to explain in a little more detail how you would implement the
functionality you are looking for.
—
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABRRZPP7JFN5KE65D5ZVD2FC3YFAVCNFSM6AAAAABTJ44KXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZXGMZDSMJZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
But the same applies to all the `tidyplots` functions that use a model,
e.g., like you pointed out, `add_curve_fit()`. In essence you are plotting
the model predictions with their confidence intervals, so you are assuming
some model somewhere. My request would be to support the use of
user-specified models for those functions that use a model fit for plotting
(graphics like curves and bar of population means) and statistical results
(e.g., pvalues and confidence intervals).
On Thu, Dec 12, 2024 at 1:14 PM ***@***.*** <
***@***.***> wrote:
… I am talking mainly about `add_test_pvalue
<https://jbengler.github.io/tidyplots/reference/add_test_pvalue.html>`.
`emmeans` and similar packages (e.g., `ggeffects` and `marginaleffects`)
can perform tests using as input a large variety of different model fit
objects, including those generated by `lmer` and similar packages that
handle generalized linear mixed models, which are becoming more and more
necessary given the complexity of many biological experiments (that include
pseudoreplicates, batch effects, etc.). My request was, since you are
already supporting some simple model testing using `emmeans`, to extend
that support to more complex models.
On Wed, Dec 11, 2024 at 5:26 PM Jan Broder Engler <
***@***.***> wrote:
> You are probably referring to the function add_curve_fit(). Right?
> This is basically a wrapper around ggplot2::geom_smooth()
> <https://ggplot2.tidyverse.org/reference/geom_smooth.html>.
>
> It supports a number of choices for the argument methods:
> https://jbengler.github.io/tidyplots/reference/add_curve_fit.html
>
> However, I have to admit I am not an expert in modeling, so you might
> have to explain in a little more detail how you would implement the
> functionality you are looking for.
>
> —
> Reply to this email directly, view it on GitHub
> <#22 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAABRRZPP7JFN5KE65D5ZVD2FC3YFAVCNFSM6AAAAABTJ44KXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZXGMZDSMJZGY>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
The functionality of https://rpkgs.datanovia.com/ggpubr/reference/geom_pwc.html Given my limited expertise in data modeling, I do not see myself implementing additional functionality in that direction, which is not covered by these two functions. If you are aware of additional ggplot2 extensions that provide the functionality you are looking for, let me know and I will have a look at them. |
Got it!
Definitely `ggeffects` and `marginaleffects` packages provide `ggplot2`
plotting capabilities. `dustinfife/flexplot` also has some functionality in
that respect, but is more focused on plotting. You may also want to take a
look at the `ggformula` package (e.g., the `geom_lm()` function).
But maybe adding support in `ggpubr` and then porting that functionality
into `tidyplots` is the way to go.
…On Thu, Dec 12, 2024 at 3:31 PM Jan Broder Engler ***@***.***> wrote:
The functionality of add_test_*() and add_curve_fit()is sourced from
ggpubr::geom_pwc() and ggplot2::geom_smooth(), respectively.
https://rpkgs.datanovia.com/ggpubr/reference/geom_pwc.html
https://ggplot2.tidyverse.org/reference/geom_smooth.html
Given my limited expertise in data modeling, I do not see myself
implementing additional functionality in that direction, which is not
covered by these two functions.
If you are aware of additional ggplot2 extensions that provide the
functionality you are looking for, let me know and I will have a look at
them.
—
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABRRYA3YFOW5NT52OOOPT2FHXAVAVCNFSM6AAAAABTJ44KXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZZHE2TQMRSG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
It would be great if a
tidyplots
pipeline could also start with a model fit rather than data. This would allow, for example, to display statistical results for more complex experimental designs (e.g., when using multilevel models in the presence of pseudoreplicates). Alternatively, support for passing aemmeans
ormarginaleffects
object to some of theadd_*
functions could also be a possible solution.The text was updated successfully, but these errors were encountered: