Making text subtitle for one sample t-test and its nonparametric and robust equivalents.
subtitle_t_onesample(data, x, type = "parametric", test.value = 0,
bf.prior = 0.707, robust.estimator = "onestep", effsize.type = "g",
effsize.noncentral = TRUE, conf.level = 0.95, conf.type = "norm",
nboot = 100, k = 2, stat.title = NULL, messages = TRUE, ...)
A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted.
A numeric variable.
Type of statistic expected ("parametric"
or "nonparametric"
or "robust"
or "bayes"
).Corresponding abbreviations are also accepted:
"p"
(for parametric), "np"
(nonparametric), "r"
(robust), or
"bf"
resp.
A number specifying the value of the null hypothesis
(Default: 0
).
A number between 0.5
and 2
(default 0.707
), the prior
width to use in calculating Bayes factors.
If test = "robust"
robust estimator to be used
("onestep"
(Default), "mom"
, or "median"
). For more, see
?WRS2::onesampb
.
Type of effect size needed for parametric tests. The
argument can be "biased"
("d"
for Cohen's d) or "unbiased"
("g"
Hedge's g for t-test). The default is
Logical indicating whether to use non-central
t-distributions for computing the confidence interval for Cohen's d
or Hedge's g (Default: TRUE
).
Scalar between 0 and 1. If unspecified, the defaults return
95%
lower and upper confidence intervals (0.95
).
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
.
Number of bootstrap samples for computing confidence interval
for the effect size (Default: 100
).
Number of digits after decimal point (should be an integer)
(Default: k = 2
).
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: "
.
Decides whether messages references, notes, and warnings are
to be displayed (Default: TRUE
).
Additional arguments.
# NOT RUN {
# for reproducibility
set.seed(123)
ggstatsplot::subtitle_t_onesample(
data = iris,
x = Sepal.Length,
test.value = 5,
type = "r"
)
# }
Run the code above in your browser using DataCamp Workspace