report icon indicating copy to clipboard operation
report copied to clipboard

clarifying when approximations are used by `effectsize`

Open IndrajeetPatil opened this issue 3 years ago • 16 comments

Since report calls effectsize on model objects to compute effect sizes, effectsize often needs to use an approximation in case insight::get_data() doesn't work.

I think the report output should somehow note this for the user, lest they get confused as to why the values don't match with other package outputs (including effectsize).

For example, https://github.com/easystats/report/issues/183#issuecomment-858420376

IndrajeetPatil avatar Jun 10 '21 08:06 IndrajeetPatil

effectsize gives a warning, but this is suppressed by report... :/

mattansb avatar Jun 10 '21 08:06 mattansb

If not suppressed, can it be muted?

DominiqueMakowski avatar Jun 10 '21 09:06 DominiqueMakowski

We should use tryCatch() to catch the warning and then adjust the report output accordingly.

bwiernik avatar Jun 10 '21 09:06 bwiernik

If I might be so bold as to make a suggestion: if an error message does get generated in the future, it might be useful to display the "correct" format for getting the "right" results as part of the message, as @mattansb posted in the other thread.

leighclark avatar Jun 10 '21 10:06 leighclark

Thinking out loud here:

How about-

  • effectsize outputs get a new attribute called approximate with a default value of FALSE
  • when insight::get_data() fails, and an approximation is used, this attribute value will change to TRUE
  • when report sees that this attribute is TRUE, it will add "(approximate)" to whatever effect size is being reported

For example, here it would change to

Cohen's d (approximate) = 2.03, 95% CI [1.13, 2.91]

IndrajeetPatil avatar Jun 10 '21 10:06 IndrajeetPatil

For example, here it would change to

Cohen's d (approximate) = 2.03, 95% CI [1.13, 2.91]

That would be great, and maybe (instead of what I suggested above) it could describe how to "correct" the approximation in the docs or in an example or something :)

leighclark avatar Jun 10 '21 11:06 leighclark

how to "correct" the approximation in the docs or in an example or something :)

This would essentially be "don't use formula notation for htest functions" - that's the solution! (:

mattansb avatar Jun 10 '21 14:06 mattansb

This would essentially be "don't use formula notation for htest functions" - that's the solution! (:

You are operating on the assumption that novices like me know what "formula notation" is ;)

leighclark avatar Jun 10 '21 14:06 leighclark

This would essentially be "don't use formula notation for htest functions" - that's the solution! (:

Or better, don't use htest functions, just fit a linear model 😜

bwiernik avatar Jun 10 '21 17:06 bwiernik

This would essentially be "don't use formula notation for htest functions" - that's the solution! (:

The formula notation for *.test() functions is when you use a formula to let the function know the structure of you data (:

t.test(mpg ~ am, data = mtcars) # formula

t.test(mtcars$mpg[mtcars$am==0], mtcars$mpg[mtcars$am==1]) # pass values

mattansb avatar Jun 11 '21 08:06 mattansb

But really @leighclark Don't use the *.test functions. Use lm() instead. https://lindeloev.github.io/tests-as-linear/

bwiernik avatar Jun 15 '21 03:06 bwiernik

Hmm this is good advice maybe for inference in general - but report will treat it like a linear model (so no Cohen's d...)

mattansb avatar Jun 15 '21 05:06 mattansb

But really @leighclark Don't use the *.test functions. Use lm() instead. https://lindeloev.github.io/tests-as-linear/

hey @bwiernik I think (know) we are at totally different stages of our psychology and statistics careers, so I am still at the stage where I have to do the things that are given to me, but thanks for the tip and I will take a look at it!

Cheers, Leigh

leighclark avatar Jun 15 '21 07:06 leighclark

@mattansb https://github.com/easystats/effectsize/issues/351

bwiernik avatar Jun 15 '21 12:06 bwiernik

This would be a great addition to the docs / examples ... I just needed to find this issue to figure out how to report t.tests

how to "correct" the approximation in the docs or in an example or something :)

This would essentially be "don't use formula notation for htest functions" - that's the solution! (:

LukasWallrich avatar May 01 '22 14:05 LukasWallrich

Results from effectsize() should have an approximate attribute that can be used.

mattansb avatar Sep 21 '22 04:09 mattansb