You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: vignettes/convert.Rmd
+8-5
Original file line number
Diff line number
Diff line change
@@ -39,17 +39,20 @@ The `effectsize` package contains function to convert among indices of effect si
39
39
40
40
The most basic conversion is between *r* values, a measure of standardized association between two continuous measures, and *d* values (such as Cohen's *d*), a measure of standardized differences between two groups / conditions.
41
41
42
-
Let's look at the following data:
42
+
Let's simulate some data:
43
43
44
-
```{r, echo=FALSE}
44
+
```{r}
45
45
set.seed(1)
46
46
data <- bayestestR::simulate_difference(n = 10,
47
47
d = 0.2,
48
48
names = c("Group", "Outcome"))
49
-
data$Group <- as.numeric(data$Group)
49
+
```
50
+
51
+
```{r, echo=FALSE}
50
52
print(data, digits = 3)
51
53
```
52
54
55
+
53
56
We can compute Cohen's *d* between the two groups:
54
57
55
58
```{r}
@@ -58,8 +61,8 @@ cohens_d(Outcome ~ Group, data = data)
58
61
59
62
But we can also treat the 2-level `group` variable as a numeric variable, and compute Pearon's *r*:
Copy file name to clipboardexpand all lines: vignettes/standardize_parameters.Rmd
+5-8
Original file line number
Diff line number
Diff line change
@@ -62,11 +62,9 @@ standardize_parameters(m)
62
62
Standardizing the coefficient of this *simple* linear regression gives a value of `0.87`, but did you know that for a simple regression this is actually the **same as a correlation**? Thus, you can eventually apply some (*in*)famous interpretation guidelines (e.g., Cohen's rules of thumb).
63
63
64
64
```{r}
65
-
library(parameters)
66
-
67
65
r <- cor.test(iris$Sepal.Length, iris$Petal.Length)
68
66
69
-
model_parameters(r)
67
+
parameters::model_parameters(r)
70
68
```
71
69
72
70
@@ -165,7 +163,7 @@ However, not all hope is lost yet - we can still try and recover the partial cor
It seems like the best or most important predictor is `n_comps` as it has the coefficient. However, it is hard to compare among predictors, as they are on different scales. To address this issue, we must have all the predictors on the same scale - usually in the arbitrary unit of *standard deviations*.
@@ -258,8 +256,7 @@ Linear mixed models (LMM/HLM/MLM) offer an additional conundrum to standardizati
258
256
The solution: standardize according to level of the predictor [@hoffman2015longitudinal, page 342]! Level 1 parameters are standardized according to variance *withing* groups, while level 2 parameters are standardized according to variance *between* groups. The resulting standardized coefficient are also called *pseudo*-standardized coefficients.[^Note that like method `"basic"`, these are based on the model matrix.]
0 commit comments