-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Potential integration with papaja #156
Comments
That seems like a great idea to me |
for 1) There is |
|
This comment has been minimized.
This comment has been minimized.
If implemented in
All names from effectsize can be found here: Perhaps |
Should all these be renamed to |
This indicates a model component, i.e. if parameters are fixed or random effects, so this could remain as is. |
Considering that unstandardized effect size estimates are also effect size estimates, personally, I would opt for
Agreed, |
Are you sure about |
@crsh Generalized Eta squared is now implemented in the package for https://easystats.github.io/effectsize/articles/anovaES.html#generalized-eta2 |
This comment has been minimized.
This comment has been minimized.
And all effect size names listed in https://github.com/easystats/effectsize/blob/master/R/is_effectsize_name.R should be renamed to |
I'm not sure, does |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
It is my experience with other aspects of tidy(aov(yield ~ block + N * P + K, npk))
Yes, you are right, that was a typo. I updated the draft above. In general the glossary lists |
I thought about adding a |
This comment has been minimized.
This comment has been minimized.
Looking at the initial issue:
|
Let's open an issue in performance. But it would be cool if it worked across models type, like if model 1 (the reference) includes any type of R2, then compute the difference between it and all the other models that include any type of R2. Sure it will have limitations that some of the R2 will not be of the same nature and all, but in the end all the R2 aim to quantify the same dimension (whether it can be called prop of variance explained or not), and people do already compare different R2s anyway so... |
|
That's why I try to convince my colleagues not to report pseudo-R2 ;-) |
This is also why whatever function ends up doing this should validate that all models have the same outcome + number of observations (similar to what |
Hmm, wouldn't this potentially interfere with the method dispatch for other objects when
Outsourcing our delta-R2 method is not a hard precondition for this integration. Rather, I thought it may fit well with one of the packages of your ecosystem. I think if there is a nice way to add the |
Not sure, since both have the same generic (i.e.
Yeah, we can do that, I'll open a PR. |
Anyone willing to open a PR at the broom-repo, to add a @crsh Would it be enough to provide |
I can do it. I can check back with you before opening the PR, so you can ensure that we are on the same page.
Hmm, I don't think Just to make sure I understand correctly, you have in mind something like the following? tidy <- function(x, ...) {
insight::standardize_names(x, ...)
} |
No, this was addressed to you for the papaja package, not for the broom PR ;-)
Yeah, but with
The current working draft is here: You may remove the note in the docs. |
Ah, gotcha. 😅 I would like to keep the interface general and enable users to pass other functions to compute effect sizes as well. For this reason, I need a predictable format of the return object for the subsequent internal workflow. Calling I could imagine something along these lines: aov_es_table <- es(x)
aov_es_cols <- colnames(aov_es_table)
if(
!is.data.frame(aov_es_table) |
!"estimate" %in% aov_es_cols |
!"conf.low" %in% aov_es_cols |
!"conf.high" %in% aov_es_cols
) {
aov_es_table <- broom::tidy(aov_es_table)
} If, for example, |
For easystats packages / functions, you could just check the class-attribute: if(inherits(c(aov_es_table, "effectsize_table", "parameters_model", "parameters_distribution"))) {
aov_es_table <- insight::standardize_names(aov_es_table, style = "broom")
} else {
aov_es_table <- broom::tidy(aov_es_table)
} |
After some more discussion with @mariusbarth, we think that this approach probably strikes a good balance between streamlining our internals, ease of use for the user, and flexibility. So, I think, with the broom-style output of |
Hi again. We have started to explore our implementation and another issue has come up. Currently, we support testing and reporting results for intercepts in ANOVA models. It seems that Line 892 in b4f8408
Given that several packages allow users to test the intercept term (e.g. |
This should actually be a small (I think) fix. |
Great, glad to hear it. There's nothing in the works, yet, so feel free. 👍 |
So I've added an optional argument library(effectsize)
model <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars)
eta_squared(car::Anova(model, type = 3), include_intercept = TRUE)
#> Parameter | Eta2 (partial) | 90% CI
#> ------------------------------------------------------
#> (Intercept) | 0.87 | [0.78, 0.91]
#> factor(am) | 0.20 | [0.02, 0.41]
#> factor(cyl) | 0.41 | [0.15, 0.58]
#> factor(am):factor(cyl) | 0.10 | [0.00, 0.27] however, it does depend on the anova table having an intercept to begin with, eta_squared(car::Anova(model, type = 2), include_intercept = TRUE)
#> Parameter | Eta2 (partial) | 90% CI
#> ------------------------------------------------------
#> factor(am) | 0.13 | [0.00, 0.34]
#> factor(cyl) | 0.66 | [0.45, 0.77]
#> factor(am):factor(cyl) | 0.10 | [0.00, 0.27]
eta_squared(model, include_intercept = TRUE)
#> Parameter | Eta2 (partial) | 90% CI
#> ------------------------------------------------------
#> factor(am) | 0.63 | [0.42, 0.75]
#> factor(cyl) | 0.66 | [0.45, 0.77]
#> factor(am):factor(cyl) | 0.10 | [0.00, 0.27] Neither does this: data(md_12.1, package = "afex")
m <- aov(rt ~ angle * noise + Error(id / (angle * noise)),
data = md_12.1)
eta_squared(m, include_intercept = TRUE)
#> Group | Parameter | Eta2 (partial) | 90% CI
#> ------------------------------------------------------------
#> id:angle | angle | 0.82 | [0.66, 0.89]
#> id:noise | noise | 0.79 | [0.49, 0.89]
#> id:angle:noise | angle:noise | 0.83 | [0.69, 0.90] But a <- afex::aov_ez("id", "rt", md_12.1, within = c("angle", "noise")) # same model!
eta_squared(a, include_intercept = TRUE)
#> Parameter | Eta2 (partial) | 90% CI
#> -------------------------------------------
#> (Intercept) | 0.99 | [0.96, 0.99]
#> angle | 0.82 | [0.66, 0.89]
#> noise | 0.79 | [0.49, 0.89]
#> angle:noise | 0.83 | [0.69, 0.90] [*] how effect sizes are extracted from
Let me know if this is good (or good enough?). |
@crsh I think I've addressed all of your points. Feel free to chime back in with any thoughts. |
Hi there,
great package! I recently found some time to take it for a spin and find it super useful. In fact, I'm considering to use or support it in my package
papaja
.papaja
exportsapa_print()
, a function that facilitate reporting results of your analyses in accordance with APA guidelines. It has been my stated goal from the start that I would like to do no computing if possible---just formatting and typesetting. Unfortunately, many analysis objects do not include all desired effect size estimates. Because of this, many methods report only unstandardized effect sizes end up doing some computations.Some recent internal changes provide an avenue to change this with, potentially, the help of
effectsize
. I'm looking for a way to let users pass a function that is used internally to calculate the desired effect size and confidence interval and include it in the output. For example,Such
es
functions should work on the analysis outputx
and return adata.frame
in a standardized format: There should be the columnsestimate
,conf.low
, andconf.high
plus additional columns such asterm
where applicable (we largely follow the conventions defined inbroom
). Such a standardized format would make it very easy for us to process the results.From what I can tell,
effectsize
is very close to meeting our needs. Functions process common analysis outputs and return a predictabledata.frame
with a proper S3 class. As such, it seems like a great candidate to develop this workflow with.How could we do it?
To really make this work, it would be ideal for us, if two things could be added to
effectsize
:broom
is starting to request package owners to shiptidy()
-methods for their own objects. Hence, it would be great, ifeffectsize
could provide such methods (which essentially would only rename column names and remove the added class tag).effectsize
does not support this effect size, yet. If it could be added, we could delegate all ANOVA-related effect size computations toeffectsize
. It seems like you are planning to add this anyway.effectsize
I would finally be able to avoid doing any computations withinpapaja
.Do you feel that these changes are within the scope of
effectsize
and would you consider PRs that implement those changes?The text was updated successfully, but these errors were encountered: