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

Return at least one effect size measure for htest and BFBayesFactor objects #802

Open
IndrajeetPatil opened this issue Oct 15, 2022 · 8 comments
Labels
Enhancement 💥 Implemented features can be improved or revised

Comments

@IndrajeetPatil
Copy link
Member

Given that most users will stick to the defaults most of the time, they might not even realize that we support this functionality, which would be a shame. It'd be nice if we return at least one effect size by default. The default can be whatever effectsize::effectsize() defaults to.

This is especially relevant for objects that don't have estimates in their tidied data frames:

suppressPackageStartupMessages({
  library(parameters)
  library(BayesFactor)
})
data("raceDolls")

m <- contingencyTableBF(
  raceDolls,
  sampleType = "indepMulti",
  fixedMargin = "cols"
)

parameters(m)
#> Warning: Could not estimate a good default ROPE range. Using 'c(-0.1, 0.1)'.
#> Bayesian contingency table analysis
#> 
#> Parameter |                            Prior |   BF
#> ---------------------------------------------------
#> Ratio     | Independent multinomial (0 +- 1) | 1.81
#> 
#> Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed
#>   using a MCMC distribution approximation.

parameters(m, effectsize_type = "cramers_v")
#> Warning: Could not estimate a good default ROPE range. Using 'c(-0.1, 0.1)'.
#> Bayesian contingency table analysis
#> 
#> Parameter | Cramer's V (adj.) | Cramers 95% CI |                            Prior |   BF
#> ----------------------------------------------------------------------------------------
#> Ratio     |              0.15 |   [0.00, 0.29] | Independent multinomial (0 +- 1) | 1.81
#> 
#> Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed
#>   using a MCMC distribution approximation.

Created on 2022-10-15 with reprex v2.0.2

@IndrajeetPatil IndrajeetPatil added the Enhancement 💥 Implemented features can be improved or revised label Oct 16, 2022
@strengejacke
Copy link
Member

Can you take care of this? I think it's just setting a reasonable default for the different effectsizes (like model_parameters for aov, BFBayesFactor etc.)

@mattansb
Copy link
Member

If you pass type = NULL to effectsize () it will return a default effect size - so you can just always pass that argument as is!

@strengejacke
Copy link
Member

It's indeed a bit more difficult to provide an explicit value. We have model_parameters.htest(), but different default effect sizes. Maybe it's indeed better to just pass NULL by default, but this requires some larger code revisions than just changing an argument value.

@strengejacke
Copy link
Member

I think the tricky stuff will be to find out the effectsize-type when this argument is NULL, because this is required:

prefix <- switch(effectsize_type,
"cohens_g" = "Cohens_",
"cramers_v" = "Cramers_",
"phi" = "phi_",
"cohens_d" = "d_",
"hedges_g" = "g_",
"rank_biserial" = "rank_biserial_",
"rank_epsilon_squared" = "rank_epsilon_squared_",
"kendalls_w" = "W_",
"omega" = "Omega2_",
"eta" = "Eta2_",
"epsilon" = "Epsilon2_"
)

@DominiqueMakowski
Copy link
Member

DominiqueMakowski commented Oct 28, 2022

I would use "default" in parameters instead of NULL (which should be to not return anything)

@strengejacke
Copy link
Member

Yeah, but this still doesn't solve the problem how to detect which effect size was computed (#802 (comment))... :-(

@mattansb
Copy link
Member

I think the tricky stuff will be to find out the effectsize-type when this argument is NULL, because this is required:

Why do you need that code? What are you trying do do that isn't covered by effectsize::is_effectsize_name() or effectsize::get_effectsize_name()?

@strengejacke
Copy link
Member

So this works on the column names of the returned data frame from effectsize()? I think the returned effect size names differ from those values in the mentioned switch() statement, I need to check whether this breaks any code, maybe in conjunction with format_table().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 💥 Implemented features can be improved or revised
Projects
None yet
Development

No branches or pull requests

4 participants