mean_diff: Compute Effect Size(s)

Description Usage Arguments Value See Also Examples

View source: R/effectsize.R

Description

For each pair of observations in a dabest object, a desired effect size can be computed. Currently there are five effect sizes available:

Usage

1
2
3
4
5
6
7
8
9
mean_diff(x, ci = 95, reps = 5000, seed = 12345)

median_diff(x, ci = 95, reps = 5000, seed = 12345)

cohens_d(x, ci = 95, reps = 5000, seed = 12345)

hedges_g(x, ci = 95, reps = 5000, seed = 12345)

cliffs_delta(x, ci = 95, reps = 5000, seed = 12345)

Arguments

x

A dabest object, generated by the dabest() function.

ci

float, default 95. The level of the confidence intervals produced. The default ci = 95 produces 95% CIs.

reps

integer, default 5000. The number of bootstrap resamples that will be generated.

seed

integer, default 12345. This specifies the seed used to set the random number generator. Setting a seed ensures that the bootstrap confidence intervals for the same data will remain stable over separate runs/calls of this function. See set.seed for more details.

Value

A dabest_effsize object with 10 elements.

data

The dataset passed to dabest(), as a tibble.

x and y

The columns in data used to plot the x and y axes, respectively, as supplied to dabest(). These are quoted variables for tidy evaluation during the computation of effect sizes.

idx

The vector of control-test groupings as initially passed to dabest().

is.paired

Whether or not the experiment consists of paired (aka repeated) observations. Originally supplied to dabest().

id.column

If is.paired is TRUE, the column in data that indicates the pairing of observations. As passed to dabest().

effect.size

The effect size being computed. One of the following: c("mean_diff", "median_diff", "cohens_d", "hedges_g", "cliffs_delta").

.data.name

The variable name of the dataset passed to dabest().

summary

A tibble with a row for the mean or median of each group in the x column of data, as indicated in idx.

result

A tibble with the following 15 columns:

control_group, test_group

The name of the control group and test group respectively.

control_size, test_size

The number of observations in the control group and test group respectively.

effect_size

The effect size used.

paired

Is the difference paired (TRUE) or not (FALSE)?

difference

The effect size of the difference between the two groups.

variable

The variable whose difference is being computed, ie. the column supplied to y.

ci

The ci passed to this function.

bca_ci_low, bca_ci_high

The lower and upper limits of the Bias Corrected and Accelerated bootstrap confidence interval.

pct_ci_low, pct_ci_high

The lower and upper limits of the percentile bootstrap confidence interval.

bootstraps

The vector of bootstrap resamples generated.

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Loading data for unpaired (two independent groups) analysis.
petal_widths <- dabest(iris, Species, Petal.Width,
                       idx = c("setosa", "versicolor"),
                       paired = FALSE)


# Compute the mean difference.
mean_diff(petal_widths)

# Plotting the mean differences.
mean_diff(petal_widths) %>% plot()

dabestr documentation built on July 13, 2020, 9:07 a.m.