'Wrapper Function for ggstatsplot::ggbarstats and ggstatsplot::grouped_ggbarstats to generate Bar Charts.'
Usage
jjbarstats(
data,
dep,
group,
grvar = NULL,
counts = NULL,
excl = FALSE,
typestatistics = "parametric",
pairwisecomparisons = FALSE,
pairwisedisplay = "significant",
padjustmethod = "holm",
originaltheme = FALSE,
resultssubtitle = FALSE,
messages = FALSE,
paired = FALSE,
label = "percentage",
digits = 2,
digitsperc = 0,
proportiontest = FALSE,
bfmessage = FALSE,
conflevel = 0.95,
ratio = "",
clinicalpreset = "custom",
showexplanations = FALSE
)Arguments
- data
The data as a data frame.
- dep
.
- group
.
- grvar
.
- counts
A variable in data containing counts, or NULL if each row represents a single observation.
- excl
.
- typestatistics
.
- pairwisecomparisons
.
- pairwisedisplay
.
- padjustmethod
.
- originaltheme
.
- resultssubtitle
Display statistical test results in plot subtitle. Disabling improves performance significantly.
- messages
Display statistical messages in console. Disabling improves performance.
- paired
Logical indicating whether data came from a within-subjects or repeated measures design study. If TRUE, McNemar's test will be used. If FALSE, Pearson's chi-square test will be used.
- label
What information needs to be displayed on the label in each bar segment.
- digits
Number of digits after decimal point for statistical results.
- digitsperc
Number of decimal places for percentage labels.
- proportiontest
Decides whether proportion test for x variable is to be carried out for each level of y.
- bfmessage
Display Bayes Factor in favor of the null hypothesis. Only relevant for parametric test.
- conflevel
Confidence/credible interval level.
- ratio
A comma-separated list of expected proportions for the proportion test (should sum to 1). For example: '0.5,0.5' for two equal groups or '0.25,0.25,0.25,0.25' for four equal groups. Leave empty for equal theoretical proportions.
- clinicalpreset
Predefined configurations for common clinical scenarios. Automatically sets appropriate statistical methods and parameters.
- showexplanations
Display detailed explanations of statistical methods, assumptions, and clinical interpretations to guide analysis and result interpretation.