jamovi / jmv

jamovi for R
https://www.jamovi.org
56 stars 27 forks source link

Rounding of Decimals #360

Closed SHogenboom closed 1 year ago

SHogenboom commented 1 year ago

Situation An independent samples t-test on the warpbreaks dataset (R datasets). With breaks as the dependent variable, and wool as the grouping variable. Performing a Welch's t-test.

Jamovi Cloud Outpus as expected; nicely formatted tables with the correct number of digits.

R Using the code:

jmv::ttestIS(data = warpbreaks,
             vars = breaks,
             group = wool,
             students = FALSE,
             welchs = TRUE)

produces the unexecpted result of a table where the number of decimals is (1) rather larger, and (2) not conform APA styling. Is there a way for me to fix this? Of course the number of required decimals is different for p-values compared to means (etc). So wondering if there is a jamovi built in approach I can use.

jonathon-love commented 1 year ago

number of decimals can be customised with the R options options(digits=4) or similar.

SHogenboom commented 1 year ago

@jonathon-love thanks for the quick reply! I am aware of that option - however, it doesn't account for the APA styling of decimals. Like I said, the number of decimals for p-values (3) is different from other output generated by the same function (e.g,. descriptives, t-value; 2 decimals).

As the output in the Jamovi software does account for such differences, I was hoping that the code for doing so already 'lives' somewhere and can thus easily be implemented to generate the correct R output as well.

jonathon-love commented 1 year ago

i don't think so, sorry. in generating output for R, we just followed the formatting conventions of R. ... so it's not really optimised for publication.

SHogenboom commented 1 year ago

Alright, thanks for the reply!