Skip to content

Commit 31e3c4e

Browse files
committed
minor changes too vignette
1 parent 612c335 commit 31e3c4e

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

vignettes/practical_inequalities.Rmd

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ The plot shows that individuals with higher education report a higher QoL, and t
104104

105105
For categorical predictors with only two levels, like low vs. high income groups or male vs. female sex, the absolute inequality is straightforward to compute: it's the difference between the estimated predictions for the two levels (simple pairwise comparison). However, for nominal or ordinal variables with multiple levels, we need to consider all pairwise differences.
106106

107-
The advantages of the `modelbased` package become most apparent when working with predictors that have *more than two levels*. In this case, the **absolute inequality** is the average of all absolute differences between the predicted outcomes for each pair of groups. It answers the question: "On average, how many units does the outcome differ between any two education groups?"
107+
The advantages of the `modelbased` package become most apparent when working with predictors that have *more than two levels*. In this case, the **absolute inequality** is the average of all absolute differences between the predicted outcomes for each pair of groups.
108+
109+
It answers the question:
110+
111+
> "On average, how many units does the outcome differ between *any two* education groups?"
108112
109113
### Pairwise Contrasts
110114

@@ -130,7 +134,13 @@ estimate_contrasts(m, contrast = "education", comparison = "inequality")
130134

131135
## 5. Relative Inequality
132136

133-
**Relative inequality** (or the inequality ratio) is the average of the ratios of predicted outcomes between all pairs of groups. It answers the question: "On average, by what factor does the outcome differ between any two education groups?" This is particularly useful when the scale of the outcome is not intrinsically meaningful or when comparing effects across different outcomes.
137+
**Relative inequality** (or the inequality ratio) is the average of the ratios of predicted outcomes between all pairs of groups.
138+
139+
It answers the question:
140+
141+
> "On average, by what factor does the outcome differ between *any two* education groups?"
142+
143+
This is particularly useful when the scale of the outcome is not intrinsically meaningful or when comparing effects across different outcomes.
134144

135145
### Pairwise Ratios
136146

@@ -273,11 +283,9 @@ estimate_contrasts(
273283
)
274284
```
275285

276-
<div class="custom_note">
277-
<p>
278-
In the above example, we set `integer_as_continuous = TRUE` to ensure that the time variable is treated as continuous, allowing us to calculate the slope differences correctly. By default, numeric variables with only a few integer values are treated as "discrete" (ordinal-alike), which would rather calculate contrasts for each time point and not the slope of a continuous `time` variable. See also [documentation of `estimate_contrasts()`](https://easystats.github.io/modelbased/reference/estimate_contrasts.html) for more details, especially the `...` argument and the examples.
279-
</p>
280-
</div>
286+
::: custom_note
287+
<p>In the above example, we set `integer_as_continuous = TRUE` to ensure that the time variable is treated as continuous, allowing us to calculate the slope differences correctly. By default, numeric variables with only a few integer values are treated as "discrete" (ordinal-alike), which would rather calculate contrasts for each time point and not the slope of a continuous `time` variable. See also [documentation of `estimate_contrasts()`](https://easystats.github.io/modelbased/reference/estimate_contrasts.html) for more details, especially the `...` argument and the examples.</p>
288+
:::
281289

282290
The mean difference in slopes is 4.74 in Group 1. This indicates that the rate of change in QoL differs, on average, by 4.74 points per unit of time between any two categories of the education groups. Inequalities are smaller in Group 2 (Mean Difference = 2.88), suggesting a more uniform change over time.
283291

@@ -304,21 +312,21 @@ Inequalities are calculated by means of *absolute* differences. This means, whil
304312

305313
The `modelbased` package offers a powerful and intuitive way to move beyond simple pairwise comparisons and summarize the holistic effect of categorical variables. By quantifying **absolute and relative inequalities**, researchers can:
306314

307-
* Obtain a single, interpretable effect size for a nominal or ordinal predictor.
308-
* Formally test whether this overall effect is statistically significant.
309-
* Compare the magnitude of inequality across different groups, models, or over time.
315+
- Obtain a single, interpretable effect size for a nominal or ordinal predictor.
316+
- Formally test whether this overall effect is statistically significant.
317+
- Compare the magnitude of inequality across different groups, models, or over time.
310318

311319
This approach aligns statistical practice with the theoretical concept of group-based disparities, providing a clearer and more comprehensive understanding of how social categories shape outcomes.
312320

313321
## Formula interface
314322

315323
The `modelbased` package also allows you to compute these inequalities using a formula interface for the `comparison` argument. The following table summarizes the available options for computing inequalities using the `estimate_contrasts()` function with a formula interface:
316324

317-
| String option | Formula |
318-
| :--- | :--- |
319-
| `"inequality"` | `~inequality` |
320-
| `"inequality_pairwise"` | `inequality ~ pairwise` |
321-
| `"inequality_ratio"` | `ratio ~ inequality` |
325+
| String option | Formula |
326+
|:------------------------------|:--------------------------------|
327+
| `"inequality"` | `~inequality` |
328+
| `"inequality_pairwise"` | `inequality ~ pairwise` |
329+
| `"inequality_ratio"` | `ratio ~ inequality` |
322330
| `"inequality_ratio_pairwise"` | `ratio ~ inequality + pairwise` |
323331

324332
Grouping variables are usually specified using the `by` argument. Additionally, these can also be specified in the formula interface, for example, `~inequality | group1` or `inequality ~ pairwise | group1 + group2`.

0 commit comments

Comments
 (0)