ggstatsplot (version 0.0.10)

subtitle_template: Template for subtitles with statistical details for tests with a single parameter (e.g., t, chi-squared, etc.)

Description

Template for subtitles with statistical details for tests with a single parameter (e.g., t, chi-squared, etc.)

Usage

subtitle_template(no.parameters, stat.title = NULL, statistic.text,
  statistic, parameter = NULL, parameter2 = NULL, p.value,
  effsize.text, effsize.estimate, effsize.LL, effsize.UL, n,
  conf.level = 0.95, k = 3L, k.parameter = 0L)

Arguments

no.parameters

An integer that specifies that the number of parameters for the statistical test. Can be 0 for non-parametric tests, 1 for tests based on t-statistic or chi-squared statistic, 2 for tests based on F-statistic.

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: ".

statistic.text

A character that specifies the relevant test statistic. For example, for tests with t-statistic, statistic.text = "t". If you want to use plotmath, you will have to quote the argument (e.g., quote(italic("t"))).

statistic

The numeric value of a statistic.

parameter

The numeric value of a parameter being modeled (often degrees of freedom for the test). Default is NULL to accommodate non-parametric tests.

parameter2

Relevant only if the statistic in question has two degrees of freedom (default: NULL).

p.value

The two-sided p-value associated with the observed statistic.

effsize.text

A character that specifies the relevant effect size. For example, for Cohen's d statistic, effsize.text = "d". If you want to use plotmath, you will have to quote the argument (e.g., quote(italic("d"))).

effsize.estimate, effsize.LL, effsize.UL

The estimated value of the effect size, its lower bound, and its upper.

n

An integer specifying the sample size used for the test.

conf.level

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

k

Number of decimal places to display (default: 3).

k.parameter

Number of decimal places to display for the parameter (default: 0).

Examples

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

# subtitle for *t*-statistic with Cohen's *d* as effect size
ggstatsplot::subtitle_template(
  no.parameters = 1L,
  statistic.text = quote(italic("t")),
  statistic = 5.494,
  parameter = 29.234,
  p.value = 0.00001,
  effsize.text = quote(italic("d")),
  effsize.estimate = -1.980,
  effsize.LL = -2.873,
  effsize.UL = -1.088,
  n = 32L,
  conf.level = 0.95,
  k = 3L,
  k.parameter = 3L
)
# }

Run the code above in your browser using DataCamp Workspace