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

detailed = TRUE: Output could mention correct method used #124

Open
ddauber opened this issue Aug 25, 2021 · 1 comment
Open

detailed = TRUE: Output could mention correct method used #124

ddauber opened this issue Aug 25, 2021 · 1 comment

Comments

@ddauber
Copy link

ddauber commented Aug 25, 2021

This is somewhat linked to #23. When retrieving the full output with detailed = TRUE, it should return the correct method.

For example, the distinction between T-test and Welch T-test does matter. This information is provided through the underlying function.

This would be especially useful when writing one's paper or report using markdown because you can easily extract the method automatically rather than manually editing the file. This is not a problem for one test, but if one runs several comparisons with different methods, it could become confusing quickly.

I can see how it might be an easy fix since you likely already use method to generate the tibble output. Certianly nothing major as long as you know what you are doing, but maybe more an 'enhancement' rather than an 'issue' 😉

library(rstatix)
#> 
#> Attaching package: 'rstatix'
#> The following object is masked from 'package:stats':
#> 
#>     filter

# T-Test
df <- ToothGrowth
df %>% t_test(len ~ supp,
              var.equal = TRUE,
              detailed = TRUE) %>% 
  select(method)
#> # A tibble: 1 × 1
#>   method
#>   <chr> 
#> 1 T-test

# Welch T-test
df %>% t_test(len ~ supp,
              var.equal = FALSE,
              detailed = TRUE) %>% 
  select(method)
#> # A tibble: 1 × 1
#>   method
#>   <chr> 
#> 1 T-test

# The method of underlying function 
test <- t.test(len ~ supp,
              var.equal = FALSE,
              data = df)

test$method
#> [1] "Welch Two Sample t-test"

PS: The same is true for some other functions too, e.g. 'wilcoxon_test(paired = FALSE)' should be 'Mann-Whitney U', etc.

@ddauber
Copy link
Author

ddauber commented Mar 22, 2024

Hi

Is this package still maintained? If not, I might as well close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant