diff --git a/docs/404.html b/docs/404.html index cfe23ba..4170c41 100644 --- a/docs/404.html +++ b/docs/404.html @@ -73,7 +73,7 @@ rstatix - 0.7.0 + 0.7.1 diff --git a/docs/authors.html b/docs/authors.html index 8b7a9e6..bf96f52 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -73,7 +73,7 @@ rstatix - 0.7.0 + 0.7.1 diff --git a/docs/index.html b/docs/index.html index 60b5a5d..2820a0a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -39,7 +39,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -120,7 +120,9 @@

  • anova_test(): an easy-to-use wrapper around car::Anova() to perform different types of ANOVA tests, including independent measures ANOVA, repeated measures ANOVA and mixed ANOVA.
  • -get_anova_test_table(): extract ANOVA table from anova_test() results. Can apply sphericity correction automatically in the case of within-subject (repeated measures) designs. - welch_anova_test(): Welch one-Way ANOVA test. A pipe-friendly wrapper around the base function stats::oneway.test(). This is is an alternative to the standard one-way ANOVA in the situation where the homogeneity of variance assumption is violated.
  • +get_anova_test_table(): extract ANOVA table from anova_test() results. Can apply sphericity correction automatically in the case of within-subject (repeated measures) designs. +
  • +welch_anova_test(): Welch one-Way ANOVA test. A pipe-friendly wrapper around the base function stats::oneway.test(). This is is an alternative to the standard one-way ANOVA in the situation where the homogeneity of variance assumption is violated.
  • kruskal_test(): perform kruskal-wallis rank sum test
  • @@ -128,7 +130,7 @@

  • get_comparisons(): Create a list of possible pairwise comparisons between groups.
  • -get_pvalue_position: autocompute p-value positions for plotting significance using ggplot2.
  • +get_pvalue_position(): autocompute p-value positions for plotting significance using ggplot2.

  • @@ -319,7 +321,7 @@

  • Install the latest developmental version from GitHub as follow:
  • if(!require(devtools)) install.packages("devtools")
    -devtools::install_github("kassambara/rstatix")
    +devtools::install_github("kassambara/rstatix")

    @@ -339,7 +341,7 @@

    get_summary_stats(Sepal.Length, Sepal.Width, type = "common") #> # A tibble: 2 x 10 #> variable n min max median iqr mean sd se ci -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 Sepal.Length 150 4.3 7.9 5.8 1.3 5.84 0.828 0.068 0.134 #> 2 Sepal.Width 150 2 4.4 3 0.5 3.06 0.436 0.036 0.07 @@ -348,11 +350,11 @@

    iris %>% get_summary_stats(type = "common") #> # A tibble: 4 x 10 #> variable n min max median iqr mean sd se ci -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 Petal.Length 150 1 6.9 4.35 3.5 3.76 1.76 0.144 0.285 -#> 2 Petal.Width 150 0.1 2.5 1.3 1.5 1.20 0.762 0.062 0.123 -#> 3 Sepal.Length 150 4.3 7.9 5.8 1.3 5.84 0.828 0.068 0.134 -#> 4 Sepal.Width 150 2 4.4 3 0.5 3.06 0.436 0.036 0.07 +#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 Sepal.Length 150 4.3 7.9 5.8 1.3 5.84 0.828 0.068 0.134 +#> 2 Sepal.Width 150 2 4.4 3 0.5 3.06 0.436 0.036 0.07 +#> 3 Petal.Length 150 1 6.9 4.35 3.5 3.76 1.76 0.144 0.285 +#> 4 Petal.Width 150 0.1 2.5 1.3 1.5 1.20 0.762 0.062 0.123 # Grouped data @@ -362,7 +364,7 @@

    get_summary_stats(Sepal.Length, type = "mean_sd") #> # A tibble: 3 x 5 #> Species variable n mean sd -#> <fct> <chr> <dbl> <dbl> <dbl> +#> <fct> <fct> <dbl> <dbl> <dbl> #> 1 setosa Sepal.Length 50 5.01 0.352 #> 2 versicolor Sepal.Length 50 5.94 0.516 #> 3 virginica Sepal.Length 50 6.59 0.636 diff --git a/docs/news/index.html b/docs/news/index.html index bb5d1d5..f8b78f3 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -73,7 +73,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -116,6 +116,35 @@

    Changelog

    Source: NEWS.md +
    +

    +rstatix 0.7.1 Unreleased +

    +
    +

    +Minor changes

    + +
    +
    +

    +Bug fixes

    + +
    +

    rstatix 0.7.0 2021-02-13 @@ -131,13 +160,13 @@

    Major changes

    -
    +

    -Minor changes

    +Minor changes
    -
    +

    -Bug fixes

    +Bug fixes
    • The function anova_test() computes now repeated measures ANOVA without error when unused columns are present in the input data frame (#55)
    @@ -160,9 +189,9 @@

    rstatix 0.6.0 2020-06-18

    -
    +

    -Minor changes

    +Minor changes
    • Adapted to upcoming broom v0.7.0 release (#49)
    • New argument stack added in get_y_position() to compute p-values y position for stacked bar plots (#48).
    • @@ -170,9 +199,9 @@

      wilcox_test(): Now, if detailed = TRUE, an estimate of the location parameter (Only present if argument detailed = TRUE). This corresponds to the pseudomedian (for one-sample case) or to the difference of the location parameter (for two-samples case) (#45).

    -
    +

    -Bug fixes

    +Bug fixes
    • anova_test() function: Changing R default contrast setting (contr.treatment) into orthogonal contrasts (contr.sum) to have comparable results to SPSS when users define the model using formula (@benediktclaus, #40).
    • @@ -191,9 +220,9 @@

    • New functions added for easy data frame manipulation. These functions are internally used in the rstatix and the ggpubr package and makes it easy to program with tidyverse packages using non standard evaluation. - df_select - df_arrange - df_group_by - df_nest_by - df_split_by - df_unite - df_get_var_names - df_label_both - df_label_value
    -
    +

    -Minor changes

    +Minor changes
    -
    +

    -Bug fixes

    +Bug fixes
    • An informative message is now displayed when users try to apply Hedge’s correction when computing the Cohen’s D for one sample test (@GegznaV, #36).
    • Bug fixes in the games_howell_test() function : the t-statistic is now calculated using the absolute mean difference between groups (@GegznaV, #37).
    • @@ -222,16 +251,16 @@

    • The cohens_d() function now supports Hedge’s correction. New argument hedge.correction added . logical indicating whether apply the Hedges correction by multiplying the usual value of Cohen’s d by (N-3)/(N-2.25) (for unpaired t-test) and by (n1-2)/(n1-1.25) for paired t-test; where N is the total size of the two groups being compared (N = n1 + n2) (@IndrajeetPatil, #9).
    -
    +

    -Minor changes

    +Minor changes
    • Now, the function cohens_d() outputs values with directionality. The absolute value is no longer returned. It can now be positive or negative depending on the data (@narunpat, #9).
    -
    +

    -Bug fixes

    +Bug fixes
    • The value of mu is now considered when calculating cohens_d() for one sample t-test (@mllewis, #22).
    • The function tukey_hsd() now handles situation where minus - symbols are present in factor levels (@IndrajeetPatil, #19).
    • @@ -242,9 +271,9 @@

      rstatix 0.3.1 2019-12-16

      -
      +

      -Minor changes

      +Minor changes
      • tidyr > 1.0.0 now required
      • know, identify_outliers returns a basic data frame instead of tibble when nrow = 0 (for nice printing)
      • @@ -275,9 +304,9 @@

        prop_trend_test(): Performs chi-squared test for trend in proportion. This test is also known as Cochran-Armitage trend test.

      -
      +

      -Minor changes

      +Minor changes
      • Now get_test_label() and get_pwc_label() return expression by default
      • Unit testing and spelling check added
      • @@ -289,9 +318,9 @@

        rstatix 0.2.0 2019-09-03

        -
        +

        -Minor changes

        +Minor changes
        • get_anova_table() supports now an object of class grouped_anova_test @@ -323,9 +352,9 @@

        • New function emmeans_test() added for pairwise comparisons of estimated marginal means.
        -
        +

        -Minor changes

        +Minor changes
        -
        +

        -Bug fixes

        +Bug fixes
        • detailed arguments correctly propagated when grouped stats are performed
        • @@ -362,9 +391,9 @@

        • New function sign_test() added.
        -
        +

        -Minor changes

        +Minor changes
        • get_summary_stats() now supports type = “min”, “max”, “mean” or “median”
        • @@ -372,9 +401,9 @@

        • The results of cohens_d() is now a data frame containing the Cohen’s d and the magnitude.
        -
        +

        -Bug fixes

        +Bug fixes
        • the argument detatiled is now passed to compare_pairs().
        diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 238111b..6c05149 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,5 +2,5 @@ pandoc: 2.7.3 pkgdown: 1.5.1 pkgdown_sha: ~ articles: [] -last_built: 2021-02-13T17:47Z +last_built: 2022-11-09T00:52Z diff --git a/docs/reference/Manova.html b/docs/reference/Manova.html index 6741d1f..688fe1d 100644 --- a/docs/reference/Manova.html +++ b/docs/reference/Manova.html @@ -74,7 +74,7 @@ rstatix - 0.7.0 + 0.7.1
        diff --git a/docs/reference/add_significance.html b/docs/reference/add_significance.html index cbbfdee..0e611d0 100644 --- a/docs/reference/add_significance.html +++ b/docs/reference/add_significance.html @@ -74,7 +74,7 @@ rstatix - 0.7.0 + 0.7.1
        @@ -165,12 +165,12 @@

        Examp ToothGrowth %>% t_test(len ~ dose) %>% adjust_pvalue() %>% - add_significance("p.adj")

        #> # A tibble: 3 x 10 + add_significance("p.adj")
        #> # A tibble: 3 x 10 #> .y. group1 group2 n1 n2 statistic df p p.adj p.adj.signif -#> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 2.54e- 7 **** -#> 2 len 0.5 2 20 20 -11.8 36.9 4.40e-14 1.32e-13 **** -#> 3 len 1 2 20 20 -4.90 37.1 1.91e- 5 1.91e- 5 ****
        +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 2.54e- 7 **** +#> 2 len 0.5 2 20 20 -11.8 36.9 4.4 e-14 1.32e-13 **** +#> 3 len 1 2 20 20 -4.90 37.1 1.91e- 5 1.91e- 5 ****
        @@ -158,12 +158,12 @@

        Examp
        # Perform pairwise comparisons and adjust p-values ToothGrowth %>% t_test(len ~ dose) %>% - adjust_pvalue()
        #> # A tibble: 3 x 10 + adjust_pvalue()
        #> # A tibble: 3 x 10 #> .y. group1 group2 n1 n2 statistic df p p.adj p.adj.signif -#> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 2.54e- 7 **** -#> 2 len 0.5 2 20 20 -11.8 36.9 4.40e-14 1.32e-13 **** -#> 3 len 1 2 20 20 -4.90 37.1 1.91e- 5 1.91e- 5 ****
        +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 2.54e- 7 **** +#> 2 len 0.5 2 20 20 -11.8 36.9 4.4 e-14 1.32e-13 **** +#> 3 len 1 2 20 20 -4.90 37.1 1.91e- 5 1.91e- 5 ****

        diff --git a/docs/reference/anova_test.html b/docs/reference/anova_test.html index b2a0cae..9d27247 100644 --- a/docs/reference/anova_test.html +++ b/docs/reference/anova_test.html @@ -93,7 +93,7 @@ rstatix - 0.7.0 + 0.7.1
        @@ -344,7 +344,7 @@

        Examp # One-way ANOVA test #::::::::::::::::::::::::::::::::::::::::: -df %>% anova_test(len ~ dose)

      #> Coefficient covariances computed by hccm()
      #> ANOVA Table (type II tests) +df %>% anova_test(len ~ dose)
      #> ANOVA Table (type II tests) #> #> Effect DFn DFd F p p<.05 ges #> 1 dose 1 58 105.065 1.23e-14 * 0.644
      @@ -352,14 +352,14 @@

      Examp #::::::::::::::::::::::::::::::::::::::::: df %>% group_by(supp) %>% - anova_test(len ~ dose)

      #> Coefficient covariances computed by hccm()
      #> Coefficient covariances computed by hccm()
      #> # A tibble: 2 x 8 + anova_test(len ~ dose)
      #> # A tibble: 2 x 8 #> supp Effect DFn DFd F p `p<.05` ges -#> * <fct> <chr> <dbl> <dbl> <dbl> <dbl> <chr> <dbl> -#> 1 OJ dose 1 28 36.0 1.82e- 6 * 0.563 -#> 2 VC dose 1 28 118. 1.51e-11 * 0.808
      +#> * <fct> <chr> <dbl> <dbl> <dbl> <dbl> <chr> <dbl> +#> 1 OJ dose 1 28 36.0 1.82e- 6 * 0.563 +#> 2 VC dose 1 28 118. 1.51e-11 * 0.808
      # Two-way ANOVA test #::::::::::::::::::::::::::::::::::::::::: -df %>% anova_test(len ~ supp*dose)
      #> Coefficient covariances computed by hccm()
      #> ANOVA Table (type II tests) +df %>% anova_test(len ~ supp*dose)
      #> ANOVA Table (type II tests) #> #> Effect DFn DFd F p p<.05 ges #> 1 supp 1 56 12.317 8.94e-04 * 0.180 @@ -428,8 +428,7 @@

      Examp # Use model as arguments #::::::::::::::::::::::::::::::::::::::::: .my.model <- lm(yield ~ block + N*P*K, npk) -anova_test(.my.model)

      #> Coefficient covariances computed by hccm()
      #> Note: model has aliased coefficients -#> sums of squares computed by model comparison
      #> ANOVA Table (type II tests) +anova_test(.my.model)
      #> ANOVA Table (type II tests) #> #> Effect DFn DFd F p p<.05 ges #> 1 block 4 12 4.959 0.014 * 0.623 diff --git a/docs/reference/as_cor_mat.html b/docs/reference/as_cor_mat.html index 34095d1..64b177c 100644 --- a/docs/reference/as_cor_mat.html +++ b/docs/reference/as_cor_mat.html @@ -75,7 +75,7 @@ rstatix - 0.7.0 + 0.7.1
      @@ -150,31 +150,31 @@

      Examp res.cor.test <- mtcars %>% select(mpg, disp, hp, drat, wt, qsec) %>% cor_test() -res.cor.test

      #> # A tibble: 36 x 8 +res.cor.test
      #> # A tibble: 36 x 8 #> var1 var2 cor statistic p conf.low conf.high method -#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 mpg mpg 1 Inf 0. 1 1 Pearson -#> 2 mpg disp -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson -#> 3 mpg hp -0.78 -6.74 1.79e- 7 -0.885 -0.586 Pearson -#> 4 mpg drat 0.68 5.10 1.78e- 5 0.436 0.832 Pearson -#> 5 mpg wt -0.87 -9.56 1.29e-10 -0.934 -0.744 Pearson -#> 6 mpg qsec 0.42 2.53 1.71e- 2 0.0820 0.670 Pearson -#> 7 disp mpg -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson -#> 8 disp disp 1 Inf 0. 1 1 Pearson -#> 9 disp hp 0.79 7.08 7.14e- 8 0.611 0.893 Pearson -#> 10 disp drat -0.71 -5.53 5.28e- 6 -0.849 -0.481 Pearson -#> # … with 26 more rows
      +#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 mpg mpg 1 Inf 0 1 1 Pearson +#> 2 mpg disp -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson +#> 3 mpg hp -0.78 -6.74 1.79e- 7 -0.885 -0.586 Pearson +#> 4 mpg drat 0.68 5.10 1.78e- 5 0.436 0.832 Pearson +#> 5 mpg wt -0.87 -9.56 1.29e-10 -0.934 -0.744 Pearson +#> 6 mpg qsec 0.42 2.53 1.71e- 2 0.0820 0.670 Pearson +#> 7 disp mpg -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson +#> 8 disp disp 1 Inf 0 1 1 Pearson +#> 9 disp hp 0.79 7.08 7.14e- 8 0.611 0.893 Pearson +#> 10 disp drat -0.71 -5.53 5.28e- 6 -0.849 -0.481 Pearson +#> # … with 26 more rows
      # Convert the correlation test into a correlation matrix #::::::::::::::::::::::::::::::::::::::::::::::: -res.cor.test %>% as_cor_mat()
      #> # A tibble: 6 x 7 +res.cor.test %>% as_cor_mat()
      #> # A tibble: 6 x 7 #> rowname mpg disp hp drat wt qsec -#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 -#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 -#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 -#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 -#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 -#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
      +#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 +#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 +#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 +#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 +#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 +#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
      @@ -238,18 +238,18 @@

      Examp #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Data: 160 mice with cancer including 95 male and 65 female # Q1: Does cancer affect more males than females? -binom_test(x = 95, n = 160)

    #> # A tibble: 1 x 6 +binom_test(x = 95, n = 160)
    #> # A tibble: 1 x 6 #> n estimate conf.low conf.high p p.signif -#> * <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 160 0.594 0.513 0.671 0.0216 *
    # => yes, there are a significant difference +#> * <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 160 0.594 0.513 0.671 0.0216 *
    # => yes, there are a significant difference # Q2: compare the observed proportion of males # to an expected proportion (p = 3/5) -binom_test(x = 95, n = 160, p = 3/5)
    #> # A tibble: 1 x 6 +binom_test(x = 95, n = 160, p = 3/5)
    #> # A tibble: 1 x 6 #> n estimate conf.low conf.high p p.signif -#> * <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 160 0.594 0.513 0.671 0.872 ns
    # => there are no significant difference +#> * <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 160 0.594 0.513 0.671 0.872 ns
    # => there are no significant difference # Multinomial test #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -258,44 +258,44 @@

    Examp # Question 1: are the color equally common ? # this is a test of homogeneity res <- multinom_test(tulip) -res

    #> # A tibble: 1 x 2 +res
    #> # A tibble: 1 x 2 #> p p.signif -#> * <dbl> <chr> -#> 1 0.000000711 ****
    attr(res, "descriptives")
    #> # A tibble: 3 x 3 +#> * <dbl> <chr> +#> 1 0.000000711 ****
    attr(res, "descriptives")
    #> # A tibble: 3 x 3 #> group observed expected -#> <chr> <dbl> <dbl> -#> 1 red 81 52.7 -#> 2 yellow 50 52.7 -#> 3 white 27 52.7
    +#> <chr> <dbl> <dbl> +#> 1 red 81 52.7 +#> 2 yellow 50 52.7 +#> 3 white 27 52.7
    # Pairwise comparisons between groups -pairwise_binom_test(tulip, p.adjust.method = "bonferroni")
    #> # A tibble: 3 x 9 +pairwise_binom_test(tulip, p.adjust.method = "bonferroni")
    #> # A tibble: 3 x 9 #> group1 group2 n estimate conf.low conf.high p p.adj p.adj.signif -#> * <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 red yellow 131 0.618 0.529 0.702 8.51e-3 2.55e-2 * -#> 2 red white 108 0.75 0.657 0.828 1.91e-7 5.72e-7 **** -#> 3 yellow white 77 0.649 0.532 0.755 1.17e-2 3.50e-2 *
    +#> * <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 red yellow 131 0.618 0.529 0.702 8.51e-3 2.55e-2 * +#> 2 red white 108 0.75 0.657 0.828 1.91e-7 5.72e-7 **** +#> 3 yellow white 77 0.649 0.532 0.755 1.17e-2 3.5 e-2 *
    # Question 2: comparing observed to expected proportions # this is a goodness-of-fit test expected.p <- c(red = 0.5, yellow = 0.33, white = 0.17) res <- multinom_test(tulip, expected.p) -res
    #> # A tibble: 1 x 2 +res
    #> # A tibble: 1 x 2 #> p p.signif -#> * <dbl> <chr> -#> 1 0.942 ns
    attr(res, "descriptives")
    #> # A tibble: 3 x 3 +#> * <dbl> <chr> +#> 1 0.942 ns
    attr(res, "descriptives")
    #> # A tibble: 3 x 3 #> group observed expected -#> <chr> <dbl> <dbl> -#> 1 red 81 79 -#> 2 yellow 50 52.1 -#> 3 white 27 26.9
    +#> <chr> <dbl> <dbl> +#> 1 red 81 79 +#> 2 yellow 50 52.1 +#> 3 white 27 26.9
    # Pairwise comparisons against a given probabilities -pairwise_binom_test_against_p(tulip, expected.p)
    #> # A tibble: 3 x 10 -#> group observed expected n estimate conf.low conf.high p p.adj -#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 red 81 79 158 0.513 0.432 0.593 0.811 1 -#> 2 yell… 50 52.1 158 0.316 0.245 0.395 0.800 1 -#> 3 white 27 26.9 158 0.171 0.116 0.239 1 1 -#> # … with 1 more variable: p.adj.signif <chr>
    +pairwise_binom_test_against_p(tulip, expected.p)
    #> # A tibble: 3 x 10 +#> group observed expected n estimate conf.low conf.high p p.adj +#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 red 81 79 158 0.513 0.432 0.593 0.811 1 +#> 2 yellow 50 52.1 158 0.316 0.245 0.395 0.800 1 +#> 3 white 27 26.9 158 0.171 0.116 0.239 1 1 +#> # … with 1 more variable: p.adj.signif <chr>
    @@ -155,10 +155,10 @@

    Value

    Examples

    data(iris) -box_m(iris[, -5], iris[, 5])
    #> # A tibble: 1 x 4 +box_m(iris[, -5], iris[, 5])
    #> # A tibble: 1 x 4 #> statistic p.value parameter method -#> <dbl> <dbl> <dbl> <chr> -#> 1 141. 3.35e-20 20 Box's M-test for Homogeneity of Covariance Matri…
    +#> <dbl> <dbl> <dbl> <chr> +#> 1 141. 3.35e-20 20 Box's M-test for Homogeneity of Covariance Matri…
    @@ -260,24 +260,24 @@

    Examp #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tulip <- c(red = 81, yellow = 50, white = 27) # Q1: Are the colors equally common? -chisq_test(tulip)

    #> # A tibble: 1 x 6 +chisq_test(tulip)
    #> # A tibble: 1 x 6 #> n statistic p df method p.signif -#> * <int> <dbl> <dbl> <dbl> <chr> <chr> -#> 1 3 27.9 0.00000088 2 Chi-square test ****
    pairwise_chisq_gof_test(tulip)
    #> # A tibble: 3 x 8 +#> * <int> <dbl> <dbl> <dbl> <chr> <chr> +#> 1 3 27.9 0.00000088 2 Chi-square test ****
    pairwise_chisq_gof_test(tulip)
    #> # A tibble: 3 x 8 #> n group1 group2 statistic p df p.adj p.adj.signif -#> * <int> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 2 red yellow 7.34 0.00676 1 0.0135 * -#> 2 2 red white 27 0.000000203 1 0.000000609 **** -#> 3 2 yellow white 6.87 0.00876 1 0.0135 *
    # Q2: comparing observed to expected proportions -chisq_test(tulip, p = c(1/2, 1/3, 1/6))
    #> # A tibble: 1 x 6 +#> * <int> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 2 red yellow 7.34 0.00676 1 0.0135 * +#> 2 2 red white 27 0.000000203 1 0.000000609 **** +#> 3 2 yellow white 6.87 0.00876 1 0.0135 *
    # Q2: comparing observed to expected proportions +chisq_test(tulip, p = c(1/2, 1/3, 1/6))
    #> # A tibble: 1 x 6 #> n statistic p df method p.signif -#> * <int> <dbl> <dbl> <dbl> <chr> <chr> -#> 1 3 0.203 0.904 2 Chi-square test ns
    pairwise_chisq_test_against_p(tulip, p = c(0.5, 0.33, 0.17))
    #> # A tibble: 3 x 9 +#> * <int> <dbl> <dbl> <dbl> <chr> <chr> +#> 1 3 0.203 0.904 2 Chi-square test ns
    pairwise_chisq_test_against_p(tulip, p = c(0.5, 0.33, 0.17))
    #> # A tibble: 3 x 9 #> group observed expected n statistic p df p.adj p.adj.signif -#> * <chr> <dbl> <dbl> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 red 81 79 2 0.101 0.75 1 1 ns -#> 2 yellow 50 52.1 2 0.131 0.717 1 1 ns -#> 3 white 27 26.9 2 0.000879 0.976 1 1 ns
    +#> * <chr> <dbl> <dbl> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 red 81 79 2 0.101 0.75 1 1 ns +#> 2 yellow 50 52.1 2 0.131 0.717 1 1 ns +#> 3 white 27 26.9 2 0.000879 0.976 1 1 ns
    # Homogeneity of proportions between groups #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Data: Titanic @@ -293,19 +293,19 @@

    Examp #> Survived 1st 2nd 3rd Crew #> Yes 203 118 178 212 #> No 122 167 528 673

    # Chi-square test -chisq_test(xtab)
    #> # A tibble: 1 x 6 -#> n statistic p df method p.signif -#> * <dbl> <dbl> <dbl> <int> <chr> <chr> -#> 1 2201 190. 5.00e-41 3 Chi-square test ****
    # Compare the proportion of survived between groups -pairwise_prop_test(xtab)
    #> # A tibble: 6 x 5 +chisq_test(xtab)
    #> # A tibble: 1 x 6 +#> n statistic p df method p.signif +#> * <dbl> <dbl> <dbl> <int> <chr> <chr> +#> 1 2201 190. 5e-41 3 Chi-square test ****
    # Compare the proportion of survived between groups +pairwise_prop_test(xtab)
    #> # A tibble: 6 x 5 #> group1 group2 p p.adj p.adj.signif -#> * <chr> <chr> <dbl> <dbl> <chr> -#> 1 1st 2nd 3.13e- 7 9.38e- 7 **** -#> 2 1st 3rd 2.55e-30 1.27e-29 **** -#> 3 2nd 3rd 6.90e- 7 1.38e- 6 **** -#> 4 1st Crew 1.62e-35 9.73e-35 **** -#> 5 2nd Crew 1.94e- 8 7.75e- 8 **** -#> 6 3rd Crew 6.03e- 1 6.03e- 1 ns
    +#> * <chr> <chr> <dbl> <dbl> <chr> +#> 1 1st 2nd 3.13e- 7 9.38e- 7 **** +#> 2 1st 3rd 2.55e-30 1.27e-29 **** +#> 3 2nd 3rd 6.9 e- 7 1.38e- 6 **** +#> 4 1st Crew 1.62e-35 9.73e-35 **** +#> 5 2nd Crew 1.94e- 8 7.75e- 8 **** +#> 6 3rd Crew 6.03e- 1 6.03e- 1 ns
    @@ -166,17 +166,17 @@

    Examp #> success 2 5 10 #> failure 8 5 0

    # Compare the proportion of success between treatments -cochran_qtest(mydata, outcome ~ treatment|participant)
    #> # A tibble: 1 x 6 +cochran_qtest(mydata, outcome ~ treatment|participant)
    #> # A tibble: 1 x 6 #> .y. n statistic df p method -#> * <chr> <int> <dbl> <dbl> <dbl> <chr> -#> 1 outcome 10 10.9 2 0.00432 Cochran's Q test
    +#> * <chr> <int> <dbl> <dbl> <dbl> <chr> +#> 1 outcome 10 10.9 2 0.00432 Cochran's Q test
    # pairwise comparisons between groups -pairwise_mcnemar_test(mydata, outcome ~ treatment|participant)
    #> # A tibble: 3 x 6 +pairwise_mcnemar_test(mydata, outcome ~ treatment|participant)
    #> # A tibble: 3 x 6 #> group1 group2 p p.adj p.adj.signif method -#> * <chr> <chr> <dbl> <dbl> <chr> <chr> -#> 1 A B 0.371 1 ns McNemar test -#> 2 A C 0.0133 0.0399 * McNemar test -#> 3 B C 0.0736 0.221 ns McNemar test
    +#> * <chr> <chr> <dbl> <dbl> <chr> <chr> +#> 1 A B 0.371 1 ns McNemar test +#> 2 A C 0.0133 0.0399 * McNemar test +#> 3 B C 0.0736 0.221 ns McNemar test
    @@ -267,15 +267,15 @@

    R

    Examples

    # One-sample t test effect size -ToothGrowth %>% cohens_d(len ~ 1, mu = 0)
    #> # A tibble: 1 x 6 +ToothGrowth %>% cohens_d(len ~ 1, mu = 0)
    #> # A tibble: 1 x 6 #> .y. group1 group2 effsize n magnitude -#> * <chr> <chr> <chr> <dbl> <int> <ord> -#> 1 len 1 null model 2.46 60 large
    +#> * <chr> <chr> <chr> <dbl> <int> <ord> +#> 1 len 1 null model 2.46 60 large
    # Two indepedent samples t-test effect size -ToothGrowth %>% cohens_d(len ~ supp, var.equal = TRUE)
    #> # A tibble: 1 x 7 +ToothGrowth %>% cohens_d(len ~ supp, var.equal = TRUE)
    #> # A tibble: 1 x 7 #> .y. group1 group2 effsize n1 n2 magnitude -#> * <chr> <chr> <chr> <dbl> <int> <int> <ord> -#> 1 len OJ VC 0.495 30 30 small
    +#> * <chr> <chr> <chr> <dbl> <int> <int> <ord> +#> 1 len OJ VC 0.495 30 30 small
    # Paired samples effect size df <- data.frame( id = 1:5, @@ -290,10 +290,10 @@

    Examp #> 4 4 pre 120 #> 5 5 pre 140 #> 6 1 post 150

    -df %>% cohens_d(value ~ treatment, paired = TRUE)
    #> # A tibble: 1 x 7 +df %>% cohens_d(value ~ treatment, paired = TRUE)
    #> # A tibble: 1 x 7 #> .y. group1 group2 effsize n1 n2 magnitude -#> * <chr> <chr> <chr> <dbl> <int> <int> <ord> -#> 1 value post pre 1.75 5 5 large
    +#> * <chr> <chr> <chr> <dbl> <int> <int> <ord> +#> 1 value post pre 1.75 5 5 large diff --git a/docs/reference/cor_mark_significant.html b/docs/reference/cor_mark_significant.html index 25414c6..4d664e2 100644 --- a/docs/reference/cor_mark_significant.html +++ b/docs/reference/cor_mark_significant.html @@ -75,7 +75,7 @@ rstatix - 0.7.0 + 0.7.1 diff --git a/docs/reference/cor_mat-1.png b/docs/reference/cor_mat-1.png index 5ca8caf..dadb1d4 100644 Binary files a/docs/reference/cor_mat-1.png and b/docs/reference/cor_mat-1.png differ diff --git a/docs/reference/cor_mat.html b/docs/reference/cor_mat.html index 77eb518..522c3ad 100644 --- a/docs/reference/cor_mat.html +++ b/docs/reference/cor_mat.html @@ -76,7 +76,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -201,7 +201,7 @@

    Fun test p-values.

  • cor_pmat: compute the correlation matrix but returns only the p-values of the tests.

  • cor_get_pval: extract a correlation matrix p-values from an object of -class cor_mat().

  • +class cor_mat(). P-values are not adjusted.

    See also

    @@ -223,42 +223,42 @@

    Examp #:::::::::::::::::::::::::::::::::::::::::: # Correlation matrix between all variables cor.mat <- mydata %>% cor_mat() -cor.mat
    #> # A tibble: 6 x 7 +cor.mat
    #> # A tibble: 6 x 7 #> rowname mpg disp hp drat wt qsec -#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 -#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 -#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 -#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 -#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 -#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    +#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 +#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 +#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 +#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 +#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 +#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    # Specify some variables of interest -mydata %>% cor_mat(mpg, hp, wt)
    #> # A tibble: 3 x 4 +mydata %>% cor_mat(mpg, hp, wt)
    #> # A tibble: 3 x 4 #> rowname mpg hp wt -#> * <chr> <dbl> <dbl> <dbl> -#> 1 mpg 1 -0.78 -0.87 -#> 2 hp -0.78 1 0.66 -#> 3 wt -0.87 0.66 1
    +#> * <chr> <dbl> <dbl> <dbl> +#> 1 mpg 1 -0.78 -0.87 +#> 2 hp -0.78 1 0.66 +#> 3 wt -0.87 0.66 1
    # Or remove some variables in the data # before the analysis -mydata %>% cor_mat(-mpg, -hp)
    #> # A tibble: 4 x 5 +mydata %>% cor_mat(-mpg, -hp)
    #> # A tibble: 4 x 5 #> rowname disp drat wt qsec -#> * <chr> <dbl> <dbl> <dbl> <dbl> -#> 1 disp 1 -0.71 0.89 -0.43 -#> 2 drat -0.71 1 -0.71 0.091 -#> 3 wt 0.89 -0.71 1 -0.17 -#> 4 qsec -0.43 0.091 -0.17 1
    +#> * <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 disp 1 -0.71 0.89 -0.43 +#> 2 drat -0.71 1 -0.71 0.091 +#> 3 wt 0.89 -0.71 1 -0.17 +#> 4 qsec -0.43 0.091 -0.17 1
    # Significance levels #:::::::::::::::::::::::::::::::::::::::::: -cor.mat %>% cor_get_pval()
    #> # A tibble: 6 x 7 +cor.mat %>% cor_get_pval()
    #> # A tibble: 6 x 7 #> rowname mpg disp hp drat wt qsec -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mpg 0. 9.38e-10 0.000000179 0.0000178 1.29e- 10 0.0171 -#> 2 disp 9.38e-10 0. 0.0000000714 0.00000528 1.22e- 11 0.0131 -#> 3 hp 1.79e- 7 7.14e- 8 0 0.00999 4.15e- 5 0.00000577 -#> 4 drat 1.78e- 5 5.28e- 6 0.00999 0 4.78e- 6 0.62 -#> 5 wt 1.29e-10 1.22e-11 0.0000415 0.00000478 2.27e-236 0.339 -#> 6 qsec 1.71e- 2 1.31e- 2 0.00000577 0.62 3.39e- 1 0
    +#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 mpg 0 9.38e-10 0.000000179 0.0000178 1.29e- 10 0.0171 +#> 2 disp 9.38e-10 0 0.0000000714 0.00000528 1.22e- 11 0.0131 +#> 3 hp 1.79e- 7 7.14e- 8 0 0.00999 4.15e- 5 0.00000577 +#> 4 drat 1.78e- 5 5.28e- 6 0.00999 0 4.78e- 6 0.62 +#> 5 wt 1.29e-10 1.22e-11 0.0000415 0.00000478 2.27e-236 0.339 +#> 6 qsec 1.71e- 2 1.31e- 2 0.00000577 0.62 3.39e- 1 0
    # Visualize #:::::::::::::::::::::::::::::::::::::::::: @@ -269,20 +269,20 @@

    Examp cor_plot(label = TRUE)

    # Gather/collapse correlation matrix into long format #:::::::::::::::::::::::::::::::::::::::::: -cor.mat %>% cor_gather()
    #> # A tibble: 36 x 4 +cor.mat %>% cor_gather()
    #> # A tibble: 36 x 4 #> var1 var2 cor p -#> <chr> <chr> <dbl> <dbl> -#> 1 mpg mpg 1 0. -#> 2 disp mpg -0.85 9.38e-10 -#> 3 hp mpg -0.78 1.79e- 7 -#> 4 drat mpg 0.68 1.78e- 5 -#> 5 wt mpg -0.87 1.29e-10 -#> 6 qsec mpg 0.42 1.71e- 2 -#> 7 mpg disp -0.85 9.38e-10 -#> 8 disp disp 1 0. -#> 9 hp disp 0.79 7.14e- 8 -#> 10 drat disp -0.71 5.28e- 6 -#> # … with 26 more rows
    +#> <chr> <chr> <dbl> <dbl> +#> 1 mpg mpg 1 0 +#> 2 disp mpg -0.85 9.38e-10 +#> 3 hp mpg -0.78 1.79e- 7 +#> 4 drat mpg 0.68 1.78e- 5 +#> 5 wt mpg -0.87 1.29e-10 +#> 6 qsec mpg 0.42 1.71e- 2 +#> 7 mpg disp -0.85 9.38e-10 +#> 8 disp disp 1 0 +#> 9 hp disp 0.79 7.14e- 8 +#> 10 drat disp -0.71 5.28e- 6 +#> # … with 26 more rows
    diff --git a/docs/reference/cor_plot-1.png b/docs/reference/cor_plot-1.png index af88b7d..d78237b 100644 Binary files a/docs/reference/cor_plot-1.png and b/docs/reference/cor_plot-1.png differ diff --git a/docs/reference/cor_plot-2.png b/docs/reference/cor_plot-2.png index 959f6c1..142756a 100644 Binary files a/docs/reference/cor_plot-2.png and b/docs/reference/cor_plot-2.png differ diff --git a/docs/reference/cor_plot-3.png b/docs/reference/cor_plot-3.png index 1f0fc4b..7bdac3c 100644 Binary files a/docs/reference/cor_plot-3.png and b/docs/reference/cor_plot-3.png differ diff --git a/docs/reference/cor_plot-4.png b/docs/reference/cor_plot-4.png index ac9c285..f45c80f 100644 Binary files a/docs/reference/cor_plot-4.png and b/docs/reference/cor_plot-4.png differ diff --git a/docs/reference/cor_plot-5.png b/docs/reference/cor_plot-5.png index 634e0c6..1e709ab 100644 Binary files a/docs/reference/cor_plot-5.png and b/docs/reference/cor_plot-5.png differ diff --git a/docs/reference/cor_plot-6.png b/docs/reference/cor_plot-6.png index 89b1a51..36f4cc4 100644 Binary files a/docs/reference/cor_plot-6.png and b/docs/reference/cor_plot-6.png differ diff --git a/docs/reference/cor_plot-7.png b/docs/reference/cor_plot-7.png index be7be11..c1a9b25 100644 Binary files a/docs/reference/cor_plot-7.png and b/docs/reference/cor_plot-7.png differ diff --git a/docs/reference/cor_plot-8.png b/docs/reference/cor_plot-8.png index b2ddb76..5e3846f 100644 Binary files a/docs/reference/cor_plot-8.png and b/docs/reference/cor_plot-8.png differ diff --git a/docs/reference/cor_plot.html b/docs/reference/cor_plot.html index 71ce9ec..ca17ba4 100644 --- a/docs/reference/cor_plot.html +++ b/docs/reference/cor_plot.html @@ -82,7 +82,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -147,7 +147,8 @@

    Visualize Correlation Matrix Using Base Plot

    significant.level = 0.05, insignificant = c("cross", "blank"), label = FALSE, - font.label = list() + font.label = list(), + ... )

    Arguments

    @@ -207,6 +208,10 @@

    Arg customize the correlation coefficient labels. For example font.label = list(size = 1, color = "black", style = "bold").

    + + ... +

    additional options not listed (i.e. "tl.cex") here to pass to corrplot.

    +

    See also

    diff --git a/docs/reference/cor_reorder.html b/docs/reference/cor_reorder.html index 444dd2d..4384278 100644 --- a/docs/reference/cor_reorder.html +++ b/docs/reference/cor_reorder.html @@ -75,7 +75,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -153,26 +153,26 @@

    Examp #:::::::::::::::::::::::::::::::::::::::::: # Reorder cor.mat %>% - cor_reorder()
    #> # A tibble: 6 x 7 + cor_reorder()
    #> # A tibble: 6 x 7 #> rowname hp disp wt qsec mpg drat -#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 hp 1 0.79 0.66 -0.71 -0.78 -0.45 -#> 2 disp 0.79 1 0.89 -0.43 -0.85 -0.71 -#> 3 wt 0.66 0.89 1 -0.17 -0.87 -0.71 -#> 4 qsec -0.71 -0.43 -0.17 1 0.42 0.091 -#> 5 mpg -0.78 -0.85 -0.87 0.42 1 0.68 -#> 6 drat -0.45 -0.71 -0.71 0.091 0.68 1
    # Get p-values of the reordered cor_mat +#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 hp 1 0.79 0.66 -0.71 -0.78 -0.45 +#> 2 disp 0.79 1 0.89 -0.43 -0.85 -0.71 +#> 3 wt 0.66 0.89 1 -0.17 -0.87 -0.71 +#> 4 qsec -0.71 -0.43 -0.17 1 0.42 0.091 +#> 5 mpg -0.78 -0.85 -0.87 0.42 1 0.68 +#> 6 drat -0.45 -0.71 -0.71 0.091 0.68 1
    # Get p-values of the reordered cor_mat cor.mat %>% cor_reorder() %>% - cor_get_pval()
    #> # A tibble: 6 x 7 + cor_get_pval()
    #> # A tibble: 6 x 7 #> rowname hp disp wt qsec mpg drat -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 hp 0 7.14e- 8 4.15e- 5 0.00000577 1.79e- 7 0.00999 -#> 2 disp 0.0000000714 0. 1.22e- 11 0.0131 9.38e-10 0.00000528 -#> 3 wt 0.0000415 1.22e-11 2.27e-236 0.339 1.29e-10 0.00000478 -#> 4 qsec 0.00000577 1.31e- 2 3.39e- 1 0 1.71e- 2 0.62 -#> 5 mpg 0.000000179 9.38e-10 1.29e- 10 0.0171 0. 0.0000178 -#> 6 drat 0.00999 5.28e- 6 4.78e- 6 0.62 1.78e- 5 0
    +#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 hp 0 7.14e- 8 4.15e- 5 0.00000577 1.79e- 7 0.00999 +#> 2 disp 0.0000000714 0 1.22e- 11 0.0131 9.38e-10 0.00000528 +#> 3 wt 0.0000415 1.22e-11 2.27e-236 0.339 1.29e-10 0.00000478 +#> 4 qsec 0.00000577 1.31e- 2 3.39e- 1 0 1.71e- 2 0.62 +#> 5 mpg 0.000000179 9.38e-10 1.29e- 10 0.0171 0 0.0000178 +#> 6 drat 0.00999 5.28e- 6 4.78e- 6 0.62 1.78e- 5 0
    @@ -184,53 +184,53 @@

    Examp #:::::::::::::::::::::::::::::::::::::::::: # Compute a correlation matrix cor.mat <- mydata %>% cor_mat() -cor.mat
    #> # A tibble: 6 x 7 +cor.mat
    #> # A tibble: 6 x 7 #> rowname mpg disp hp drat wt qsec -#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 -#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 -#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 -#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 -#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 -#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    +#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 +#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 +#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 +#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 +#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 +#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    # Collapse the correlation matrix into long format # paired list data frame long.format <- cor.mat %>% cor_gather() -long.format
    #> # A tibble: 36 x 4 +long.format
    #> # A tibble: 36 x 4 #> var1 var2 cor p -#> <chr> <chr> <dbl> <dbl> -#> 1 mpg mpg 1 0. -#> 2 disp mpg -0.85 9.38e-10 -#> 3 hp mpg -0.78 1.79e- 7 -#> 4 drat mpg 0.68 1.78e- 5 -#> 5 wt mpg -0.87 1.29e-10 -#> 6 qsec mpg 0.42 1.71e- 2 -#> 7 mpg disp -0.85 9.38e-10 -#> 8 disp disp 1 0. -#> 9 hp disp 0.79 7.14e- 8 -#> 10 drat disp -0.71 5.28e- 6 -#> # … with 26 more rows
    +#> <chr> <chr> <dbl> <dbl> +#> 1 mpg mpg 1 0 +#> 2 disp mpg -0.85 9.38e-10 +#> 3 hp mpg -0.78 1.79e- 7 +#> 4 drat mpg 0.68 1.78e- 5 +#> 5 wt mpg -0.87 1.29e-10 +#> 6 qsec mpg 0.42 1.71e- 2 +#> 7 mpg disp -0.85 9.38e-10 +#> 8 disp disp 1 0 +#> 9 hp disp 0.79 7.14e- 8 +#> 10 drat disp -0.71 5.28e- 6 +#> # … with 26 more rows
    # Spread a correlation data format #:::::::::::::::::::::::::::::::::::::::::: # Spread the correlation coefficient value -long.format %>% cor_spread(value = "cor")
    #> # A tibble: 6 x 7 +long.format %>% cor_spread(value = "cor")
    #> # A tibble: 6 x 7 #> rowname mpg disp hp drat wt qsec -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 -#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 -#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 -#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 -#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 -#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    # Spread the p-value -long.format %>% cor_spread(value = "p")
    #> # A tibble: 6 x 7 +#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 +#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 +#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 +#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 +#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 +#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    # Spread the p-value +long.format %>% cor_spread(value = "p")
    #> # A tibble: 6 x 7 #> rowname mpg disp hp drat wt qsec -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mpg 0. 9.38e-10 0.000000179 0.0000178 1.29e- 10 0.0171 -#> 2 disp 9.38e-10 0. 0.0000000714 0.00000528 1.22e- 11 0.0131 -#> 3 hp 1.79e- 7 7.14e- 8 0 0.00999 4.15e- 5 0.00000577 -#> 4 drat 1.78e- 5 5.28e- 6 0.00999 0 4.78e- 6 0.62 -#> 5 wt 1.29e-10 1.22e-11 0.0000415 0.00000478 2.27e-236 0.339 -#> 6 qsec 1.71e- 2 1.31e- 2 0.00000577 0.62 3.39e- 1 0
    +#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 mpg 0 9.38e-10 0.000000179 0.0000178 1.29e- 10 0.0171 +#> 2 disp 9.38e-10 0 0.0000000714 0.00000528 1.22e- 11 0.0131 +#> 3 hp 1.79e- 7 7.14e- 8 0 0.00999 4.15e- 5 0.00000577 +#> 4 drat 1.78e- 5 5.28e- 6 0.00999 0 4.78e- 6 0.62 +#> 5 wt 1.29e-10 1.22e-11 0.0000415 0.00000478 2.27e-236 0.339 +#> 6 qsec 1.71e- 2 1.31e- 2 0.00000577 0.62 3.39e- 1 0 @@ -161,21 +161,21 @@

    Examp # Select some variables of interest cor.mat %>% - cor_select(mpg, drat, wt)
    #> # A tibble: 3 x 4 + cor_select(mpg, drat, wt)
    #> # A tibble: 3 x 4 #> rowname mpg drat wt -#> <chr> <dbl> <dbl> <dbl> -#> 1 mpg 1 0.68 -0.87 -#> 2 drat 0.68 1 -0.71 -#> 3 wt -0.87 -0.71 1
    +#> <chr> <dbl> <dbl> <dbl> +#> 1 mpg 1 0.68 -0.87 +#> 2 drat 0.68 1 -0.71 +#> 3 wt -0.87 -0.71 1
    # Remove variables cor.mat %>% - cor_select(-mpg, -wt)
    #> # A tibble: 4 x 5 + cor_select(-mpg, -wt)
    #> # A tibble: 4 x 5 #> rowname disp hp drat qsec -#> <chr> <dbl> <dbl> <dbl> <dbl> -#> 1 disp 1 0.79 -0.71 -0.43 -#> 2 hp 0.79 1 -0.45 -0.71 -#> 3 drat -0.71 -0.45 1 0.091 -#> 4 qsec -0.43 -0.71 0.091 1
    +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 disp 1 0.79 -0.71 -0.43 +#> 2 hp 0.79 1 -0.45 -0.71 +#> 3 drat -0.71 -0.45 1 0.091 +#> 4 qsec -0.43 -0.71 0.091 1
    @@ -239,75 +239,75 @@

    Examp # Correlation between the specified variable vs # the remaining numeric variables in the data #::::::::::::::::::::::::::::::::::::::::: -mtcars %>% cor_test(mpg)
    #> # A tibble: 10 x 8 +mtcars %>% cor_test(mpg)
    #> # A tibble: 10 x 8 #> var1 var2 cor statistic p conf.low conf.high method -#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 mpg cyl -0.85 -8.92 6.11e-10 -0.926 -0.716 Pearson -#> 2 mpg disp -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson -#> 3 mpg hp -0.78 -6.74 1.79e- 7 -0.885 -0.586 Pearson -#> 4 mpg drat 0.68 5.10 1.78e- 5 0.436 0.832 Pearson -#> 5 mpg wt -0.87 -9.56 1.29e-10 -0.934 -0.744 Pearson -#> 6 mpg qsec 0.42 2.53 1.71e- 2 0.0820 0.670 Pearson -#> 7 mpg vs 0.66 4.86 3.42e- 5 0.410 0.822 Pearson -#> 8 mpg am 0.6 4.11 2.85e- 4 0.318 0.784 Pearson -#> 9 mpg gear 0.48 3.00 5.40e- 3 0.158 0.710 Pearson -#> 10 mpg carb -0.55 -3.62 1.08e- 3 -0.755 -0.250 Pearson
    +#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 mpg cyl -0.85 -8.92 6.11e-10 -0.926 -0.716 Pearson +#> 2 mpg disp -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson +#> 3 mpg hp -0.78 -6.74 1.79e- 7 -0.885 -0.586 Pearson +#> 4 mpg drat 0.68 5.10 1.78e- 5 0.436 0.832 Pearson +#> 5 mpg wt -0.87 -9.56 1.29e-10 -0.934 -0.744 Pearson +#> 6 mpg qsec 0.42 2.53 1.71e- 2 0.0820 0.670 Pearson +#> 7 mpg vs 0.66 4.86 3.42e- 5 0.410 0.822 Pearson +#> 8 mpg am 0.6 4.11 2.85e- 4 0.318 0.784 Pearson +#> 9 mpg gear 0.48 3.00 5.4 e- 3 0.158 0.710 Pearson +#> 10 mpg carb -0.55 -3.62 1.08e- 3 -0.755 -0.250 Pearson
    # Correlation test between two variables #::::::::::::::::::::::::::::::::::::::::: -mtcars %>% cor_test(wt, mpg)
    #> # A tibble: 1 x 8 +mtcars %>% cor_test(wt, mpg)
    #> # A tibble: 1 x 8 #> var1 var2 cor statistic p conf.low conf.high method -#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 wt mpg -0.87 -9.56 1.29e-10 -0.934 -0.744 Pearson
    +#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 wt mpg -0.87 -9.56 1.29e-10 -0.934 -0.744 Pearson
    # Pairwise correlation between multiple variables #::::::::::::::::::::::::::::::::::::::::: -mtcars %>% cor_test(wt, mpg, disp)
    #> # A tibble: 9 x 8 +mtcars %>% cor_test(wt, mpg, disp)
    #> # A tibble: 9 x 8 #> var1 var2 cor statistic p conf.low conf.high method -#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 wt wt 1 367570386. 2.27e-236 1.00 1 Pearson -#> 2 wt mpg -0.87 -9.56 1.29e- 10 -0.934 -0.744 Pearson -#> 3 wt disp 0.89 10.6 1.22e- 11 0.781 0.944 Pearson -#> 4 mpg wt -0.87 -9.56 1.29e- 10 -0.934 -0.744 Pearson -#> 5 mpg mpg 1 Inf 0. 1 1 Pearson -#> 6 mpg disp -0.85 -8.75 9.38e- 10 -0.923 -0.708 Pearson -#> 7 disp wt 0.89 10.6 1.22e- 11 0.781 0.944 Pearson -#> 8 disp mpg -0.85 -8.75 9.38e- 10 -0.923 -0.708 Pearson -#> 9 disp disp 1 Inf 0. 1 1 Pearson
    +#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 wt wt 1 367570386. 2.27e-236 1 1 Pearson +#> 2 wt mpg -0.87 -9.56 1.29e- 10 -0.934 -0.744 Pearson +#> 3 wt disp 0.89 10.6 1.22e- 11 0.781 0.944 Pearson +#> 4 mpg wt -0.87 -9.56 1.29e- 10 -0.934 -0.744 Pearson +#> 5 mpg mpg 1 Inf 0 1 1 Pearson +#> 6 mpg disp -0.85 -8.75 9.38e- 10 -0.923 -0.708 Pearson +#> 7 disp wt 0.89 10.6 1.22e- 11 0.781 0.944 Pearson +#> 8 disp mpg -0.85 -8.75 9.38e- 10 -0.923 -0.708 Pearson +#> 9 disp disp 1 Inf 0 1 1 Pearson
    # Grouped data #::::::::::::::::::::::::::::::::::::::::: iris %>% group_by(Species) %>% - cor_test(Sepal.Width, Sepal.Length)
    #> # A tibble: 3 x 9 + cor_test(Sepal.Width, Sepal.Length)
    #> # A tibble: 3 x 9 #> Species var1 var2 cor statistic p conf.low conf.high method -#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 setosa Sepal.W… Sepal.L… 0.74 7.68 6.71e-10 0.585 0.846 Pears… -#> 2 versicol… Sepal.W… Sepal.L… 0.53 4.28 8.77e- 5 0.290 0.702 Pears… -#> 3 virginica Sepal.W… Sepal.L… 0.46 3.56 8.43e- 4 0.205 0.653 Pears…
    +#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 setosa Sepal.W… Sepal.L… 0.74 7.68 6.71e-10 0.585 0.846 Pears… +#> 2 versicol… Sepal.W… Sepal.L… 0.53 4.28 8.77e- 5 0.290 0.702 Pears… +#> 3 virginica Sepal.W… Sepal.L… 0.46 3.56 8.43e- 4 0.205 0.653 Pears…
    # Multiple correlation test #::::::::::::::::::::::::::::::::::::::::: # Correlation between one variable vs many mtcars %>% cor_test( vars = "mpg", vars2 = c("disp", "hp", "drat") - )
    #> # A tibble: 3 x 8 + )
    #> # A tibble: 3 x 8 #> var1 var2 cor statistic p conf.low conf.high method -#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 mpg disp -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson -#> 2 mpg hp -0.78 -6.74 1.79e- 7 -0.885 -0.586 Pearson -#> 3 mpg drat 0.68 5.10 1.78e- 5 0.436 0.832 Pearson
    +#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 mpg disp -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson +#> 2 mpg hp -0.78 -6.74 1.79e- 7 -0.885 -0.586 Pearson +#> 3 mpg drat 0.68 5.10 1.78e- 5 0.436 0.832 Pearson
    # Correlation between two vectors of variables # Each element in vars is tested against all elements in vars2 mtcars %>% cor_test( vars = c("mpg", "wt"), vars2 = c("disp", "hp", "drat") - )
    #> # A tibble: 6 x 8 + )
    #> # A tibble: 6 x 8 #> var1 var2 cor statistic p conf.low conf.high method -#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 mpg disp -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson -#> 2 mpg hp -0.78 -6.74 1.79e- 7 -0.885 -0.586 Pearson -#> 3 mpg drat 0.68 5.10 1.78e- 5 0.436 0.832 Pearson -#> 4 wt disp 0.89 10.6 1.22e-11 0.781 0.944 Pearson -#> 5 wt hp 0.66 4.80 4.15e- 5 0.403 0.819 Pearson -#> 6 wt drat -0.71 -5.56 4.78e- 6 -0.850 -0.484 Pearson
    +#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 mpg disp -0.85 -8.75 9.38e-10 -0.923 -0.708 Pearson +#> 2 mpg hp -0.78 -6.74 1.79e- 7 -0.885 -0.586 Pearson +#> 3 mpg drat 0.68 5.10 1.78e- 5 0.436 0.832 Pearson +#> 4 wt disp 0.89 10.6 1.22e-11 0.781 0.944 Pearson +#> 5 wt hp 0.66 4.80 4.15e- 5 0.403 0.819 Pearson +#> 6 wt drat -0.71 -5.56 4.78e- 6 -0.850 -0.484 Pearson
    diff --git a/docs/reference/counts_to_cases.html b/docs/reference/counts_to_cases.html index 1dc0a8e..f18a4ad 100644 --- a/docs/reference/counts_to_cases.html +++ b/docs/reference/counts_to_cases.html @@ -75,7 +75,7 @@ rstatix - 0.7.0 + 0.7.1 diff --git a/docs/reference/cramer_v.html b/docs/reference/cramer_v.html index 0b6f08b..f518894 100644 --- a/docs/reference/cramer_v.html +++ b/docs/reference/cramer_v.html @@ -75,7 +75,7 @@ rstatix - 0.7.0 + 0.7.1 diff --git a/docs/reference/df_arrange.html b/docs/reference/df_arrange.html index db38906..12c1836 100644 --- a/docs/reference/df_arrange.html +++ b/docs/reference/df_arrange.html @@ -76,7 +76,7 @@ rstatix - 0.7.0 + 0.7.1 diff --git a/docs/reference/df_get_var_names.html b/docs/reference/df_get_var_names.html index 45e5ffc..b08bea3 100644 --- a/docs/reference/df_get_var_names.html +++ b/docs/reference/df_get_var_names.html @@ -74,7 +74,7 @@ rstatix - 0.7.0 + 0.7.1 diff --git a/docs/reference/df_group_by.html b/docs/reference/df_group_by.html index ecddc02..4518cb6 100644 --- a/docs/reference/df_group_by.html +++ b/docs/reference/df_group_by.html @@ -75,7 +75,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -150,28 +150,28 @@

    Examp # Non standard evaluation by_dose <- head(ToothGrowth) %>% df_group_by(dose) -by_dose
    #> # A tibble: 6 x 3 -#> # Groups: dose [1] +by_dose
    #> # A tibble: 6 x 3 +#> # Groups: dose [1] #> len supp dose -#> <dbl> <fct> <dbl> -#> 1 4.2 VC 0.5 -#> 2 11.5 VC 0.5 -#> 3 7.3 VC 0.5 -#> 4 5.8 VC 0.5 -#> 5 6.4 VC 0.5 -#> 6 10 VC 0.5
    +#> <dbl> <fct> <dbl> +#> 1 4.2 VC 0.5 +#> 2 11.5 VC 0.5 +#> 3 7.3 VC 0.5 +#> 4 5.8 VC 0.5 +#> 5 6.4 VC 0.5 +#> 6 10 VC 0.5
    # Standard evaluation head(ToothGrowth) %>% - df_group_by(vars = c("dose", "supp"))
    #> # A tibble: 6 x 3 -#> # Groups: dose, supp [1] + df_group_by(vars = c("dose", "supp"))
    #> # A tibble: 6 x 3 +#> # Groups: dose, supp [1] #> len supp dose -#> <dbl> <fct> <dbl> -#> 1 4.2 VC 0.5 -#> 2 11.5 VC 0.5 -#> 3 7.3 VC 0.5 -#> 4 5.8 VC 0.5 -#> 5 6.4 VC 0.5 -#> 6 10 VC 0.5
    +#> <dbl> <fct> <dbl> +#> 1 4.2 VC 0.5 +#> 2 11.5 VC 0.5 +#> 3 7.3 VC 0.5 +#> 4 5.8 VC 0.5 +#> 5 6.4 VC 0.5 +#> 6 10 VC 0.5 @@ -194,15 +194,15 @@

    Examp # Nesting the data then label each subset by groups ToothGrowth %>% df_nest_by(dose, supp) %>% - df_label_both(supp, dose)
    #> # A tibble: 6 x 4 + df_label_both(supp, dose)
    #> # A tibble: 6 x 4 #> supp dose data label -#> <fct> <dbl> <list> <fct> -#> 1 VC 0.5 <tibble [10 × 1]> supp:OJ, dose:0.5 -#> 2 VC 1 <tibble [10 × 1]> supp:OJ, dose:1 -#> 3 VC 2 <tibble [10 × 1]> supp:OJ, dose:2 -#> 4 OJ 0.5 <tibble [10 × 1]> supp:VC, dose:0.5 -#> 5 OJ 1 <tibble [10 × 1]> supp:VC, dose:1 -#> 6 OJ 2 <tibble [10 × 1]> supp:VC, dose:2
    +#> <fct> <dbl> <list> <fct> +#> 1 VC 0.5 <tibble [10 × 1]> supp:OJ, dose:0.5 +#> 2 VC 1 <tibble [10 × 1]> supp:OJ, dose:1 +#> 3 VC 2 <tibble [10 × 1]> supp:OJ, dose:2 +#> 4 OJ 0.5 <tibble [10 × 1]> supp:VC, dose:0.5 +#> 5 OJ 1 <tibble [10 × 1]> supp:VC, dose:1 +#> 6 OJ 2 <tibble [10 × 1]> supp:VC, dose:2
    @@ -152,26 +152,26 @@

    Examp
    # Non standard evaluation ToothGrowth %>% - df_nest_by(dose, supp)
    #> # A tibble: 6 x 3 + df_nest_by(dose, supp)
    #> # A tibble: 6 x 3 #> supp dose data -#> <fct> <dbl> <list> -#> 1 VC 0.5 <tibble [10 × 1]> -#> 2 VC 1 <tibble [10 × 1]> -#> 3 VC 2 <tibble [10 × 1]> -#> 4 OJ 0.5 <tibble [10 × 1]> -#> 5 OJ 1 <tibble [10 × 1]> -#> 6 OJ 2 <tibble [10 × 1]>
    +#> <fct> <dbl> <list> +#> 1 VC 0.5 <tibble [10 × 1]> +#> 2 VC 1 <tibble [10 × 1]> +#> 3 VC 2 <tibble [10 × 1]> +#> 4 OJ 0.5 <tibble [10 × 1]> +#> 5 OJ 1 <tibble [10 × 1]> +#> 6 OJ 2 <tibble [10 × 1]>
    # Standard evaluation ToothGrowth %>% - df_nest_by(vars = c("dose", "supp"))
    #> # A tibble: 6 x 3 + df_nest_by(vars = c("dose", "supp"))
    #> # A tibble: 6 x 3 #> supp dose data -#> <fct> <dbl> <list> -#> 1 VC 0.5 <tibble [10 × 1]> -#> 2 VC 1 <tibble [10 × 1]> -#> 3 VC 2 <tibble [10 × 1]> -#> 4 OJ 0.5 <tibble [10 × 1]> -#> 5 OJ 1 <tibble [10 × 1]> -#> 6 OJ 2 <tibble [10 × 1]>
    +#> <fct> <dbl> <list> +#> 1 VC 0.5 <tibble [10 × 1]> +#> 2 VC 1 <tibble [10 × 1]> +#> 3 VC 2 <tibble [10 × 1]> +#> 4 OJ 0.5 <tibble [10 × 1]> +#> 5 OJ 1 <tibble [10 × 1]> +#> 6 OJ 2 <tibble [10 × 1]>
    diff --git a/docs/reference/df_split_by.html b/docs/reference/df_split_by.html index f8d44f0..f475e53 100644 --- a/docs/reference/df_split_by.html +++ b/docs/reference/df_split_by.html @@ -77,7 +77,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -188,118 +188,118 @@

    Examp # Create a grouped data res <- ToothGrowth %>% df_split_by(dose, supp) -res
    #> # A tibble: 6 x 4 +res
    #> # A tibble: 6 x 4 #> supp dose data label -#> <fct> <dbl> <list> <fct> -#> 1 VC 0.5 <tibble [10 × 2]> dose:0.5, supp:OJ -#> 2 VC 1 <tibble [10 × 2]> dose:0.5, supp:VC -#> 3 VC 2 <tibble [10 × 2]> dose:1, supp:OJ -#> 4 OJ 0.5 <tibble [10 × 2]> dose:1, supp:VC -#> 5 OJ 1 <tibble [10 × 2]> dose:2, supp:OJ -#> 6 OJ 2 <tibble [10 × 2]> dose:2, supp:VC
    +#> <fct> <dbl> <list> <fct> +#> 1 VC 0.5 <tibble [10 × 2]> dose:0.5, supp:OJ +#> 2 VC 1 <tibble [10 × 2]> dose:0.5, supp:VC +#> 3 VC 2 <tibble [10 × 2]> dose:1, supp:OJ +#> 4 OJ 0.5 <tibble [10 × 2]> dose:1, supp:VC +#> 5 OJ 1 <tibble [10 × 2]> dose:2, supp:OJ +#> 6 OJ 2 <tibble [10 × 2]> dose:2, supp:VC
    # Show subsets res$data
    #> [[1]] -#> # A tibble: 10 x 2 +#> # A tibble: 10 x 2 #> len label -#> <dbl> <fct> -#> 1 4.2 dose:0.5, supp:OJ -#> 2 11.5 dose:0.5, supp:OJ -#> 3 7.3 dose:0.5, supp:OJ -#> 4 5.8 dose:0.5, supp:OJ -#> 5 6.4 dose:0.5, supp:OJ -#> 6 10 dose:0.5, supp:OJ -#> 7 11.2 dose:0.5, supp:OJ -#> 8 11.2 dose:0.5, supp:OJ -#> 9 5.2 dose:0.5, supp:OJ -#> 10 7 dose:0.5, supp:OJ +#> <dbl> <fct> +#> 1 4.2 dose:0.5, supp:OJ +#> 2 11.5 dose:0.5, supp:OJ +#> 3 7.3 dose:0.5, supp:OJ +#> 4 5.8 dose:0.5, supp:OJ +#> 5 6.4 dose:0.5, supp:OJ +#> 6 10 dose:0.5, supp:OJ +#> 7 11.2 dose:0.5, supp:OJ +#> 8 11.2 dose:0.5, supp:OJ +#> 9 5.2 dose:0.5, supp:OJ +#> 10 7 dose:0.5, supp:OJ #> #> [[2]] -#> # A tibble: 10 x 2 +#> # A tibble: 10 x 2 #> len label -#> <dbl> <fct> -#> 1 16.5 dose:0.5, supp:VC -#> 2 16.5 dose:0.5, supp:VC -#> 3 15.2 dose:0.5, supp:VC -#> 4 17.3 dose:0.5, supp:VC -#> 5 22.5 dose:0.5, supp:VC -#> 6 17.3 dose:0.5, supp:VC -#> 7 13.6 dose:0.5, supp:VC -#> 8 14.5 dose:0.5, supp:VC -#> 9 18.8 dose:0.5, supp:VC -#> 10 15.5 dose:0.5, supp:VC +#> <dbl> <fct> +#> 1 16.5 dose:0.5, supp:VC +#> 2 16.5 dose:0.5, supp:VC +#> 3 15.2 dose:0.5, supp:VC +#> 4 17.3 dose:0.5, supp:VC +#> 5 22.5 dose:0.5, supp:VC +#> 6 17.3 dose:0.5, supp:VC +#> 7 13.6 dose:0.5, supp:VC +#> 8 14.5 dose:0.5, supp:VC +#> 9 18.8 dose:0.5, supp:VC +#> 10 15.5 dose:0.5, supp:VC #> #> [[3]] -#> # A tibble: 10 x 2 +#> # A tibble: 10 x 2 #> len label -#> <dbl> <fct> -#> 1 23.6 dose:1, supp:OJ -#> 2 18.5 dose:1, supp:OJ -#> 3 33.9 dose:1, supp:OJ -#> 4 25.5 dose:1, supp:OJ -#> 5 26.4 dose:1, supp:OJ -#> 6 32.5 dose:1, supp:OJ -#> 7 26.7 dose:1, supp:OJ -#> 8 21.5 dose:1, supp:OJ -#> 9 23.3 dose:1, supp:OJ -#> 10 29.5 dose:1, supp:OJ +#> <dbl> <fct> +#> 1 23.6 dose:1, supp:OJ +#> 2 18.5 dose:1, supp:OJ +#> 3 33.9 dose:1, supp:OJ +#> 4 25.5 dose:1, supp:OJ +#> 5 26.4 dose:1, supp:OJ +#> 6 32.5 dose:1, supp:OJ +#> 7 26.7 dose:1, supp:OJ +#> 8 21.5 dose:1, supp:OJ +#> 9 23.3 dose:1, supp:OJ +#> 10 29.5 dose:1, supp:OJ #> #> [[4]] -#> # A tibble: 10 x 2 +#> # A tibble: 10 x 2 #> len label -#> <dbl> <fct> -#> 1 15.2 dose:1, supp:VC -#> 2 21.5 dose:1, supp:VC -#> 3 17.6 dose:1, supp:VC -#> 4 9.7 dose:1, supp:VC -#> 5 14.5 dose:1, supp:VC -#> 6 10 dose:1, supp:VC -#> 7 8.2 dose:1, supp:VC -#> 8 9.4 dose:1, supp:VC -#> 9 16.5 dose:1, supp:VC -#> 10 9.7 dose:1, supp:VC +#> <dbl> <fct> +#> 1 15.2 dose:1, supp:VC +#> 2 21.5 dose:1, supp:VC +#> 3 17.6 dose:1, supp:VC +#> 4 9.7 dose:1, supp:VC +#> 5 14.5 dose:1, supp:VC +#> 6 10 dose:1, supp:VC +#> 7 8.2 dose:1, supp:VC +#> 8 9.4 dose:1, supp:VC +#> 9 16.5 dose:1, supp:VC +#> 10 9.7 dose:1, supp:VC #> #> [[5]] -#> # A tibble: 10 x 2 +#> # A tibble: 10 x 2 #> len label -#> <dbl> <fct> -#> 1 19.7 dose:2, supp:OJ -#> 2 23.3 dose:2, supp:OJ -#> 3 23.6 dose:2, supp:OJ -#> 4 26.4 dose:2, supp:OJ -#> 5 20 dose:2, supp:OJ -#> 6 25.2 dose:2, supp:OJ -#> 7 25.8 dose:2, supp:OJ -#> 8 21.2 dose:2, supp:OJ -#> 9 14.5 dose:2, supp:OJ -#> 10 27.3 dose:2, supp:OJ +#> <dbl> <fct> +#> 1 19.7 dose:2, supp:OJ +#> 2 23.3 dose:2, supp:OJ +#> 3 23.6 dose:2, supp:OJ +#> 4 26.4 dose:2, supp:OJ +#> 5 20 dose:2, supp:OJ +#> 6 25.2 dose:2, supp:OJ +#> 7 25.8 dose:2, supp:OJ +#> 8 21.2 dose:2, supp:OJ +#> 9 14.5 dose:2, supp:OJ +#> 10 27.3 dose:2, supp:OJ #> #> [[6]] -#> # A tibble: 10 x 2 +#> # A tibble: 10 x 2 #> len label -#> <dbl> <fct> -#> 1 25.5 dose:2, supp:VC -#> 2 26.4 dose:2, supp:VC -#> 3 22.4 dose:2, supp:VC -#> 4 24.5 dose:2, supp:VC -#> 5 24.8 dose:2, supp:VC -#> 6 30.9 dose:2, supp:VC -#> 7 26.4 dose:2, supp:VC -#> 8 27.3 dose:2, supp:VC -#> 9 29.4 dose:2, supp:VC -#> 10 23 dose:2, supp:VC +#> <dbl> <fct> +#> 1 25.5 dose:2, supp:VC +#> 2 26.4 dose:2, supp:VC +#> 3 22.4 dose:2, supp:VC +#> 4 24.5 dose:2, supp:VC +#> 5 24.8 dose:2, supp:VC +#> 6 30.9 dose:2, supp:VC +#> 7 26.4 dose:2, supp:VC +#> 8 27.3 dose:2, supp:VC +#> 9 29.4 dose:2, supp:VC +#> 10 23 dose:2, supp:VC #>
    # Add panel/subset labels res <- ToothGrowth %>% df_split_by(dose, supp) -res
    #> # A tibble: 6 x 4 +res
    #> # A tibble: 6 x 4 #> supp dose data label -#> <fct> <dbl> <list> <fct> -#> 1 VC 0.5 <tibble [10 × 2]> dose:0.5, supp:OJ -#> 2 VC 1 <tibble [10 × 2]> dose:0.5, supp:VC -#> 3 VC 2 <tibble [10 × 2]> dose:1, supp:OJ -#> 4 OJ 0.5 <tibble [10 × 2]> dose:1, supp:VC -#> 5 OJ 1 <tibble [10 × 2]> dose:2, supp:OJ -#> 6 OJ 2 <tibble [10 × 2]> dose:2, supp:VC
    +#> <fct> <dbl> <list> <fct> +#> 1 VC 0.5 <tibble [10 × 2]> dose:0.5, supp:OJ +#> 2 VC 1 <tibble [10 × 2]> dose:0.5, supp:VC +#> 3 VC 2 <tibble [10 × 2]> dose:1, supp:OJ +#> 4 OJ 0.5 <tibble [10 × 2]> dose:1, supp:VC +#> 5 OJ 1 <tibble [10 × 2]> dose:2, supp:OJ +#> 6 OJ 2 <tibble [10 × 2]> dose:2, supp:VC diff --git a/docs/reference/doo.html b/docs/reference/doo.html index c97292b..d7f7db7 100644 --- a/docs/reference/doo.html +++ b/docs/reference/doo.html @@ -80,7 +80,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -167,7 +167,7 @@

    Examp #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% stat_test <- function(data, formula){ t.test(formula, data) %>% - tidy() + tidy() } # Example 1: pipe-friendly stat_test(). # Two possibilities of usage are available @@ -175,35 +175,35 @@

    Examp # Use this ToothGrowth %>% group_by(dose) %>% - doo(~stat_test(data =., len ~ supp))
    #> # A tibble: 3 x 11 + doo(~stat_test(data =., len ~ supp))
    #> # A tibble: 3 x 11 #> dose estimate estimate1 estimate2 statistic p.value parameter conf.low -#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 0.5 5.25 13.2 7.98 3.17 0.00636 15.0 1.72 -#> 2 1 5.93 22.7 16.8 4.03 0.00104 15.4 2.80 -#> 3 2 -0.08 26.1 26.1 -0.0461 0.964 14.0 -3.80 -#> # … with 3 more variables: conf.high <dbl>, method <chr>, alternative <chr>
    +#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 0.5 5.25 13.2 7.98 3.17 0.00636 15.0 1.72 +#> 2 1 5.93 22.7 16.8 4.03 0.00104 15.4 2.80 +#> 3 2 -0.0800 26.1 26.1 -0.0461 0.964 14.0 -3.80 +#> # … with 3 more variables: conf.high <dbl>, method <chr>, alternative <chr>
    # Or this ToothGrowth %>% group_by(dose) %>% - doo(stat_test, len ~ supp)
    #> # A tibble: 3 x 11 + doo(stat_test, len ~ supp)
    #> # A tibble: 3 x 11 #> dose estimate estimate1 estimate2 statistic p.value parameter conf.low -#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 0.5 5.25 13.2 7.98 3.17 0.00636 15.0 1.72 -#> 2 1 5.93 22.7 16.8 4.03 0.00104 15.4 2.80 -#> 3 2 -0.08 26.1 26.1 -0.0461 0.964 14.0 -3.80 -#> # … with 3 more variables: conf.high <dbl>, method <chr>, alternative <chr>
    +#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 0.5 5.25 13.2 7.98 3.17 0.00636 15.0 1.72 +#> 2 1 5.93 22.7 16.8 4.03 0.00104 15.4 2.80 +#> 3 2 -0.0800 26.1 26.1 -0.0461 0.964 14.0 -3.80 +#> # … with 3 more variables: conf.high <dbl>, method <chr>, alternative <chr>
    # Example 2: R base function t.test() (not pipe friendly) # One possibility of usage #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% comparisons <- ToothGrowth %>% group_by(dose) %>% doo(~t.test(len ~ supp, data =.)) -comparisons
    #> # A tibble: 3 x 2 +comparisons
    #> # A tibble: 3 x 2 #> dose .results. -#> <dbl> <list> -#> 1 0.5 <htest> -#> 2 1 <htest> -#> 3 2 <htest>
    comparisons$.results.
    #> [[1]] +#> <dbl> <list> +#> 1 0.5 <htest> +#> 2 1 <htest> +#> 3 2 <htest>
    comparisons$.results.
    #> [[1]] #> #> Welch Two Sample t-test #> @@ -249,13 +249,13 @@

    Examp #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ToothGrowth %>% group_by(dose) %>% - doo(~t.test(len ~ supp, data =.) %>% tidy())

    #> # A tibble: 3 x 11 + doo(~t.test(len ~ supp, data =.) %>% tidy())
    #> # A tibble: 3 x 11 #> dose estimate estimate1 estimate2 statistic p.value parameter conf.low -#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 0.5 5.25 13.2 7.98 3.17 0.00636 15.0 1.72 -#> 2 1 5.93 22.7 16.8 4.03 0.00104 15.4 2.80 -#> 3 2 -0.08 26.1 26.1 -0.0461 0.964 14.0 -3.80 -#> # … with 3 more variables: conf.high <dbl>, method <chr>, alternative <chr>
    +#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 0.5 5.25 13.2 7.98 3.17 0.00636 15.0 1.72 +#> 2 1 5.93 22.7 16.8 4.03 0.00104 15.4 2.80 +#> 3 2 -0.0800 26.1 26.1 -0.0461 0.964 14.0 -3.80 +#> # … with 3 more variables: conf.high <dbl>, method <chr>, alternative <chr> @@ -124,6 +130,12 @@

    Dunn's Test of Multiple Comparisons

    Performs Dunn's test for pairwise multiple comparisons of the ranked data. The mean rank of the different groups is compared. Used for post-hoc test following Kruskal-Wallis test.

    +

    The default of the rstatix::dunn_test() function is to perform a + two-sided Dunn test like the well known commercial softwares, such as SPSS + and GraphPad. This is not the case for some other R packages + (dunn.test and jamovi), where the default is to perform + one-sided test. This discrepancy is documented at + https://github.com/kassambara/rstatix/issues/50.

    dunn_test(data, formula, p.adjust.method = "holm", detailed = FALSE)
    @@ -163,15 +175,17 @@

    Value

  • group1,group2: the compared groups in the pairwise tests.

  • n1,n2: Sample counts.

  • estimate: mean ranks difference.

  • -
  • estimate1, estimate2: show the mean rank values of - the two groups, respectively.

  • -
  • statistic: Test statistic (z-value) used to compute the - p-value.

  • +
  • estimate1, estimate2: show the mean rank values of the two + groups, respectively.

  • +
  • statistic: Test statistic (z-value) used + to compute the p-value.

  • p: p-value.

  • -
  • p.adj: the adjusted p-value.

  • -
  • method: the statistical test used to compare groups.

  • -
  • p.signif, p.adj.signif: the significance level of p-values and - adjusted p-values, respectively.

  • +
  • p.adj: the + adjusted p-value.

  • +
  • method: the statistical test used to compare + groups.

  • +
  • p.signif, p.adj.signif: the significance level of + p-values and adjusted p-values, respectively.

  • The returned object has an attribute called args, which is a list @@ -193,24 +207,24 @@

    R

    Examples

    # Simple test -ToothGrowth %>% dunn_test(len ~ dose)
    #> # A tibble: 3 x 9 +ToothGrowth %>% dunn_test(len ~ dose)
    #> # A tibble: 3 x 9 #> .y. group1 group2 n1 n2 statistic p p.adj p.adj.signif -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr> -#> 1 len 0.5 1 20 20 3.55 3.78e- 4 7.56e- 4 *** -#> 2 len 0.5 2 20 20 6.36 1.98e-10 5.95e-10 **** -#> 3 len 1 2 20 20 2.81 4.99e- 3 4.99e- 3 **
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr> +#> 1 len 0.5 1 20 20 3.55 3.78e- 4 7.56e- 4 *** +#> 2 len 0.5 2 20 20 6.36 1.98e-10 5.95e-10 **** +#> 3 len 1 2 20 20 2.81 4.99e- 3 4.99e- 3 **
    # Grouped data ToothGrowth %>% group_by(supp) %>% - dunn_test(len ~ dose)
    #> # A tibble: 6 x 10 + dunn_test(len ~ dose)
    #> # A tibble: 6 x 10 #> supp .y. group1 group2 n1 n2 statistic p p.adj p.adj.signif -#> * <fct> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr> -#> 1 OJ len 0.5 1 10 10 2.83 4.59e-3 9.18e-3 ** -#> 2 OJ len 0.5 2 10 10 4.22 2.45e-5 7.34e-5 **** -#> 3 OJ len 1 2 10 10 1.39 1.66e-1 1.66e-1 ns -#> 4 VC len 0.5 1 10 10 2.62 8.87e-3 1.77e-2 * -#> 5 VC len 0.5 2 10 10 5.01 5.57e-7 1.67e-6 **** -#> 6 VC len 1 2 10 10 2.39 1.69e-2 1.77e-2 *
    +#> * <fct> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr> +#> 1 OJ len 0.5 1 10 10 2.83 4.59e-3 9.18e-3 ** +#> 2 OJ len 0.5 2 10 10 4.22 2.45e-5 7.34e-5 **** +#> 3 OJ len 1 2 10 10 1.39 1.66e-1 1.66e-1 ns +#> 4 VC len 0.5 1 10 10 2.62 8.87e-3 1.77e-2 * +#> 5 VC len 0.5 2 10 10 5.01 5.57e-7 1.67e-6 **** +#> 6 VC len 1 2 10 10 2.39 1.69e-2 1.77e-2 * @@ -246,39 +246,39 @@

    Examp res <- df %>% group_by(supp) %>% emmeans_test(len ~ dose, p.adjust.method = "bonferroni") -res
    #> # A tibble: 6 x 10 +res
    #> # A tibble: 6 x 10 #> supp term .y. group1 group2 df statistic p p.adj p.adj.signif -#> * <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 OJ dose len 0.5 1 54 -5.83 3.18e- 7 9.53e- 7 **** -#> 2 OJ dose len 0.5 2 54 -7.90 1.43e-10 4.29e-10 **** -#> 3 OJ dose len 1 2 54 -2.07 4.34e- 2 1.30e- 1 ns -#> 4 VC dose len 0.5 1 54 -5.41 1.46e- 6 4.39e- 6 **** -#> 5 VC dose len 0.5 2 54 -11.2 1.13e-15 3.39e-15 **** -#> 6 VC dose len 1 2 54 -5.77 3.98e- 7 1.19e- 6 ****
    +#> * <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 OJ dose len 0.5 1 54 -5.83 3.18e- 7 9.53e- 7 **** +#> 2 OJ dose len 0.5 2 54 -7.90 1.43e-10 4.29e-10 **** +#> 3 OJ dose len 1 2 54 -2.07 4.34e- 2 1.30e- 1 ns +#> 4 VC dose len 0.5 1 54 -5.41 1.46e- 6 4.39e- 6 **** +#> 5 VC dose len 0.5 2 54 -11.2 1.13e-15 3.39e-15 **** +#> 6 VC dose len 1 2 54 -5.77 3.98e- 7 1.19e- 6 ****
    # Display estimated marginal means -attr(res, "emmeans")
    #> # A tibble: 6 x 8 +attr(res, "emmeans")
    #> # A tibble: 6 x 8 #> supp dose emmean se df conf.low conf.high method -#> <fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 OJ 0.5 13.2 1.15 54 10.9 15.5 Emmeans test -#> 2 OJ 1 22.7 1.15 54 20.4 25.0 Emmeans test -#> 3 OJ 2 26.1 1.15 54 23.8 28.4 Emmeans test -#> 4 VC 0.5 7.98 1.15 54 5.68 10.3 Emmeans test -#> 5 VC 1 16.8 1.15 54 14.5 19.1 Emmeans test -#> 6 VC 2 26.1 1.15 54 23.8 28.4 Emmeans test
    +#> <fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 OJ 0.5 13.2 1.15 54 10.9 15.5 Emmeans test +#> 2 OJ 1 22.7 1.15 54 20.4 25.0 Emmeans test +#> 3 OJ 2 26.1 1.15 54 23.8 28.4 Emmeans test +#> 4 VC 0.5 7.98 1.15 54 5.68 10.3 Emmeans test +#> 5 VC 1 16.8 1.15 54 14.5 19.1 Emmeans test +#> 6 VC 2 26.1 1.15 54 23.8 28.4 Emmeans test
    # Show details df %>% group_by(supp) %>% - emmeans_test(len ~ dose, p.adjust.method = "bonferroni", detailed = TRUE)
    #> # A tibble: 6 x 15 + emmeans_test(len ~ dose, p.adjust.method = "bonferroni", detailed = TRUE)
    #> # A tibble: 6 x 15 #> supp term .y. group1 group2 null.value estimate se df conf.low -#> * <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 OJ dose len 0.5 1 0 -9.47 1.62 54 -12.7 -#> 2 OJ dose len 0.5 2 0 -12.8 1.62 54 -16.1 -#> 3 OJ dose len 1 2 0 -3.36 1.62 54 -6.62 -#> 4 VC dose len 0.5 1 0 -8.79 1.62 54 -12.0 -#> 5 VC dose len 0.5 2 0 -18.2 1.62 54 -21.4 -#> 6 VC dose len 1 2 0 -9.37 1.62 54 -12.6 -#> # … with 5 more variables: conf.high <dbl>, statistic <dbl>, p <dbl>, -#> # p.adj <dbl>, p.adj.signif <chr>
    +#> * <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 OJ dose len 0.5 1 0 -9.47 1.62 54 -12.7 +#> 2 OJ dose len 0.5 2 0 -12.8 1.62 54 -16.1 +#> 3 OJ dose len 1 2 0 -3.36 1.62 54 -6.62 +#> 4 VC dose len 0.5 1 0 -8.79 1.62 54 -12.0 +#> 5 VC dose len 0.5 2 0 -18.2 1.62 54 -21.4 +#> 6 VC dose len 1 2 0 -9.37 1.62 54 -12.6 +#> # … with 5 more variables: conf.high <dbl>, statistic <dbl>, p <dbl>, +#> # p.adj <dbl>, p.adj.signif <chr> diff --git a/docs/reference/factorial_design.html b/docs/reference/factorial_design.html index 220d089..a22c058 100644 --- a/docs/reference/factorial_design.html +++ b/docs/reference/factorial_design.html @@ -77,7 +77,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -222,20 +222,20 @@

    Examp #> [1] "supp" "dose" #> #> $data -#> # A tibble: 60 x 4 +#> # A tibble: 60 x 4 #> len supp dose id -#> <dbl> <fct> <fct> <fct> -#> 1 4.2 VC X0.5 1 -#> 2 11.5 VC X0.5 2 -#> 3 7.3 VC X0.5 3 -#> 4 5.8 VC X0.5 4 -#> 5 6.4 VC X0.5 5 -#> 6 10 VC X0.5 6 -#> 7 11.2 VC X0.5 7 -#> 8 11.2 VC X0.5 8 -#> 9 5.2 VC X0.5 9 -#> 10 7 VC X0.5 10 -#> # … with 50 more rows +#> <dbl> <fct> <fct> <fct> +#> 1 4.2 VC X0.5 1 +#> 2 11.5 VC X0.5 2 +#> 3 7.3 VC X0.5 3 +#> 4 5.8 VC X0.5 4 +#> 5 6.4 VC X0.5 5 +#> 6 10 VC X0.5 6 +#> 7 11.2 VC X0.5 7 +#> 8 11.2 VC X0.5 8 +#> 9 5.2 VC X0.5 9 +#> 10 7 VC X0.5 10 +#> # … with 50 more rows #> #> $idata #> supp dose @@ -248,29 +248,29 @@

    Examp #> #> $idesign #> ~supp * dose -#> <environment: 0x7fc8557cd6a0> +#> <environment: 0x7fdfe6df9fc8> #> #> $lm_data -#> # A tibble: 10 x 7 +#> # A tibble: 10 x 7 #> id OJ_X0.5 OJ_X1 OJ_X2 VC_X0.5 VC_X1 VC_X2 -#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 1 15.2 19.7 25.5 4.2 16.5 23.6 -#> 2 2 21.5 23.3 26.4 11.5 16.5 18.5 -#> 3 3 17.6 23.6 22.4 7.3 15.2 33.9 -#> 4 4 9.7 26.4 24.5 5.8 17.3 25.5 -#> 5 5 14.5 20 24.8 6.4 22.5 26.4 -#> 6 6 10 25.2 30.9 10 17.3 32.5 -#> 7 7 8.2 25.8 26.4 11.2 13.6 26.7 -#> 8 8 9.4 21.2 27.3 11.2 14.5 21.5 -#> 9 9 16.5 14.5 29.4 5.2 18.8 23.3 -#> 10 10 9.7 27.3 23 7 15.5 29.5 +#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 1 15.2 19.7 25.5 4.2 16.5 23.6 +#> 2 2 21.5 23.3 26.4 11.5 16.5 18.5 +#> 3 3 17.6 23.6 22.4 7.3 15.2 33.9 +#> 4 4 9.7 26.4 24.5 5.8 17.3 25.5 +#> 5 5 14.5 20 24.8 6.4 22.5 26.4 +#> 6 6 10 25.2 30.9 10 17.3 32.5 +#> 7 7 8.2 25.8 26.4 11.2 13.6 26.7 +#> 8 8 9.4 21.2 27.3 11.2 14.5 21.5 +#> 9 9 16.5 14.5 29.4 5.2 18.8 23.3 +#> 10 10 9.7 27.3 23 7 15.5 29.5 #> #> $repeated #> [1] TRUE #> #> $lm_formula #> cbind(OJ_X0.5, OJ_X1, OJ_X2, VC_X0.5, VC_X1, VC_X2) ~ 1 -#> <environment: 0x7fc872d248d0> +#> <environment: 0x7fdfe6862be0> #> #> $model #> @@ -329,43 +329,43 @@

    Examp #> [1] "id" #> #> $data -#> # A tibble: 60 x 4 +#> # A tibble: 60 x 4 #> len supp dose id -#> <dbl> <fct> <fct> <fct> -#> 1 4.2 VC 0.5 1 -#> 2 11.5 VC 0.5 2 -#> 3 7.3 VC 0.5 3 -#> 4 5.8 VC 0.5 4 -#> 5 6.4 VC 0.5 5 -#> 6 10 VC 0.5 6 -#> 7 11.2 VC 0.5 7 -#> 8 11.2 VC 0.5 8 -#> 9 5.2 VC 0.5 9 -#> 10 7 VC 0.5 10 -#> # … with 50 more rows +#> <dbl> <fct> <fct> <fct> +#> 1 4.2 VC 0.5 1 +#> 2 11.5 VC 0.5 2 +#> 3 7.3 VC 0.5 3 +#> 4 5.8 VC 0.5 4 +#> 5 6.4 VC 0.5 5 +#> 6 10 VC 0.5 6 +#> 7 11.2 VC 0.5 7 +#> 8 11.2 VC 0.5 8 +#> 9 5.2 VC 0.5 9 +#> 10 7 VC 0.5 10 +#> # … with 50 more rows #> #> $lm_data -#> # A tibble: 60 x 4 +#> # A tibble: 60 x 4 #> len supp dose id -#> <dbl> <fct> <fct> <fct> -#> 1 4.2 VC 0.5 1 -#> 2 11.5 VC 0.5 2 -#> 3 7.3 VC 0.5 3 -#> 4 5.8 VC 0.5 4 -#> 5 6.4 VC 0.5 5 -#> 6 10 VC 0.5 6 -#> 7 11.2 VC 0.5 7 -#> 8 11.2 VC 0.5 8 -#> 9 5.2 VC 0.5 9 -#> 10 7 VC 0.5 10 -#> # … with 50 more rows +#> <dbl> <fct> <fct> <fct> +#> 1 4.2 VC 0.5 1 +#> 2 11.5 VC 0.5 2 +#> 3 7.3 VC 0.5 3 +#> 4 5.8 VC 0.5 4 +#> 5 6.4 VC 0.5 5 +#> 6 10 VC 0.5 6 +#> 7 11.2 VC 0.5 7 +#> 8 11.2 VC 0.5 8 +#> 9 5.2 VC 0.5 9 +#> 10 7 VC 0.5 10 +#> # … with 50 more rows #> #> $repeated #> [1] FALSE #> #> $lm_formula #> len ~ supp * dose -#> <environment: 0x7fc8562fcf98> +#> <environment: 0x7fdfc8b40b28> #> #> $model #> diff --git a/docs/reference/factors.html b/docs/reference/factors.html index 26957c8..7d7b904 100644 --- a/docs/reference/factors.html +++ b/docs/reference/factors.html @@ -77,7 +77,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -188,25 +188,25 @@

    Examp time = c("t1", "t2", "t1", "t2", "t1", "t2"), value = c(5, 6, 1, 3, 4, 5) ) -df
    #> # A tibble: 6 x 3 +df
    #> # A tibble: 6 x 3 #> group time value -#> <chr> <chr> <dbl> -#> 1 a t1 5 -#> 2 a t2 6 -#> 3 b t1 1 -#> 4 b t2 3 -#> 5 c t1 4 -#> 6 c t2 5
    # Convert group and time into factor variable +#> <chr> <chr> <dbl> +#> 1 a t1 5 +#> 2 a t2 6 +#> 3 b t1 1 +#> 4 b t2 3 +#> 5 c t1 4 +#> 6 c t2 5
    # Convert group and time into factor variable result <- df %>% convert_as_factor(group, time) -result
    #> # A tibble: 6 x 3 +result
    #> # A tibble: 6 x 3 #> group time value -#> <fct> <fct> <dbl> -#> 1 a t1 5 -#> 2 a t2 6 -#> 3 b t1 1 -#> 4 b t2 3 -#> 5 c t1 4 -#> 6 c t2 5
    # Show group levels +#> <fct> <fct> <dbl> +#> 1 a t1 5 +#> 2 a t2 6 +#> 3 b t1 1 +#> 4 b t2 3 +#> 5 c t1 4 +#> 6 c t2 5
    # Show group levels levels(result$group)
    #> [1] "a" "b" "c"
    # Set c as the reference level (the first one) result <- result %>% diff --git a/docs/reference/fisher_test.html b/docs/reference/fisher_test.html index 65866b1..576a6fc 100644 --- a/docs/reference/fisher_test.html +++ b/docs/reference/fisher_test.html @@ -79,7 +79,7 @@ rstatix - 0.7.0 + 0.7.1
    @@ -262,10 +262,10 @@

    Examp #> group yes no #> grp1 490 10 #> grp2 400 100
    # compare the proportion of smokers -fisher_test(xtab, detailed = TRUE)
    #> # A tibble: 1 x 8 +fisher_test(xtab, detailed = TRUE)
    #> # A tibble: 1 x 8 #> n estimate p conf.low conf.high method alternative p.signif -#> * <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <chr> <chr> -#> 1 1000 12.2 8.77e-22 6.27 26.6 Fisher's Exac… two.sided ****
    +#> * <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <chr> <chr> +#> 1 1000 12.2 8.77e-22 6.27 26.6 Fisher's Exac… two.sided ****
    # Homogeneity of proportions between groups #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # H0: the proportion of smokers is similar in the four groups @@ -288,20 +288,20 @@

    Examp #> Yes 50 100 139 80 #> No 56 13 17 22

    # Compare the proportions of smokers between groups -fisher_test(xtab, detailed = TRUE)
    #> # A tibble: 1 x 5 -#> n p method alternative p.signif -#> * <dbl> <dbl> <chr> <chr> <chr> -#> 1 477 6.10e-15 Fisher's Exact test two.sided ****
    +fisher_test(xtab, detailed = TRUE)
    #> # A tibble: 1 x 5 +#> n p method alternative p.signif +#> * <dbl> <dbl> <chr> <chr> <chr> +#> 1 477 6.1e-15 Fisher's Exact test two.sided ****
    # Pairwise comparison between groups -pairwise_fisher_test(xtab)
    #> # A tibble: 6 x 6 +pairwise_fisher_test(xtab)
    #> # A tibble: 6 x 6 #> group1 group2 n p p.adj p.adj.signif -#> * <chr> <chr> <dbl> <dbl> <dbl> <chr> -#> 1 grp1 grp2 219 2.39e-11 1.20e-10 **** -#> 2 grp1 grp3 262 1.22e-13 7.32e-13 **** -#> 3 grp1 grp4 208 3.79e- 6 1.52e- 5 **** -#> 4 grp2 grp3 269 1.00e+ 0 1.00e+ 0 ns -#> 5 grp2 grp4 215 6.35e- 2 1.27e- 1 ns -#> 6 grp3 grp4 258 2.17e- 2 6.51e- 2 ns
    +#> * <chr> <chr> <dbl> <dbl> <dbl> <chr> +#> 1 grp1 grp2 219 2.39e-11 1.2 e-10 **** +#> 2 grp1 grp3 262 1.22e-13 7.32e-13 **** +#> 3 grp1 grp4 208 3.79e- 6 1.52e- 5 **** +#> 4 grp2 grp3 269 1 e+ 0 1 e+ 0 ns +#> 5 grp2 grp4 215 6.35e- 2 1.27e- 1 ns +#> 6 grp3 grp4 258 2.17e- 2 6.51e- 2 ns
    # Pairwise proportion tests #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -318,15 +318,15 @@

    Examp #> Survived 1st 2nd 3rd Crew #> No 122 167 528 673 #> Yes 203 118 178 212

    # Compare the proportion of survived between groups -pairwise_fisher_test(xtab)
    #> # A tibble: 6 x 6 +pairwise_fisher_test(xtab)
    #> # A tibble: 6 x 6 #> group1 group2 n p p.adj p.adj.signif -#> * <chr> <chr> <dbl> <dbl> <dbl> <chr> -#> 1 1st 2nd 610 2.78e- 7 8.34e- 7 **** -#> 2 1st 3rd 1031 3.68e-30 1.84e-29 **** -#> 3 1st Crew 1210 1.81e-34 1.09e-33 **** -#> 4 2nd 3rd 991 8.19e- 7 1.64e- 6 **** -#> 5 2nd Crew 1170 2.77e- 8 1.11e- 7 **** -#> 6 3rd Crew 1591 5.98e- 1 5.98e- 1 ns
    +#> * <chr> <chr> <dbl> <dbl> <dbl> <chr> +#> 1 1st 2nd 610 2.78e- 7 8.34e- 7 **** +#> 2 1st 3rd 1031 3.68e-30 1.84e-29 **** +#> 3 1st Crew 1210 1.81e-34 1.09e-33 **** +#> 4 2nd 3rd 991 8.19e- 7 1.64e- 6 **** +#> 5 2nd Crew 1170 2.77e- 8 1.11e- 7 **** +#> 6 3rd Crew 1591 5.98e- 1 5.98e- 1 ns
    # Row-wise proportion tests #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Data: Titanic @@ -344,24 +344,24 @@

    Examp #> 2nd 179 106 #> 3rd 510 196 #> Crew 862 23

    # Compare the proportion of males and females in each category -row_wise_fisher_test(xtab)
    #> # A tibble: 4 x 5 +row_wise_fisher_test(xtab)
    #> # A tibble: 4 x 5 #> group n p p.adj p.adj.signif -#> * <chr> <dbl> <dbl> <dbl> <chr> -#> 1 1st 2201 9.38e-25 2.81e-24 **** -#> 2 2nd 2201 3.96e-11 7.92e-11 **** -#> 3 3rd 2201 8.67e- 7 8.67e- 7 **** -#> 4 Crew 2201 8.02e-85 3.21e-84 ****
    +#> * <chr> <dbl> <dbl> <dbl> <chr> +#> 1 1st 2201 9.38e-25 2.81e-24 **** +#> 2 2nd 2201 3.96e-11 7.92e-11 **** +#> 3 3rd 2201 8.67e- 7 8.67e- 7 **** +#> 4 Crew 2201 8.02e-85 3.21e-84 ****
    # A r x c table Agresti (2002, p. 57) Job Satisfaction Job <- matrix(c(1,2,1,0, 3,3,6,1, 10,10,14,9, 6,7,12,11), 4, 4, dimnames = list(income = c("< 15k", "15-25k", "25-40k", "> 40k"), satisfaction = c("VeryD", "LittleD", "ModerateS", "VeryS"))) -fisher_test(Job)
    #> # A tibble: 1 x 3 +fisher_test(Job)
    #> # A tibble: 1 x 3 #> n p p.signif -#> * <dbl> <dbl> <chr> -#> 1 96 0.783 ns
    fisher_test(Job, simulate.p.value = TRUE, B = 1e5)
    #> # A tibble: 1 x 3 +#> * <dbl> <dbl> <chr> +#> 1 96 0.783 ns
    fisher_test(Job, simulate.p.value = TRUE, B = 1e5)
    #> # A tibble: 1 x 3 #> n p p.signif -#> * <dbl> <dbl> <chr> -#> 1 96 0.784 ns
    +#> * <dbl> <dbl> <chr> +#> 1 96 0.784 ns @@ -153,15 +153,15 @@

    Value

    Examples

    data("ToothGrowth") -ToothGrowth %>% freq_table(supp, dose)
    #> # A tibble: 6 x 4 +ToothGrowth %>% freq_table(supp, dose)
    #> # A tibble: 6 x 4 #> supp dose n prop -#> <fct> <dbl> <int> <dbl> -#> 1 OJ 0.5 10 33.3 -#> 2 OJ 1 10 33.3 -#> 3 OJ 2 10 33.3 -#> 4 VC 0.5 10 33.3 -#> 5 VC 1 10 33.3 -#> 6 VC 2 10 33.3
    +#> <fct> <dbl> <int> <dbl> +#> 1 OJ 0.5 10 33.3 +#> 2 OJ 1 10 33.3 +#> 3 OJ 2 10 33.3 +#> 4 VC 0.5 10 33.3 +#> 5 VC 1 10 33.3 +#> 6 VC 2 10 33.3 @@ -221,10 +221,10 @@

    Examp #> 6 10.0 VC 0.5 6
    # Friedman test effect size #::::::::::::::::::::::::::::::::::::::::: -df %>% friedman_effsize(len ~ dose | id)
    #> # A tibble: 1 x 5 +df %>% friedman_effsize(len ~ dose | id)
    #> # A tibble: 1 x 5 #> .y. n effsize method magnitude -#> * <chr> <int> <dbl> <chr> <ord> -#> 1 len 10 1 Kendall W large
    +#> * <chr> <int> <dbl> <chr> <ord> +#> 1 len 10 1 Kendall W large @@ -184,10 +184,10 @@

    Examp #> 6 10.0 VC 0.5 6
    # Friedman rank sum test #::::::::::::::::::::::::::::::::::::::::: -df %>% friedman_test(len ~ dose | id)
    #> # A tibble: 1 x 6 +df %>% friedman_test(len ~ dose | id)
    #> # A tibble: 1 x 6 #> .y. n statistic df p method -#> * <chr> <int> <dbl> <dbl> <dbl> <chr> -#> 1 len 10 20 2 0.0000454 Friedman test
    +#> * <chr> <int> <dbl> <dbl> <dbl> <chr> +#> 1 len 10 20 2 0.0000454 Friedman test
    @@ -210,24 +210,24 @@

    R

    Examples

    # Simple test -ToothGrowth %>% games_howell_test(len ~ dose)
    #> # A tibble: 3 x 8 +ToothGrowth %>% games_howell_test(len ~ dose)
    #> # A tibble: 3 x 8 #> .y. group1 group2 estimate conf.low conf.high p.adj p.adj.signif -#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len 0.5 1 9.13 5.69 12.6 0.000000376 **** -#> 2 len 0.5 2 15.5 12.3 18.7 0 **** -#> 3 len 1 2 6.37 3.19 9.54 0.0000557 ****
    +#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len 0.5 1 9.13 5.69 12.6 0.000000376 **** +#> 2 len 0.5 2 15.5 12.3 18.7 0 **** +#> 3 len 1 2 6.37 3.19 9.54 0.0000557 ****
    # Grouped data ToothGrowth %>% group_by(supp) %>% - games_howell_test(len ~ dose)
    #> # A tibble: 6 x 9 + games_howell_test(len ~ dose)
    #> # A tibble: 6 x 9 #> supp .y. group1 group2 estimate conf.low conf.high p.adj p.adj.signif -#> * <fct> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 OJ len 0.5 1 9.47 4.68 14.3 0.000247 *** -#> 2 OJ len 0.5 2 12.8 8.56 17.1 0.00000376 **** -#> 3 OJ len 1 2 3.36 -0.501 7.22 0.094 ns -#> 4 VC len 0.5 1 8.79 5.78 11.8 0.00000196 **** -#> 5 VC len 0.5 2 18.2 13.6 22.7 0.000000134 **** -#> 6 VC len 1 2 9.37 4.87 13.9 0.000253 ***
    +#> * <fct> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 OJ len 0.5 1 9.47 4.68 14.3 0.000247 *** +#> 2 OJ len 0.5 2 12.8 8.56 17.1 0.00000376 **** +#> 3 OJ len 1 2 3.36 -0.501 7.22 0.094 ns +#> 4 VC len 0.5 1 8.79 5.78 11.8 0.00000196 **** +#> 5 VC len 0.5 2 18.2 13.6 22.7 0.000000134 **** +#> 6 VC len 1 2 9.37 4.87 13.9 0.000253 ***
    diff --git a/docs/reference/get_mode.html b/docs/reference/get_mode.html index 294be30..8b9f22a 100644 --- a/docs/reference/get_mode.html +++ b/docs/reference/get_mode.html @@ -75,7 +75,7 @@ rstatix - 0.7.0 + 0.7.1 diff --git a/docs/reference/get_pvalue_position-1.png b/docs/reference/get_pvalue_position-1.png index 8491b7e..df137cb 100644 Binary files a/docs/reference/get_pvalue_position-1.png and b/docs/reference/get_pvalue_position-1.png differ diff --git a/docs/reference/get_pvalue_position.html b/docs/reference/get_pvalue_position.html index b109f30..b30043f 100644 --- a/docs/reference/get_pvalue_position.html +++ b/docs/reference/get_pvalue_position.html @@ -83,7 +83,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -308,12 +308,12 @@

    Examp #:::::::::::::::::::::::::::::::::::: stat.test <- df %>% t_test(len ~ dose) -stat.test
    #> # A tibble: 3 x 10 +stat.test
    #> # A tibble: 3 x 10 #> .y. group1 group2 n1 n2 statistic df p p.adj p.adj.signif -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 2.54e- 7 **** -#> 2 len 0.5 2 20 20 -11.8 36.9 4.40e-14 1.32e-13 **** -#> 3 len 1 2 20 20 -4.90 37.1 1.91e- 5 1.91e- 5 ****
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 2.54e- 7 **** +#> 2 len 0.5 2 20 20 -11.8 36.9 4.4 e-14 1.32e-13 **** +#> 3 len 1 2 20 20 -4.90 37.1 1.91e- 5 1.91e- 5 ****
    # Add the test into box plots #:::::::::::::::::::::::::::::::::::: stat.test <- stat.test %>% diff --git a/docs/reference/get_summary_stats.html b/docs/reference/get_summary_stats.html index fdf8256..1a8a5fd 100644 --- a/docs/reference/get_summary_stats.html +++ b/docs/reference/get_summary_stats.html @@ -74,7 +74,7 @@ rstatix - 0.7.0 + 0.7.1
    @@ -186,45 +186,45 @@

    Value

    Examples

    # Full summary statistics data("ToothGrowth") -ToothGrowth %>% get_summary_stats(len)
    #> # A tibble: 1 x 13 +ToothGrowth %>% get_summary_stats(len)
    #> # A tibble: 1 x 13 #> variable n min max median q1 q3 iqr mad mean sd se -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 len 60 4.2 33.9 19.2 13.1 25.3 12.2 9.04 18.8 7.65 0.988 -#> # … with 1 more variable: ci <dbl>
    +#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 len 60 4.2 33.9 19.2 13.1 25.3 12.2 9.04 18.8 7.65 0.988 +#> # … with 1 more variable: ci <dbl>
    # Summary statistics of grouped data # Show only common summary ToothGrowth %>% group_by(dose, supp) %>% - get_summary_stats(len, type = "common")
    #> # A tibble: 6 x 12 + get_summary_stats(len, type = "common")
    #> # A tibble: 6 x 12 #> supp dose variable n min max median iqr mean sd se ci -#> <fct> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 OJ 0.5 len 10 8.2 21.5 12.2 6.48 13.2 4.46 1.41 3.19 -#> 2 VC 0.5 len 10 4.2 11.5 7.15 4.95 7.98 2.75 0.869 1.96 -#> 3 OJ 1 len 10 14.5 27.3 23.4 5.35 22.7 3.91 1.24 2.80 -#> 4 VC 1 len 10 13.6 22.5 16.5 2.02 16.8 2.52 0.795 1.80 -#> 5 OJ 2 len 10 22.4 30.9 26.0 2.5 26.1 2.66 0.84 1.90 -#> 6 VC 2 len 10 18.5 33.9 26.0 5.42 26.1 4.80 1.52 3.43
    +#> <fct> <dbl> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 OJ 0.5 len 10 8.2 21.5 12.2 6.48 13.2 4.46 1.41 3.19 +#> 2 VC 0.5 len 10 4.2 11.5 7.15 4.95 7.98 2.75 0.869 1.96 +#> 3 OJ 1 len 10 14.5 27.3 23.4 5.35 22.7 3.91 1.24 2.80 +#> 4 VC 1 len 10 13.6 22.5 16.5 2.02 16.8 2.52 0.795 1.80 +#> 5 OJ 2 len 10 22.4 30.9 26.0 2.5 26.1 2.66 0.84 1.90 +#> 6 VC 2 len 10 18.5 33.9 26.0 5.42 26.1 4.80 1.52 3.43
    # Robust summary statistics -ToothGrowth %>% get_summary_stats(len, type = "robust")
    #> # A tibble: 1 x 4 +ToothGrowth %>% get_summary_stats(len, type = "robust")
    #> # A tibble: 1 x 4 #> variable n median iqr -#> <chr> <dbl> <dbl> <dbl> -#> 1 len 60 19.2 12.2
    +#> <fct> <dbl> <dbl> <dbl> +#> 1 len 60 19.2 12.2
    # Five number summary statistics -ToothGrowth %>% get_summary_stats(len, type = "five_number")
    #> # A tibble: 1 x 7 +ToothGrowth %>% get_summary_stats(len, type = "five_number")
    #> # A tibble: 1 x 7 #> variable n min max q1 median q3 -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 len 60 4.2 33.9 13.1 19.2 25.3
    +#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 len 60 4.2 33.9 13.1 19.2 25.3
    # Compute only mean and sd -ToothGrowth %>% get_summary_stats(len, type = "mean_sd")
    #> # A tibble: 1 x 4 +ToothGrowth %>% get_summary_stats(len, type = "mean_sd")
    #> # A tibble: 1 x 4 #> variable n mean sd -#> <chr> <dbl> <dbl> <dbl> -#> 1 len 60 18.8 7.65
    +#> <fct> <dbl> <dbl> <dbl> +#> 1 len 60 18.8 7.65
    # Compute full summary statistics but show only mean, sd, median, iqr ToothGrowth %>% - get_summary_stats(len, show = c("mean", "sd", "median", "iqr"))
    #> # A tibble: 1 x 6 + get_summary_stats(len, show = c("mean", "sd", "median", "iqr"))
    #> # A tibble: 1 x 6 #> variable n mean sd median iqr -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 len 60 18.8 7.65 19.2 12.2
    +#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 len 60 18.8 7.65 19.2 12.2
    @@ -258,10 +258,12 @@

    Examp # One-way ANOVA test #::::::::::::::::::::::::::::::::::::::::: -anov <- df %>% anova_test(len ~ dose)
    #> Coefficient covariances computed by hccm()
    get_test_label(anov, detailed = TRUE, type = "text")
    #> [1] "Anova, F(1,58) = 105.06, p = <0.0001, eta2[g] = 0.644"
    +anov <- df %>% anova_test(len ~ dose) +get_test_label(anov, detailed = TRUE, type = "text")
    #> [1] "Anova, F(1,58) = 105.06, p = <0.0001, eta2[g] = 0.644"
    # Two-way ANOVA test #::::::::::::::::::::::::::::::::::::::::: -anov <- df %>% anova_test(len ~ supp*dose)
    #> Coefficient covariances computed by hccm()
    get_test_label(anov, detailed = TRUE, type = "text", +anov <- df %>% anova_test(len ~ supp*dose) +get_test_label(anov, detailed = TRUE, type = "text", description = "Two Way ANOVA")
    #> [1] "Two Way ANOVA, F(1,56) = 5.33, p = 0.025, eta2[g] = 0.087"
    # Kruskal-Wallis test diff --git a/docs/reference/index.html b/docs/reference/index.html index db8f96f..1665d09 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -73,7 +73,7 @@ rstatix - 0.7.0 + 0.7.1
    diff --git a/docs/reference/kruskal_effsize.html b/docs/reference/kruskal_effsize.html index fb65590..05a47ae 100644 --- a/docs/reference/kruskal_effsize.html +++ b/docs/reference/kruskal_effsize.html @@ -84,7 +84,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -212,18 +212,18 @@

    Examp # Kruskal-wallis rank sum test #::::::::::::::::::::::::::::::::::::::::: -df %>% kruskal_effsize(len ~ dose)
    #> # A tibble: 1 x 5 +df %>% kruskal_effsize(len ~ dose)
    #> # A tibble: 1 x 5 #> .y. n effsize method magnitude -#> * <chr> <int> <dbl> <chr> <ord> -#> 1 len 60 0.678 eta2[H] large
    +#> * <chr> <int> <dbl> <chr> <ord> +#> 1 len 60 0.678 eta2[H] large
    # Grouped data df %>% group_by(supp) %>% - kruskal_effsize(len ~ dose)
    #> # A tibble: 2 x 6 + kruskal_effsize(len ~ dose)
    #> # A tibble: 2 x 6 #> supp .y. n effsize method magnitude -#> * <fct> <chr> <int> <dbl> <chr> <ord> -#> 1 OJ len 30 0.611 eta2[H] large -#> 2 VC len 30 0.855 eta2[H] large
    +#> * <fct> <chr> <int> <dbl> <chr> <ord> +#> 1 OJ len 30 0.611 eta2[H] large +#> 2 VC len 30 0.855 eta2[H] large @@ -170,18 +170,18 @@

    Examp # Kruskal-wallis rank sum test #::::::::::::::::::::::::::::::::::::::::: -df %>% kruskal_test(len ~ dose)
    #> # A tibble: 1 x 6 +df %>% kruskal_test(len ~ dose)
    #> # A tibble: 1 x 6 #> .y. n statistic df p method -#> * <chr> <int> <dbl> <int> <dbl> <chr> -#> 1 len 60 40.7 2 0.00000000148 Kruskal-Wallis
    +#> * <chr> <int> <dbl> <int> <dbl> <chr> +#> 1 len 60 40.7 2 0.00000000148 Kruskal-Wallis
    # Grouped data df %>% group_by(supp) %>% - kruskal_test(len ~ dose)
    #> # A tibble: 2 x 7 + kruskal_test(len ~ dose)
    #> # A tibble: 2 x 7 #> supp .y. n statistic df p method -#> * <fct> <chr> <int> <dbl> <int> <dbl> <chr> -#> 1 OJ len 30 18.5 2 0.0000958 Kruskal-Wallis -#> 2 VC len 30 25.1 2 0.00000359 Kruskal-Wallis
    +#> * <fct> <chr> <int> <dbl> <int> <dbl> <chr> +#> 1 OJ len 30 18.5 2 0.0000958 Kruskal-Wallis +#> 2 VC len 30 25.1 2 0.00000359 Kruskal-Wallis @@ -160,18 +160,18 @@

    Examp df <- ToothGrowth df$dose <- as.factor(df$dose) # Compute Levene's Test -df %>% levene_test(len ~ dose)
    #> # A tibble: 1 x 4 +df %>% levene_test(len ~ dose)
    #> # A tibble: 1 x 4 #> df1 df2 statistic p -#> <int> <int> <dbl> <dbl> -#> 1 2 57 0.646 0.528
    +#> <int> <int> <dbl> <dbl> +#> 1 2 57 0.646 0.528
    # Grouped data df %>% group_by(supp) %>% - levene_test(len ~ dose)
    #> # A tibble: 2 x 5 + levene_test(len ~ dose)
    #> # A tibble: 2 x 5 #> supp df1 df2 statistic p -#> <fct> <int> <int> <dbl> <dbl> -#> 1 OJ 2 27 1.84 0.178 -#> 2 VC 2 27 2.17 0.134
    +#> <fct> <int> <int> <dbl> <dbl> +#> 1 OJ 2 27 1.84 0.178 +#> 2 VC 2 27 2.17 0.134
    @@ -178,27 +178,27 @@

    Examp
    # Compute mahalonobis distance and flag outliers if any iris %>% - doo(~mahalanobis_distance(.))
    #> # A tibble: 150 x 6 + doo(~mahalanobis_distance(.))
    #> # A tibble: 150 x 6 #> Sepal.Length Sepal.Width Petal.Length Petal.Width mahal.dist is.outlier -#> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl> -#> 1 5.1 3.5 1.4 0.2 2.13 FALSE -#> 2 4.9 3 1.4 0.2 2.85 FALSE -#> 3 4.7 3.2 1.3 0.2 2.08 FALSE -#> 4 4.6 3.1 1.5 0.2 2.45 FALSE -#> 5 5 3.6 1.4 0.2 2.46 FALSE -#> 6 5.4 3.9 1.7 0.4 3.88 FALSE -#> 7 4.6 3.4 1.4 0.3 2.86 FALSE -#> 8 5 3.4 1.5 0.2 1.83 FALSE -#> 9 4.4 2.9 1.4 0.2 3.38 FALSE -#> 10 4.9 3.1 1.5 0.1 2.38 FALSE -#> # … with 140 more rows
    +#> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl> +#> 1 5.1 3.5 1.4 0.2 2.13 FALSE +#> 2 4.9 3 1.4 0.2 2.85 FALSE +#> 3 4.7 3.2 1.3 0.2 2.08 FALSE +#> 4 4.6 3.1 1.5 0.2 2.45 FALSE +#> 5 5 3.6 1.4 0.2 2.46 FALSE +#> 6 5.4 3.9 1.7 0.4 3.88 FALSE +#> 7 4.6 3.4 1.4 0.3 2.86 FALSE +#> 8 5 3.4 1.5 0.2 1.83 FALSE +#> 9 4.4 2.9 1.4 0.2 3.38 FALSE +#> 10 4.9 3.1 1.5 0.1 2.38 FALSE +#> # … with 140 more rows
    # Compute distance by groups and filter outliers iris %>% group_by(Species) %>% doo(~mahalanobis_distance(.)) %>% - filter(is.outlier == TRUE)
    #> # A tibble: 0 x 7 -#> # … with 7 variables: Species <fct>, Sepal.Length <dbl>, Sepal.Width <dbl>, -#> # Petal.Length <dbl>, Petal.Width <dbl>, mahal.dist <dbl>, is.outlier <lgl>
    + filter(is.outlier == TRUE)
    #> # A tibble: 0 x 7 +#> # … with 7 variables: Species <fct>, Sepal.Length <dbl>, Sepal.Width <dbl>, +#> # Petal.Length <dbl>, Petal.Width <dbl>, mahal.dist <dbl>, is.outlier <lgl>
    diff --git a/docs/reference/mcnemar_test.html b/docs/reference/mcnemar_test.html index 53b92d9..27aa9db 100644 --- a/docs/reference/mcnemar_test.html +++ b/docs/reference/mcnemar_test.html @@ -76,7 +76,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -222,10 +222,10 @@

    Examp #> non.smoker 25 6 #> smoker 21 10
    # Compare the proportion of smokers -mcnemar_test(xtab)
    #> # A tibble: 1 x 6 +mcnemar_test(xtab)
    #> # A tibble: 1 x 6 #> n statistic df p p.signif method -#> * <dbl> <dbl> <dbl> <dbl> <chr> <chr> -#> 1 62 7.26 1 0.00705 ** McNemar test
    +#> * <dbl> <dbl> <dbl> <dbl> <chr> <chr> +#> 1 62 7.26 1 0.00705 ** McNemar test
    # Comparing multiple related proportions # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Generate a demo data @@ -244,17 +244,17 @@

    Examp #> success 2 5 10 #> failure 8 5 0

    # Compare the proportion of success between treatments -cochran_qtest(mydata, outcome ~ treatment|participant)
    #> # A tibble: 1 x 6 +cochran_qtest(mydata, outcome ~ treatment|participant)
    #> # A tibble: 1 x 6 #> .y. n statistic df p method -#> * <chr> <int> <dbl> <dbl> <dbl> <chr> -#> 1 outcome 10 10.9 2 0.00432 Cochran's Q test
    +#> * <chr> <int> <dbl> <dbl> <dbl> <chr> +#> 1 outcome 10 10.9 2 0.00432 Cochran's Q test
    # pairwise comparisons between groups -pairwise_mcnemar_test(mydata, outcome ~ treatment|participant)
    #> # A tibble: 3 x 6 +pairwise_mcnemar_test(mydata, outcome ~ treatment|participant)
    #> # A tibble: 3 x 6 #> group1 group2 p p.adj p.adj.signif method -#> * <chr> <chr> <dbl> <dbl> <chr> <chr> -#> 1 A B 0.371 1 ns McNemar test -#> 2 A C 0.0133 0.0399 * McNemar test -#> 3 B C 0.0736 0.221 ns McNemar test
    +#> * <chr> <chr> <dbl> <dbl> <chr> <chr> +#> 1 A B 0.371 1 ns McNemar test +#> 2 A C 0.0133 0.0399 * McNemar test +#> 3 B C 0.0736 0.221 ns McNemar test
    @@ -163,46 +163,46 @@

    Examp #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # this is a test of homogeneity res <- multinom_test(tulip) -res
    #> # A tibble: 1 x 2 +res
    #> # A tibble: 1 x 2 #> p p.signif -#> * <dbl> <chr> -#> 1 0.000000711 ****
    -attr(res, "descriptives")
    #> # A tibble: 3 x 3 +#> * <dbl> <chr> +#> 1 0.000000711 ****
    +attr(res, "descriptives")
    #> # A tibble: 3 x 3 #> group observed expected -#> <chr> <dbl> <dbl> -#> 1 red 81 52.7 -#> 2 yellow 50 52.7 -#> 3 white 27 52.7
    +#> <chr> <dbl> <dbl> +#> 1 red 81 52.7 +#> 2 yellow 50 52.7 +#> 3 white 27 52.7
    # Pairwise comparisons between groups -pairwise_binom_test(tulip, p.adjust.method = "bonferroni")
    #> # A tibble: 3 x 9 +pairwise_binom_test(tulip, p.adjust.method = "bonferroni")
    #> # A tibble: 3 x 9 #> group1 group2 n estimate conf.low conf.high p p.adj p.adj.signif -#> * <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 red yellow 131 0.618 0.529 0.702 8.51e-3 2.55e-2 * -#> 2 red white 108 0.75 0.657 0.828 1.91e-7 5.72e-7 **** -#> 3 yellow white 77 0.649 0.532 0.755 1.17e-2 3.50e-2 *
    +#> * <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 red yellow 131 0.618 0.529 0.702 8.51e-3 2.55e-2 * +#> 2 red white 108 0.75 0.657 0.828 1.91e-7 5.72e-7 **** +#> 3 yellow white 77 0.649 0.532 0.755 1.17e-2 3.5 e-2 *
    # Question 2: comparing observed to expected proportions #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # this is a goodness-of-fit test expected.p <- c(red = 0.5, yellow = 0.33, white = 0.17) res <- multinom_test(tulip, expected.p) -res
    #> # A tibble: 1 x 2 +res
    #> # A tibble: 1 x 2 #> p p.signif -#> * <dbl> <chr> -#> 1 0.942 ns
    attr(res, "descriptives")
    #> # A tibble: 3 x 3 +#> * <dbl> <chr> +#> 1 0.942 ns
    attr(res, "descriptives")
    #> # A tibble: 3 x 3 #> group observed expected -#> <chr> <dbl> <dbl> -#> 1 red 81 79 -#> 2 yellow 50 52.1 -#> 3 white 27 26.9
    +#> <chr> <dbl> <dbl> +#> 1 red 81 79 +#> 2 yellow 50 52.1 +#> 3 white 27 26.9
    # Pairwise comparisons against a given probabilities -pairwise_binom_test_against_p(tulip, expected.p)
    #> # A tibble: 3 x 10 -#> group observed expected n estimate conf.low conf.high p p.adj -#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 red 81 79 158 0.513 0.432 0.593 0.811 1 -#> 2 yell… 50 52.1 158 0.316 0.245 0.395 0.800 1 -#> 3 white 27 26.9 158 0.171 0.116 0.239 1 1 -#> # … with 1 more variable: p.adj.signif <chr>
    +pairwise_binom_test_against_p(tulip, expected.p)
    #> # A tibble: 3 x 10 +#> group observed expected n estimate conf.low conf.high p p.adj +#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 red 81 79 158 0.513 0.432 0.593 0.811 1 +#> 2 yellow 50 52.1 158 0.316 0.245 0.395 0.800 1 +#> 3 white 27 26.9 158 0.171 0.116 0.239 1 1 +#> # … with 1 more variable: p.adj.signif <chr>
    @@ -217,11 +217,11 @@

    Examp # Identify outliers by groups demo.data %>% group_by(gender) %>% - identify_outliers("score")
    #> # A tibble: 2 x 5 + identify_outliers("score")
    #> # A tibble: 2 x 5 #> gender sample score is.outlier is.extreme -#> <fct> <int> <dbl> <lgl> <lgl> -#> 1 Female 18 1.07 TRUE FALSE -#> 2 Female 20 50 TRUE TRUE
    +#> <fct> <int> <dbl> <lgl> <lgl> +#> 1 Female 18 1.07 TRUE FALSE +#> 2 Female 20 50 TRUE TRUE @@ -268,12 +268,12 @@

    Examp group_by(dose) %>% t_test(len ~ supp) %>% p_format(digits = 2, leading.zero = FALSE) %>% - p_mark_significant()
    #> # A tibble: 3 x 9 + p_mark_significant()
    #> # A tibble: 3 x 9 #> dose .y. group1 group2 n1 n2 statistic df p -#> * <dbl> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <chr> -#> 1 0.5 len OJ VC 10 10 3.17 15.0 .0064** -#> 2 1 len OJ VC 10 10 4.03 15.4 .001*** -#> 3 2 len OJ VC 10 10 -0.0461 14.0 .964
    +#> * <dbl> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <chr> +#> 1 0.5 len OJ VC 10 10 3.17 15.0 .0064** +#> 2 1 len OJ VC 10 10 4.03 15.4 .001*** +#> 3 2 len OJ VC 10 10 -0.0461 14.0 .964
    diff --git a/docs/reference/prop_test.html b/docs/reference/prop_test.html index 8dc438a..b0908dc 100644 --- a/docs/reference/prop_test.html +++ b/docs/reference/prop_test.html @@ -80,7 +80,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -257,11 +257,11 @@

    Fun

    Examples

    # Comparing an observed proportion to an expected proportion #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -prop_test(x = 95, n = 160, p = 0.5, detailed = TRUE)
    #> # A tibble: 1 x 11 -#> n n1 estimate statistic p df conf.low conf.high method -#> * <dbl> <dbl> <dbl> <dbl> <dbl> <int> <dbl> <dbl> <chr> -#> 1 160 95 0.594 5.26 0.0219 1 0.513 0.670 Prop … -#> # … with 2 more variables: alternative <chr>, p.signif <chr>
    +prop_test(x = 95, n = 160, p = 0.5, detailed = TRUE)
    #> # A tibble: 1 x 11 +#> n n1 estimate statistic p df conf.low conf.high method +#> * <dbl> <dbl> <dbl> <dbl> <dbl> <int> <dbl> <dbl> <chr> +#> 1 160 95 0.594 5.26 0.0219 1 0.513 0.670 Prop test +#> # … with 2 more variables: alternative <chr>, p.signif <chr>
    # Comparing two proportions #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Data: frequencies of smokers between two groups @@ -274,12 +274,12 @@

    Examp #> group yes no #> grp1 490 10 #> grp2 400 100

    # compare the proportion of smokers -prop_test(xtab, detailed = TRUE)
    #> # A tibble: 1 x 13 +prop_test(xtab, detailed = TRUE)
    #> # A tibble: 1 x 13 #> n n1 n2 estimate1 estimate2 statistic p df conf.low -#> * <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 1000 500 500 0.98 0.8 80.9 2.36e-19 1 0.141 -#> # … with 4 more variables: conf.high <dbl>, method <chr>, alternative <chr>, -#> # p.signif <chr>
    +#> * <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 1000 500 500 0.98 0.8 80.9 2.36e-19 1 0.141 +#> # … with 4 more variables: conf.high <dbl>, method <chr>, alternative <chr>, +#> # p.signif <chr>
    # Homogeneity of proportions between groups #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # H0: the proportion of smokers is similar in the four groups @@ -302,22 +302,22 @@

    Examp #> Yes 50 100 139 80 #> No 56 13 17 22

    # Compare the proportions of smokers between groups -prop_test(xtab, detailed = TRUE)
    #> # A tibble: 1 x 15 +prop_test(xtab, detailed = TRUE)
    #> # A tibble: 1 x 15 #> n n1 n2 n3 n4 estimate1 estimate2 estimate3 estimate4 -#> * <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 477 106 113 156 102 0.472 0.885 0.891 0.784 -#> # … with 6 more variables: statistic <dbl>, p <dbl>, df <dbl>, method <chr>, -#> # alternative <chr>, p.signif <chr>
    +#> * <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 477 106 113 156 102 0.472 0.885 0.891 0.784 +#> # … with 6 more variables: statistic <dbl>, p <dbl>, df <dbl>, method <chr>, +#> # alternative <chr>, p.signif <chr>
    # Pairwise comparison between groups -pairwise_prop_test(xtab)
    #> # A tibble: 6 x 5 +pairwise_prop_test(xtab)
    #> # A tibble: 6 x 5 #> group1 group2 p p.adj p.adj.signif -#> * <chr> <chr> <dbl> <dbl> <chr> -#> 1 grp1 grp2 1.25e-10 6.23e-10 **** -#> 2 grp1 grp3 3.09e-13 1.86e-12 **** -#> 3 grp2 grp3 1.00e+ 0 1.00e+ 0 ns -#> 4 grp1 grp4 6.41e- 6 2.56e- 5 **** -#> 5 grp2 grp4 7.01e- 2 1.40e- 1 ns -#> 6 grp3 grp4 3.06e- 2 9.19e- 2 ns
    +#> * <chr> <chr> <dbl> <dbl> <chr> +#> 1 grp1 grp2 1.25e-10 6.23e-10 **** +#> 2 grp1 grp3 3.09e-13 1.86e-12 **** +#> 3 grp2 grp3 1 e+ 0 1 e+ 0 ns +#> 4 grp1 grp4 6.41e- 6 2.56e- 5 **** +#> 5 grp2 grp4 7.01e- 2 1.4 e- 1 ns +#> 6 grp3 grp4 3.06e- 2 9.19e- 2 ns
    # Pairwise proportion tests #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -334,15 +334,15 @@

    Examp #> Survived 1st 2nd 3rd Crew #> No 122 167 528 673 #> Yes 203 118 178 212

    # Compare the proportion of survived between groups -pairwise_prop_test(xtab)
    #> # A tibble: 6 x 5 +pairwise_prop_test(xtab)
    #> # A tibble: 6 x 5 #> group1 group2 p p.adj p.adj.signif -#> * <chr> <chr> <dbl> <dbl> <chr> -#> 1 1st 2nd 3.13e- 7 9.38e- 7 **** -#> 2 1st 3rd 2.55e-30 1.27e-29 **** -#> 3 2nd 3rd 6.90e- 7 1.38e- 6 **** -#> 4 1st Crew 1.62e-35 9.73e-35 **** -#> 5 2nd Crew 1.94e- 8 7.75e- 8 **** -#> 6 3rd Crew 6.03e- 1 6.03e- 1 ns
    +#> * <chr> <chr> <dbl> <dbl> <chr> +#> 1 1st 2nd 3.13e- 7 9.38e- 7 **** +#> 2 1st 3rd 2.55e-30 1.27e-29 **** +#> 3 2nd 3rd 6.9 e- 7 1.38e- 6 **** +#> 4 1st Crew 1.62e-35 9.73e-35 **** +#> 5 2nd Crew 1.94e- 8 7.75e- 8 **** +#> 6 3rd Crew 6.03e- 1 6.03e- 1 ns
    # Row-wise proportion tests #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Data: Titanic @@ -360,13 +360,13 @@

    Examp #> 2nd 179 106 #> 3rd 510 196 #> Crew 862 23

    # Compare the proportion of males and females in each category -row_wise_prop_test(xtab)
    #> # A tibble: 4 x 7 +row_wise_prop_test(xtab)
    #> # A tibble: 4 x 7 #> group n statistic df p p.adj p.adj.signif -#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 1st 2201 121. 1 3.40e-28 1.02e-27 **** -#> 2 2nd 2201 47.8 1 4.65e-12 9.30e-12 **** -#> 3 3rd 2201 24.9 1 6.18e- 7 6.18e- 7 **** -#> 4 Crew 2201 308. 1 5.51e-69 2.20e-68 ****
    +#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 1st 2201 121. 1 3.4 e-28 1.02e-27 **** +#> 2 2nd 2201 47.8 1 4.65e-12 9.3 e-12 **** +#> 3 3rd 2201 24.9 1 6.18e- 7 6.18e- 7 **** +#> 4 Crew 2201 308. 1 5.51e-69 2.2 e-68 **** @@ -178,10 +178,10 @@

    Examp #> stone 30-39 40-49 50-59 #> yes 384 536 335 #> no 951 869 438
    # Compare the proportion of survived between groups -prop_trend_test(xtab)
    #> # A tibble: 1 x 6 +prop_trend_test(xtab)
    #> # A tibble: 1 x 6 #> n statistic p p.signif df method -#> * <dbl> <dbl> <dbl> <chr> <dbl> <chr> -#> 1 3513 49.7 1.78e-12 **** 1 Chi-square trend test
    +#> * <dbl> <dbl> <dbl> <chr> <dbl> <chr> +#> 1 3513 49.7 1.78e-12 **** 1 Chi-square trend test @@ -180,15 +180,15 @@

    Examp #:::::::::::::::::::::::::::::::::::::::::: # Correlation matrix cor.mat <- cor_mat(mydata) -cor.mat
    #> # A tibble: 6 x 7 +cor.mat
    #> # A tibble: 6 x 7 #> rowname mpg disp hp drat wt qsec -#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 -#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 -#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 -#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 -#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 -#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    +#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 +#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 +#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 +#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 +#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 +#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    # Pull lower triangular part cor.mat %>% pull_lower_triangle()
    #> rowname mpg disp hp drat wt qsec #> 1 mpg diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index bb728ba..595cc4f 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -87,7 +87,7 @@ rstatix - 0.7.0 + 0.7.1
    @@ -139,7 +139,7 @@

    Objects exported from other packages

    dplyr

    desc, filter, group_by, mutate, select

    -
    generics

    augment, tidy

    +
    generics

    augment, tidy

    tibble

    tibble

    diff --git a/docs/reference/remove_ns.html b/docs/reference/remove_ns.html index a986d86..010f372 100644 --- a/docs/reference/remove_ns.html +++ b/docs/reference/remove_ns.html @@ -75,7 +75,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -157,14 +157,14 @@

    Examp
    # Statistical test stat.test <- PlantGrowth %>% wilcox_test(weight ~ group) # Remove ns: automatic detection of p-value columns -stat.test %>% remove_ns()
    #> # A tibble: 1 x 9 +stat.test %>% remove_ns()
    #> # A tibble: 1 x 9 #> .y. group1 group2 n1 n2 statistic p p.adj p.adj.signif -#> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr> -#> 1 weight trt1 trt2 10 10 16 0.009 0.027 *
    # Remove ns by the column p -stat.test %>% remove_ns(col ="p")
    #> # A tibble: 1 x 9 +#> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr> +#> 1 weight trt1 trt2 10 10 16 0.009 0.027 *
    # Remove ns by the column p +stat.test %>% remove_ns(col ="p")
    #> # A tibble: 1 x 9 #> .y. group1 group2 n1 n2 statistic p p.adj p.adj.signif -#> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr> -#> 1 weight trt1 trt2 10 10 16 0.009 0.027 *
    +#> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr> +#> 1 weight trt1 trt2 10 10 16 0.009 0.027 * @@ -178,15 +178,15 @@

    Examp cor.mat <- mtcars %>% select(mpg, disp, hp, drat, wt, qsec) %>% cor_mat() - cor.mat
    #> # A tibble: 6 x 7 + cor.mat
    #> # A tibble: 6 x 7 #> rowname mpg disp hp drat wt qsec -#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 -#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 -#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 -#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 -#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 -#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    +#> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 mpg 1 -0.85 -0.78 0.68 -0.87 0.42 +#> 2 disp -0.85 1 0.79 -0.71 0.89 -0.43 +#> 3 hp -0.78 0.79 1 -0.45 0.66 -0.71 +#> 4 drat 0.68 -0.71 -0.45 1 -0.71 0.091 +#> 5 wt -0.87 0.89 0.66 -0.71 1 -0.17 +#> 6 qsec 0.42 -0.43 -0.71 0.091 -0.17 1
    # Replace upper triangle by NA #:::::::::::::::::::::::::::::::::::::::::: cor.mat %>% replace_upper_triangle(by = NA)
    #> rowname mpg disp hp drat wt qsec diff --git a/docs/reference/sample_n_by.html b/docs/reference/sample_n_by.html index cedc302..426d465 100644 --- a/docs/reference/sample_n_by.html +++ b/docs/reference/sample_n_by.html @@ -74,7 +74,7 @@ rstatix - 0.7.0 + 0.7.1
    @@ -147,21 +147,21 @@

    Arg

    Examples

    -
    ToothGrowth %>% sample_n_by(dose, supp, size = 2)
    #> # A tibble: 12 x 3 +
    ToothGrowth %>% sample_n_by(dose, supp, size = 2)
    #> # A tibble: 12 x 3 #> len supp dose -#> <dbl> <fct> <dbl> -#> 1 14.5 OJ 0.5 -#> 2 8.2 OJ 0.5 -#> 3 5.2 VC 0.5 -#> 4 7 VC 0.5 -#> 5 27.3 OJ 1 -#> 6 25.8 OJ 1 -#> 7 22.5 VC 1 -#> 8 13.6 VC 1 -#> 9 24.8 OJ 2 -#> 10 30.9 OJ 2 -#> 11 23.3 VC 2 -#> 12 18.5 VC 2
    +#> <dbl> <fct> <dbl> +#> 1 14.5 OJ 0.5 +#> 2 8.2 OJ 0.5 +#> 3 5.2 VC 0.5 +#> 4 7 VC 0.5 +#> 5 27.3 OJ 1 +#> 6 25.8 OJ 1 +#> 7 22.5 VC 1 +#> 8 13.6 VC 1 +#> 9 24.8 OJ 2 +#> 10 30.9 OJ 2 +#> 11 23.3 VC 2 +#> 12 18.5 VC 2
    @@ -172,21 +172,21 @@

    Fun

    Examples

    # Shapiro Wilk normality test for one variable -iris %>% shapiro_test(Sepal.Length)
    #> # A tibble: 1 x 3 +iris %>% shapiro_test(Sepal.Length)
    #> # A tibble: 1 x 3 #> variable statistic p -#> <chr> <dbl> <dbl> -#> 1 Sepal.Length 0.976 0.0102
    +#> <chr> <dbl> <dbl> +#> 1 Sepal.Length 0.976 0.0102
    # Shapiro Wilk normality test for two variables -iris %>% shapiro_test(Sepal.Length, Petal.Width)
    #> # A tibble: 2 x 3 +iris %>% shapiro_test(Sepal.Length, Petal.Width)
    #> # A tibble: 2 x 3 #> variable statistic p -#> <chr> <dbl> <dbl> -#> 1 Petal.Width 0.902 0.0000000168 -#> 2 Sepal.Length 0.976 0.0102
    +#> <chr> <dbl> <dbl> +#> 1 Petal.Width 0.902 0.0000000168 +#> 2 Sepal.Length 0.976 0.0102
    # Multivariate normality test -mshapiro_test(iris[, 1:3])
    #> # A tibble: 1 x 2 +mshapiro_test(iris[, 1:3])
    #> # A tibble: 1 x 2 #> statistic p.value -#> <dbl> <dbl> -#> 1 0.991 0.443
    +#> <dbl> <dbl> +#> 1 0.991 0.443
    @@ -255,17 +255,17 @@

    Examp # One-sample test #::::::::::::::::::::::::::::::::::::::::: -df %>% sign_test(len ~ 1, mu = 0)
    #> # A tibble: 1 x 7 +df %>% sign_test(len ~ 1, mu = 0)
    #> # A tibble: 1 x 7 #> .y. group1 group2 n statistic df p -#> * <chr> <chr> <chr> <int> <dbl> <dbl> <dbl> -#> 1 len 1 null model 60 60 60 1.73e-18
    +#> * <chr> <chr> <chr> <int> <dbl> <dbl> <dbl> +#> 1 len 1 null model 60 60 60 1.73e-18
    # Two-samples paired test #::::::::::::::::::::::::::::::::::::::::: -df %>% sign_test(len ~ supp)
    #> # A tibble: 1 x 8 +df %>% sign_test(len ~ supp)
    #> # A tibble: 1 x 8 #> .y. group1 group2 n1 n2 statistic df p -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> -#> 1 len OJ VC 30 30 19 29 0.136
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> +#> 1 len OJ VC 30 30 19 29 0.136
    # Compare supp levels after grouping the data by "dose" #:::::::::::::::::::::::::::::::::::::::: @@ -273,30 +273,30 @@

    Examp group_by(dose) %>% sign_test(data =., len ~ supp) %>% adjust_pvalue(method = "bonferroni") %>% - add_significance("p.adj")

    #> # A tibble: 3 x 11 + add_significance("p.adj")
    #> # A tibble: 3 x 11 #> dose .y. group1 group2 n1 n2 statistic df p p.adj p.adj.signif -#> <dbl> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 0.5 len OJ VC 10 10 7 9 0.18 0.54 ns -#> 2 1 len OJ VC 10 10 8 10 0.109 0.327 ns -#> 3 2 len OJ VC 10 10 4 10 0.754 1 ns
    +#> * <dbl> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 0.5 len OJ VC 10 10 7 9 0.18 0.54 ns +#> 2 1 len OJ VC 10 10 8 10 0.109 0.327 ns +#> 3 2 len OJ VC 10 10 4 10 0.754 1 ns
    # pairwise comparisons #:::::::::::::::::::::::::::::::::::::::: # As dose contains more than two levels ==> # pairwise test is automatically performed. -df %>% sign_test(len ~ dose)
    #> # A tibble: 3 x 10 +df %>% sign_test(len ~ dose)
    #> # A tibble: 3 x 10 #> .y. group1 group2 n1 n2 statistic df p p.adj p.adj.signif -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len 0.5 1 20 20 1 20 4.01e-5 8.02e-5 **** -#> 2 len 0.5 2 20 20 0 20 1.91e-6 5.73e-6 **** -#> 3 len 1 2 20 20 3 20 3.00e-3 3.00e-3 **
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len 0.5 1 20 20 1 20 4.01e-5 8.02e-5 **** +#> 2 len 0.5 2 20 20 0 20 1.91e-6 5.73e-6 **** +#> 3 len 1 2 20 20 3 20 3 e-3 3 e-3 **
    # Comparison against reference group #:::::::::::::::::::::::::::::::::::::::: # each level is compared to the ref group -df %>% sign_test(len ~ dose, ref.group = "0.5")
    #> # A tibble: 2 x 10 +df %>% sign_test(len ~ dose, ref.group = "0.5")
    #> # A tibble: 2 x 10 #> .y. group1 group2 n1 n2 statistic df p p.adj p.adj.signif -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len 0.5 1 20 20 1 20 4.01e-5 4.01e-5 **** -#> 2 len 0.5 2 20 20 0 20 1.91e-6 3.82e-6 ****
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len 0.5 1 20 20 1 20 4.01e-5 4.01e-5 **** +#> 2 len 0.5 2 20 20 0 20 1.91e-6 3.82e-6 ****
    diff --git a/docs/reference/t_test.html b/docs/reference/t_test.html index ef6d837..63319f8 100644 --- a/docs/reference/t_test.html +++ b/docs/reference/t_test.html @@ -75,7 +75,7 @@ rstatix - 0.7.0 + 0.7.1 @@ -291,62 +291,62 @@

    Examp # One-sample test #::::::::::::::::::::::::::::::::::::::::: -df %>% t_test(len ~ 1, mu = 0)
    #> # A tibble: 1 x 7 +df %>% t_test(len ~ 1, mu = 0)
    #> # A tibble: 1 x 7 #> .y. group1 group2 n statistic df p -#> * <chr> <chr> <chr> <int> <dbl> <dbl> <dbl> -#> 1 len 1 null model 60 19.1 59 6.94e-27
    +#> * <chr> <chr> <chr> <int> <dbl> <dbl> <dbl> +#> 1 len 1 null model 60 19.1 59 6.94e-27
    # Two-samples unpaired test #::::::::::::::::::::::::::::::::::::::::: -df %>% t_test(len ~ supp)
    #> # A tibble: 1 x 8 +df %>% t_test(len ~ supp)
    #> # A tibble: 1 x 8 #> .y. group1 group2 n1 n2 statistic df p -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> -#> 1 len OJ VC 30 30 1.92 55.3 0.0606
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> +#> 1 len OJ VC 30 30 1.92 55.3 0.0606
    # Two-samples paired test #::::::::::::::::::::::::::::::::::::::::: -df %>% t_test (len ~ supp, paired = TRUE)
    #> # A tibble: 1 x 8 +df %>% t_test (len ~ supp, paired = TRUE)
    #> # A tibble: 1 x 8 #> .y. group1 group2 n1 n2 statistic df p -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> -#> 1 len OJ VC 30 30 3.30 29 0.00255
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> +#> 1 len OJ VC 30 30 3.30 29 0.00255
    # Compare supp levels after grouping the data by "dose" #:::::::::::::::::::::::::::::::::::::::: df %>% group_by(dose) %>% t_test(data =., len ~ supp) %>% adjust_pvalue(method = "bonferroni") %>% - add_significance("p.adj")
    #> # A tibble: 3 x 11 + add_significance("p.adj")
    #> # A tibble: 3 x 11 #> dose .y. group1 group2 n1 n2 statistic df p p.adj -#> <dbl> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> -#> 1 0.5 len OJ VC 10 10 3.17 15.0 0.00636 0.0191 -#> 2 1 len OJ VC 10 10 4.03 15.4 0.00104 0.00312 -#> 3 2 len OJ VC 10 10 -0.0461 14.0 0.964 1 -#> # … with 1 more variable: p.adj.signif <chr>
    +#> * <dbl> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> +#> 1 0.5 len OJ VC 10 10 3.17 15.0 0.00636 0.0191 +#> 2 1 len OJ VC 10 10 4.03 15.4 0.00104 0.00312 +#> 3 2 len OJ VC 10 10 -0.0461 14.0 0.964 1 +#> # … with 1 more variable: p.adj.signif <chr>
    # pairwise comparisons #:::::::::::::::::::::::::::::::::::::::: # As dose contains more than two levels ==> # pairwise test is automatically performed. -df %>% t_test(len ~ dose)
    #> # A tibble: 3 x 10 +df %>% t_test(len ~ dose)
    #> # A tibble: 3 x 10 #> .y. group1 group2 n1 n2 statistic df p p.adj p.adj.signif -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 2.54e- 7 **** -#> 2 len 0.5 2 20 20 -11.8 36.9 4.40e-14 1.32e-13 **** -#> 3 len 1 2 20 20 -4.90 37.1 1.91e- 5 1.91e- 5 ****
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 2.54e- 7 **** +#> 2 len 0.5 2 20 20 -11.8 36.9 4.4 e-14 1.32e-13 **** +#> 3 len 1 2 20 20 -4.90 37.1 1.91e- 5 1.91e- 5 ****
    # Comparison against reference group #:::::::::::::::::::::::::::::::::::::::: # each level is compared to the ref group -df %>% t_test(len ~ dose, ref.group = "0.5")
    #> # A tibble: 2 x 10 +df %>% t_test(len ~ dose, ref.group = "0.5")
    #> # A tibble: 2 x 10 #> .y. group1 group2 n1 n2 statistic df p p.adj p.adj.signif -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 1.27e- 7 **** -#> 2 len 0.5 2 20 20 -11.8 36.9 4.40e-14 8.80e-14 ****
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len 0.5 1 20 20 -6.48 38.0 1.27e- 7 1.27e- 7 **** +#> 2 len 0.5 2 20 20 -11.8 36.9 4.4 e-14 8.8 e-14 ****
    # Comparison against all #:::::::::::::::::::::::::::::::::::::::: -df %>% t_test(len ~ dose, ref.group = "all")
    #> # A tibble: 3 x 10 +df %>% t_test(len ~ dose, ref.group = "all")
    #> # A tibble: 3 x 10 #> .y. group1 group2 n1 n2 statistic df p p.adj p.adj.signif -#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len all 0.5 60 20 5.82 56.4 2.90e-7 8.70e-7 **** -#> 2 len all 1 60 20 -0.660 57.5 5.12e-1 5.12e-1 ns -#> 3 len all 2 60 20 -5.61 66.5 4.25e-7 8.70e-7 ****
    +#> * <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len all 0.5 60 20 5.82 56.4 2.9 e-7 8.7 e-7 **** +#> 2 len all 1 60 20 -0.660 57.5 5.12e-1 5.12e-1 ns +#> 3 len all 2 60 20 -5.61 66.5 4.25e-7 8.7 e-7 ****
    @@ -193,66 +193,66 @@

    Examp df <- ToothGrowth df$dose <- as.factor(df$dose) # Tukey HSD from ANOVA results -aov(len ~ dose, data = df) %>% tukey_hsd()
    #> # A tibble: 3 x 9 +aov(len ~ dose, data = df) %>% tukey_hsd()
    #> # A tibble: 3 x 9 #> term group1 group2 null.value estimate conf.low conf.high p.adj -#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 dose 0.5 1 0 9.13 5.90 12.4 2.00e- 8 -#> 2 dose 0.5 2 0 15.5 12.3 18.7 1.12e-11 -#> 3 dose 1 2 0 6.36 3.14 9.59 4.25e- 5 -#> # … with 1 more variable: p.adj.signif <chr>
    +#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 dose 0.5 1 0 9.13 5.90 12.4 2 e- 8 +#> 2 dose 0.5 2 0 15.5 12.3 18.7 1.12e-11 +#> 3 dose 1 2 0 6.36 3.14 9.59 4.25e- 5 +#> # … with 1 more variable: p.adj.signif <chr>
    # two-way anova with interaction -aov(len ~ dose*supp, data = df) %>% tukey_hsd()
    #> # A tibble: 19 x 9 -#> term group1 group2 null.value estimate conf.low conf.high p.adj -#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 dose 0.5 1 0 9.13 6.36 11.9 3.55e-10 -#> 2 dose 0.5 2 0 15.5 12.7 18.3 4.38e-13 -#> 3 dose 1 2 0 6.36 3.60 9.13 2.71e- 6 -#> 4 supp OJ VC 0 -3.7 -5.58 -1.82 2.31e- 4 -#> 5 dose… 0.5:OJ 1:OJ 0 9.47 4.67 14.3 4.61e- 6 -#> 6 dose… 0.5:OJ 2:OJ 0 12.8 8.03 17.6 2.13e- 9 -#> 7 dose… 0.5:OJ 0.5:VC 0 -5.25 -10.0 -0.452 2.43e- 2 -#> 8 dose… 0.5:OJ 1:VC 0 3.54 -1.26 8.34 2.64e- 1 -#> 9 dose… 0.5:OJ 2:VC 0 12.9 8.11 17.7 1.77e- 9 -#> 10 dose… 1:OJ 2:OJ 0 3.36 -1.44 8.16 3.19e- 1 -#> 11 dose… 1:OJ 0.5:VC 0 -14.7 -19.5 -9.92 2.99e-11 -#> 12 dose… 1:OJ 1:VC 0 -5.93 -10.7 -1.13 7.39e- 3 -#> 13 dose… 1:OJ 2:VC 0 3.44 -1.36 8.24 2.94e- 1 -#> 14 dose… 2:OJ 0.5:VC 0 -18.1 -22.9 -13.3 4.86e-13 -#> 15 dose… 2:OJ 1:VC 0 -9.29 -14.1 -4.49 6.91e- 6 -#> 16 dose… 2:OJ 2:VC 0 0.0800 -4.72 4.88 1.00e+ 0 -#> 17 dose… 0.5:VC 1:VC 0 8.79 3.99 13.6 2.10e- 5 -#> 18 dose… 0.5:VC 2:VC 0 18.2 13.4 23.0 4.82e-13 -#> 19 dose… 1:VC 2:VC 0 9.37 4.57 14.2 5.77e- 6 -#> # … with 1 more variable: p.adj.signif <chr>
    +aov(len ~ dose*supp, data = df) %>% tukey_hsd()
    #> # A tibble: 19 x 9 +#> term group1 group2 null.value estimate conf.low conf.high p.adj +#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 dose 0.5 1 0 9.13 6.36 11.9 3.55e-10 +#> 2 dose 0.5 2 0 15.5 12.7 18.3 4.38e-13 +#> 3 dose 1 2 0 6.36 3.60 9.13 2.71e- 6 +#> 4 supp OJ VC 0 -3.70 -5.58 -1.82 2.31e- 4 +#> 5 dose:supp 0.5:OJ 1:OJ 0 9.47 4.67 14.3 4.61e- 6 +#> 6 dose:supp 0.5:OJ 2:OJ 0 12.8 8.03 17.6 2.13e- 9 +#> 7 dose:supp 0.5:OJ 0.5:VC 0 -5.25 -10.0 -0.452 2.43e- 2 +#> 8 dose:supp 0.5:OJ 1:VC 0 3.54 -1.26 8.34 2.64e- 1 +#> 9 dose:supp 0.5:OJ 2:VC 0 12.9 8.11 17.7 1.77e- 9 +#> 10 dose:supp 1:OJ 2:OJ 0 3.36 -1.44 8.16 3.19e- 1 +#> 11 dose:supp 1:OJ 0.5:VC 0 -14.7 -19.5 -9.92 2.99e-11 +#> 12 dose:supp 1:OJ 1:VC 0 -5.93 -10.7 -1.13 7.39e- 3 +#> 13 dose:supp 1:OJ 2:VC 0 3.44 -1.36 8.24 2.94e- 1 +#> 14 dose:supp 2:OJ 0.5:VC 0 -18.1 -22.9 -13.3 4.86e-13 +#> 15 dose:supp 2:OJ 1:VC 0 -9.29 -14.1 -4.49 6.91e- 6 +#> 16 dose:supp 2:OJ 2:VC 0 0.0800 -4.72 4.88 1 e+ 0 +#> 17 dose:supp 0.5:VC 1:VC 0 8.79 3.99 13.6 2.1 e- 5 +#> 18 dose:supp 0.5:VC 2:VC 0 18.2 13.4 23.0 4.82e-13 +#> 19 dose:supp 1:VC 2:VC 0 9.37 4.57 14.2 5.77e- 6 +#> # … with 1 more variable: p.adj.signif <chr>
    # Tukey HSD from lm() results -lm(len ~ dose, data = df) %>% tukey_hsd()
    #> # A tibble: 3 x 9 +lm(len ~ dose, data = df) %>% tukey_hsd()
    #> # A tibble: 3 x 9 #> term group1 group2 null.value estimate conf.low conf.high p.adj -#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 dose 0.5 1 0 9.13 5.90 12.4 2.00e- 8 -#> 2 dose 0.5 2 0 15.5 12.3 18.7 1.12e-11 -#> 3 dose 1 2 0 6.36 3.14 9.59 4.25e- 5 -#> # … with 1 more variable: p.adj.signif <chr>
    +#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 dose 0.5 1 0 9.13 5.90 12.4 2 e- 8 +#> 2 dose 0.5 2 0 15.5 12.3 18.7 1.12e-11 +#> 3 dose 1 2 0 6.36 3.14 9.59 4.25e- 5 +#> # … with 1 more variable: p.adj.signif <chr>
    # Tukey HSD from data frame and formula -tukey_hsd(df, len ~ dose)
    #> # A tibble: 3 x 9 +tukey_hsd(df, len ~ dose)
    #> # A tibble: 3 x 9 #> term group1 group2 null.value estimate conf.low conf.high p.adj -#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 dose 0.5 1 0 9.13 5.90 12.4 2.00e- 8 -#> 2 dose 0.5 2 0 15.5 12.3 18.7 1.12e-11 -#> 3 dose 1 2 0 6.36 3.14 9.59 4.25e- 5 -#> # … with 1 more variable: p.adj.signif <chr>
    +#> * <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 dose 0.5 1 0 9.13 5.90 12.4 2 e- 8 +#> 2 dose 0.5 2 0 15.5 12.3 18.7 1.12e-11 +#> 3 dose 1 2 0 6.36 3.14 9.59 4.25e- 5 +#> # … with 1 more variable: p.adj.signif <chr>
    # Tukey HSD using grouped data df %>% group_by(supp) %>% - tukey_hsd(len ~ dose)
    #> # A tibble: 6 x 10 + tukey_hsd(len ~ dose)
    #> # A tibble: 6 x 10 #> supp term group1 group2 null.value estimate conf.low conf.high p.adj -#> * <fct> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 OJ dose 0.5 1 0 9.47 5.31 13.6 1.58e- 5 -#> 2 OJ dose 0.5 2 0 12.8 8.67 17.0 9.39e- 8 -#> 3 OJ dose 1 2 0 3.36 -0.800 7.52 1.31e- 1 -#> 4 VC dose 0.5 1 0 8.79 4.90 12.7 1.75e- 5 -#> 5 VC dose 0.5 2 0 18.2 14.3 22.0 1.66e-11 -#> 6 VC dose 1 2 0 9.37 5.48 13.3 6.61e- 6 -#> # … with 1 more variable: p.adj.signif <chr>
    +#> * <fct> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 OJ dose 0.5 1 0 9.47 5.31 13.6 1.58e- 5 +#> 2 OJ dose 0.5 2 0 12.8 8.67 17.0 9.39e- 8 +#> 3 OJ dose 1 2 0 3.36 -0.800 7.52 1.31e- 1 +#> 4 VC dose 0.5 1 0 8.79 4.90 12.7 1.75e- 5 +#> 5 VC dose 0.5 2 0 18.2 14.3 22.0 1.66e-11 +#> 6 VC dose 1 2 0 9.37 5.48 13.3 6.61e- 6 +#> # … with 1 more variable: p.adj.signif <chr>
    @@ -169,19 +169,19 @@

    Examp # Welch one-way ANOVA test (not assuming equal variance) #::::::::::::::::::::::::::::::::::::::::: -df %>% welch_anova_test(len ~ dose)
    #> # A tibble: 1 x 7 +df %>% welch_anova_test(len ~ dose)
    #> # A tibble: 1 x 7 #> .y. n statistic DFn DFd p method -#> * <chr> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 len 60 68.4 2 37.7 2.81e-13 Welch ANOVA
    +#> * <chr> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 len 60 68.4 2 37.7 2.81e-13 Welch ANOVA
    # Grouped data #::::::::::::::::::::::::::::::::::::::::: df %>% group_by(supp) %>% - welch_anova_test(len ~ dose)
    #> # A tibble: 2 x 8 + welch_anova_test(len ~ dose)
    #> # A tibble: 2 x 8 #> supp .y. n statistic DFn DFd p method -#> * <fct> <chr> <int> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 OJ len 30 29.4 2 17.1 0.00000295 Welch ANOVA -#> 2 VC len 30 59.4 2 17.2 0.0000000194 Welch ANOVA
    +#> * <fct> <chr> <int> <dbl> <dbl> <dbl> <dbl> <chr> +#> 1 OJ len 30 29.4 2 17.1 0.00000295 Welch ANOVA +#> 2 VC len 30 59.4 2 17.2 0.0000000194 Welch ANOVA @@ -286,15 +286,15 @@

    Examp }
    #> Le chargement a nécessité le package : coin
    #> Le chargement a nécessité le package : survival
    #> #> Attachement du package : ‘coin’
    #> The following objects are masked from ‘package:rstatix’: #> -#> chisq_test, friedman_test, kruskal_test, sign_test, wilcox_test
    #> # A tibble: 6 x 8 +#> chisq_test, friedman_test, kruskal_test, sign_test, wilcox_test
    #> # A tibble: 6 x 8 #> .y. group1 group2 effsize supp n1 n2 magnitude -#> * <chr> <chr> <chr> <dbl> <fct> <int> <int> <ord> -#> 1 len 0.5 1 0.719 OJ 10 10 large -#> 2 len 0.5 2 0.846 OJ 10 10 large -#> 3 len 1 2 0.398 OJ 10 10 moderate -#> 4 len 0.5 1 0.846 VC 10 10 large -#> 5 len 0.5 2 0.845 VC 10 10 large -#> 6 len 1 2 0.795 VC 10 10 large
    +#> * <chr> <chr> <chr> <dbl> <fct> <int> <int> <ord> +#> 1 len 0.5 1 0.719 OJ 10 10 large +#> 2 len 0.5 2 0.846 OJ 10 10 large +#> 3 len 1 2 0.398 OJ 10 10 moderate +#> 4 len 0.5 1 0.846 VC 10 10 large +#> 5 len 0.5 2 0.845 VC 10 10 large +#> 6 len 1 2 0.795 VC 10 10 large