Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd the option `conf.int` in wilcox_test() #45
Comments
|
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 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) |
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.