ggstatsplot (version 0.0.11)

subtitle_anova_parametric: Making text subtitle for parametric ANOVA.

Description

Making text subtitle for parametric ANOVA.

Usage

subtitle_anova_parametric(data, x, y, paired = FALSE,
  effsize.type = "unbiased", partial = TRUE, conf.level = 0.95,
  nboot = 100, var.equal = FALSE, sphericity.correction = TRUE,
  k = 2, 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.

effsize.type

Type of effect size needed for parametric tests. The argument can be "biased" ("d" for Cohen's d for t-test; "partial_eta" for partial eta-squared for anova) or "unbiased" ("g" Hedge's g for t-test; "partial_omega" for partial omega-squared for anova)).

partial

Logical that decides if partial eta-squared or omega-squared are returned (Default: TRUE). If FALSE, eta-squared or omega-squared will be returned. Valid only for objects of class lm, aov, anova, or aovlist.

conf.level

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

nboot

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

var.equal

a logical variable indicating whether to treat the variances in the samples as equal. If TRUE, then a simple F test for the equality of means in a one-way analysis of variance is performed. If FALSE, an approximate method of Welch (1951) is used, which generalizes the commonly known 2-sample Welch test to the case of arbitrarily many samples.

sphericity.correction

Logical that decides whether to apply correction to account for violation of sphericity in a repeated measures design ANOVA (Default: TRUE).

k

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

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 {
# for reproducibility
set.seed(123)
library(ggstatsplot)

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

# with defaults
ggstatsplot::subtitle_anova_parametric(
  data = ggplot2::msleep,
  x = vore,
  y = sleep_rem,
  paired = FALSE,
  k = 3
)

# modifying the defaults
ggstatsplot::subtitle_anova_parametric(
  data = ggplot2::msleep,
  x = vore,
  y = sleep_rem,
  paired = FALSE,
  effsize.type = "biased",
  partial = FALSE,
  var.equal = TRUE,
  nboot = 10
)

# -------------------- repeated measures ------------------------------

ggstatsplot::subtitle_anova_parametric(
  data = iris_long,
  x = condition,
  y = value,
  paired = TRUE,
  k = 4,
  nboot = 10
)
# }

Run the code above in your browser using DataLab