ggstatsplot (version 0.0.12)

subtitle_anova_nonparametric: Making text subtitle for nonparametric ANOVA.

Description

For paired designs, the effect size is Kendall's coefficient of concordance (W), while for between-subjects designs, the effect size is epsilon-squared (for more, see ?rcompanion::epsilonSquared).

Usage

subtitle_anova_nonparametric(data, x, y, paired = FALSE,
  conf.type = "norm", conf.level = 0.95, k = 2, nboot = 100,
  stat.title = NULL, messages = TRUE, ...)

Arguments

data

A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted.

x

The grouping variable from the dataframe data.

y

The response (a.k.a. outcome or dependent) variable from the dataframe data.

paired

Logical that decides whether the design is repeated measures/within-subjects (in which case one-way Friedman Rank Sum Test will be carried out) or between-subjects (in which case one-way Kruskal<U+2013>Wallis H test will be carried out). The default is FALSE.

conf.type

A vector of character strings representing the type of intervals required. The value should be any subset of the values "norm", "basic", "perc", "bca". For more, see ?boot::boot.ci.

conf.level

Scalar between 0 and 1. If unspecified, the defaults return 95% lower and upper confidence intervals (0.95).

k

Number of digits after decimal point (should be an integer) (Default: k = 2).

nboot

Number of bootstrap samples for computing confidence interval for the effect size (Default: 100).

stat.title

A character describing the test being run, which will be added as a prefix in the subtitle. The default is NULL. An example of a stat.title argument will be something like "Student's t-test: ".

messages

Decides whether messages references, notes, and warnings are to be displayed (Default: TRUE).

...

Additional arguments.

Examples

Run this code
# NOT RUN {
# setup
set.seed(123)
library(ggstatsplot)

# -------------- within-subjects design --------------------------------

library(jmv)
data("bugs", package = "jmv")

# converting to long format
data_bugs <- bugs %>%
  tibble::as_tibble(.) %>%
  tidyr::gather(., key, value, LDLF:HDHF)

# creating the subtitle
ggstatsplot::subtitle_anova_nonparametric(
  data = data_bugs,
  x = key,
  y = value,
  paired = TRUE,
  conf.level = 0.99,
  k = 2
)

# -------------- between-subjects design --------------------------------

ggstatsplot::subtitle_anova_nonparametric(
  data = ggplot2::msleep,
  x = vore,
  y = sleep_rem,
  paired = FALSE,
  conf.level = 0.99,
  conf.type = "perc"
)
# }

Run the code above in your browser using DataCamp Workspace