/
effectsize.Rmd
81 lines (61 loc) · 1.93 KB
/
effectsize.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
title: "Plotting Functions for the 'effectsize' Package"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Plotting Functions for the 'effectsize' Package}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include=FALSE, warning=FALSE, message=FALSE, echo=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.width = 7,
fig.height = 5,
warning = FALSE,
message = FALSE
)
pkgs <- c("effectsize", "ggplot2", "poorman")
successfully_loaded <- vapply(pkgs, requireNamespace, FUN.VALUE = logical(1L), quietly = TRUE)
can_evaluate <- all(successfully_loaded)
if (can_evaluate) {
knitr::opts_chunk$set(eval = TRUE)
vapply(pkgs, require, FUN.VALUE = logical(1L), quietly = TRUE, character.only = TRUE)
} else {
knitr::opts_chunk$set(eval = FALSE)
}
```
This vignette can be referred to by citing the package:
```{r}
citation("see")
```
# Introduction
The *effectsize* package in *easystats* provides utilities to work with indices of effect size and standardized parameters, allowing computation and conversion of indices such as Cohen’s *d*, *r*, odds-ratios, etc.
For more, see: <https://easystats.github.io/effectsize/>
# Setup
```{r setup}
library(effectsize)
library(see)
data(mtcars)
data(iris)
```
# Effect size tables
_([related function documentation](https://easystats.github.io/effectsize/reference/eta_squared.html))_
```{r}
aov(mpg ~ factor(am) * factor(cyl), data = mtcars) %>%
eta_squared() %>%
plot()
t_to_d(t = c(1, -1.3, -3, 2.3), df_error = c(40, 35, 40, 85)) %>%
plot()
```
# Equivalence tests
_([related function documentation](https://easystats.github.io/effectsize/reference/equivalence_test.effectsize_table.html))_
```{r}
aov(mpg ~ factor(am) * factor(cyl), data = mtcars) %>%
eta_squared() %>%
equivalence_test(range = 0.3) %>%
plot()
t_to_d(t = c(1, -1.3, -3, 2.3), df_error = c(40, 35, 40, 85)) %>%
equivalence_test(range = 1) %>%
plot()
```