jasp-issues icon indicating copy to clipboard operation
jasp-issues copied to clipboard

[Bug]: Unwanted scientific notation in p values despite preference setting

Open davert318 opened this issue 9 months ago • 2 comments

JASP Version

0.19.3

Commit ID

No response

JASP Module

T-Tests

What analysis are you seeing the problem on?

No response

What OS are you seeing the problem on?

macOS Silicon

Bug Description

Getting unwanted scientific notation for p despite preferences setting values to two digits in preferences

Image

Expected Behaviour

Preferences should be honored ;) or at least use the <.001 convention for very small values of p more consistently. I know scientific notation but any opportunity for error is undesirable!

Steps to Reproduce

Run t-tests after setting preferences?

Log (if any)

No response

More Debug Information

No response

Final Checklist

  • [x] I have included a screenshot showcasing the issue, if possible.
  • [ ] I have included a JASP file (zipped) or data file that causes the crash/bug, if applicable.
  • [x] I have accurately described the bug, and steps to reproduce it.

davert318 avatar Apr 10 '25 15:04 davert318

@boutinb I think I have seen that too. p-values are somehow treated special / separately. But the options do not make that clear enough nor does the help file. And it is also not obvious to the user why they are treated special in the first place. I agree, that often it is good to see a higher precision p-value, while other values have a smaller amount of decimals, but at least the scientific notation should not appear in this case - should it?

tomtomme avatar Apr 13 '25 19:04 tomtomme

I think it might be a bug, since I did notice that later, on a different machine (still MacOS M-series), same type of analysis, but it showed p properly and rounded everything else. (Crosstabs, I mean contingency tables, can be pain with two decimal places on the percentages.)

I’ve never seen scientific notation on p before.

Thanks for taking up this report so quickly!!

davert318 avatar Apr 13 '25 19:04 davert318

I know that there was a lot of discussion about it. @vandenman @EJWagenmakers ?

boutinb avatar Apr 16 '25 14:04 boutinb

@boutinb @JorisGoosen @EJWagenmakers @vandenman I think this issue arises when a p-value is greater than 0.001 (so that way of displaying cannot be used), and then the number decimals gets limited. Then, JASP will ignore the option for exact p-values. I think the option is not necessarily about using the scientific notation or not, but about how p-values below 0.001 ought to be displayed. Still, the behavior seems a little weird and I'm not sure it's intentional. Do you think the p-values in the screenshot below should be displayed as 0.1, 0, and 0.1?

I actually found this issue because I received a question during yesterday's JASP workshop, about whether the number of decimals that p-values get displayed with, should be affected by the fix decimals option. For instance, when set to 2, p-values could be listed as <0.01, and <0.1 for 1 decimal, etc. Is this an easy to implement feature request? And I think that also solves the problem described here right?

Steps to reproduce:

  • use debug data, go to one-sample t-test
  • specify contNormal
  • set number of decimals to 1 or 2

1 decimal Image

2 decimal Image

JohnnyDoorn avatar Jul 01 '25 14:07 JohnnyDoorn

That's how I'd expect it to show up with fixed decimal ranges.

I'm guessing this doesn't happen if you select "display exact p-values"?

I think SPSS does it as <.00 which is obviously wrong on the face of it... one way around that would be going as far through 0s as needed to get to a non-zero number, but it would be awkward to see it as .0003 in a column of .08 and such! On the other hand that would be hard to misinterpret.

Seeing the table options again I'm thinking the issue is user error in not displaying exact p-values. This would explain why I saw different things on different computers.

davert318 avatar Jul 01 '25 14:07 davert318

Haha yes we can definitely improve on how SPSS displays those.. so perhaps we can turn this bug report into a feature request where the decimals of the p-value display are affected by the setting too?

JohnnyDoorn avatar Jul 01 '25 15:07 JohnnyDoorn

Feature request makes sense.

I thought what you describe was what was happening. I think it makes sense to set p separately from other numbers. I know it's a mess to do it that way. Thing is, most of the time if I'm comparing averages, I don't even want decimals, but for p, I generally want two places. I mean, for me, the question is nearly always “below .01,” or “below .05.” (Those who use Bonferroni method and such need more precision.)

davert318 avatar Jul 01 '25 15:07 davert318

PS> Thank you for helping to make JASP largely superior to SPSS wherever I've looked at both.

I'm looking forward someday to automatic Welch's t-tests when the group variances are different! (SPSS' output used to confuse the !@#&*^! out of my students.)

davert318 avatar Jul 01 '25 16:07 davert318

Ill add it (the pvalue depending on the setting)

JorisGoosen avatar Jul 02 '25 07:07 JorisGoosen

Alright, so currently I get this for pvalues:

Image Image Image Image Image Image Image Image Image

I guess having 0 decimals doesnt make the most sense but if people dont want that they should probably not set that :p

Edit: if locale is set to usa english it would have a . as a decimal separator of course.

JorisGoosen avatar Jul 02 '25 08:07 JorisGoosen

@JorisGoosen Very nice that this gets improved :)

Also note the discussion on this topic of this duplicate I just closed here: https://github.com/jasp-stats/jasp-issues/issues/3474 Maybe there are additional infos to consider in there.

tomtomme avatar Jul 02 '25 09:07 tomtomme

That looks great already @JorisGoosen! One tweak that I would like to suggest still, is to keep the old behavior of showing (for instance with 2 decimals) 9.18\times10^{-3} notation when exact p-values are requested, since that's actually exact, rather than rounding it to 2 decimals.

JohnnyDoorn avatar Jul 02 '25 09:07 JohnnyDoorn

I was not very happy with the 0.00 there no haha

JorisGoosen avatar Jul 02 '25 09:07 JorisGoosen

exactly, the p-values should not just be cut of.

tomtomme avatar Jul 02 '25 09:07 tomtomme

They are rounded down actually, point taken though ;)

JorisGoosen avatar Jul 02 '25 09:07 JorisGoosen

This will be fixed with version 0.95.1 if I understood correctly.

tomtomme avatar Jul 02 '25 14:07 tomtomme

Nope, it will be in 0.95, its part of the fixes for the formatting.

JorisGoosen avatar Jul 02 '25 15:07 JorisGoosen

This is all great news!

davert318 avatar Jul 02 '25 15:07 davert318