
Last chance! 50% off unlimited learning
Sale ends in
This is going to be a chi-squared Goodness of fit test.
subtitle_onesample_proptest(data, main, counts = NULL, ratio = NULL,
conf.level = 0.95, conf.type = "norm", nboot = 100,
stat.title = NULL, legend.title = NULL, k = 2, messages = TRUE,
...)
A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted.
The variable to use as the rows in the contingency table.
A string naming a variable in data containing counts, or NULL
if each row represents a single observation (Default).
A vector of numbers: the expected proportions for the proportion
test. Default is NULL
, which means if there are two levels ratio = c(1,1)
, etc.
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
).
Title for the effect being investigated with the chi-square
test. The default is NULL
, i.e. no title will be added to describe the
effect being shown. An example of a stat.title
argument will be something
like "main x condition"
or "interaction"
.
Title text for the legend.
Number of digits after decimal point (should be an integer)
(Default: k = 2
).
Decides whether messages references, notes, and warnings are
to be displayed (Default: TRUE
).
Additional arguments (currently ignored).
For more details about how the effect sizes and their confidence
intervals were computed, see documentation in ?rcompanion::cramerVFit
.
# NOT RUN {
# for reproducibility
set.seed(123)
library(jmv)
# with counts
subtitle_onesample_proptest(
data = as.data.frame(HairEyeColor),
main = Eye,
counts = Freq,
ratio = c(0.2, 0.2, 0.3, 0.3)
)
# in case of no variation, only sample size will be shown
subtitle_onesample_proptest(
data = cbind.data.frame(x = rep("a", 10)),
main = x
)
# }
Run the code above in your browser using DataLab