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

When using stats::t.test, the report() and report_table() function output displays "95 % CI" even if, say, conf.level = 0.975 #408

Open
gelisol opened this issue Dec 4, 2023 · 1 comment
Labels
reprex 📊 We need a reproducible example for further investigation

Comments

@gelisol
Copy link

gelisol commented Dec 4, 2023

Describe the bug

Not sure if this is a bug, or if I'm not specifying the correct parameters when using the reporter::report() function, but
when using stats::t.test, the report() and report_table() functions' output displays "95 % CI" even if, say, the stats::t.test conf.level is set to a value other than 0.95.

To Reproduce
Steps to reproduce the behaviour:

A_vs_B <- stats::t.test(
  A, B,
  conf.level = 0.975,
  alternative = 'greater',
  mu = -4.5
) |>
  report::report()

Expected behaviour
Display column header "97.5% CI" instead of "95% CI":

[Parameter1 | Parameter2 | Mean_Parameter1 | Mean_Parameter2 | Difference | 97.5% CI | t(98.86) | p | Cohen's d | Cohen's d CI

      A |          B |            1.01 |            1.29 |      -0.28 |   [-2.47, Inf] |     3.20 | < .001 |      0.64 |   [0.30, Inf]]

Screenshots
If applicable, add screenshots to help explain your problem.

Specifications (please complete the following information):

  • Package Version [e.g. 0.2.1] report version is: 0.5.7 (R version is: 4.2.2)
@strengejacke
Copy link
Member

Do you have a reproducible example?

t.test(1:10, y = c(7:20, 200)) |> report::report()
#> Effect sizes were labelled following Cohen's (1988) recommendations.
#> 
#> The Welch Two Sample t-test testing the difference between 1:10 and c(7:20,
#> 200) (mean of x = 5.50, mean of y = 25.93) suggests that the effect is
#> negative, statistically not significant, and medium (difference = -20.43, 95%
#> CI [-47.24, 6.38], t(14.16) = -1.63, p = 0.125; Cohen's d = -0.60, 95% CI
#> [-1.34, 0.16])

t.test(1:10, y = c(7:20, 200), conf.level = 0.7) |> report::report()
#> Effect sizes were labelled following Cohen's (1988) recommendations.
#> 
#> The Welch Two Sample t-test testing the difference between 1:10 and c(7:20,
#> 200) (mean of x = 5.50, mean of y = 25.93) suggests that the effect is
#> negative, statistically not significant, and medium (difference = -20.43, 70%
#> CI [-33.90, -6.97], t(14.16) = -1.63, p = 0.125; Cohen's d = -0.60, 70% CI
#> [-0.98, -0.19])

@strengejacke strengejacke added the reprex 📊 We need a reproducible example for further investigation label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex 📊 We need a reproducible example for further investigation
Projects
None yet
Development

No branches or pull requests

2 participants