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

Add the option conf.int in wilcox_test() #45

Closed
kassambara opened this issue May 6, 2020 · 1 comment
Closed

Add the option conf.int in wilcox_test() #45

kassambara opened this issue May 6, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@kassambara
Copy link
Owner

Optionally (if argument conf.int is true), a nonparametric confidence interval and an estimator for the pseudomedian (one-sample case) or for the difference of the location parameters x-y is computed.

@kassambara
Copy link
Owner Author

Updating the rstatix::wilcox_test() to report an estimator for the pseudomedian (one-sample case) or for the difference of the location parameters x-y. The column estimate and the confidence intervals are now displayed in the test result when the option detailed = TRUE is specified in the wilcox_test() and pairwise_wilcox_test() functions. You can install the dev version using devtools::install_github("kassambara/rstatix")

library(rstatix)


# Data preparation
data("ToothGrowth")
df <- ToothGrowth

# Wilcoxon test
df %>% wilcox_test(len ~ supp)
#> # A tibble: 1 x 7
#>   .y.   group1 group2    n1    n2 statistic      p
#> * <chr> <chr>  <chr>  <int> <int>     <dbl>  <dbl>
#> 1 len   OJ     VC        30    30      576. 0.0645

# Detailed results showing the estimator for the difference in location
df %>% wilcox_test(len ~ supp, detailed = TRUE)
#> # A tibble: 1 x 12
#>   estimate .y.   group1 group2    n1    n2 statistic      p conf.low conf.high
#> *    <dbl> <chr> <chr>  <chr>  <int> <int>     <dbl>  <dbl>    <dbl>     <dbl>
#> 1     4.00 len   OJ     VC        30    30      576. 0.0645   -0.100      8.50
#> # … with 2 more variables: method <chr>, alternative <chr>

Created on 2020-05-07 by the reprex package (v0.3.0.9001)

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

No branches or pull requests

1 participant