Skip to content

Commit fcd1e9b

Browse files
committed
vignette
1 parent 316f9ee commit fcd1e9b

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

vignettes/demean.Rmd

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Analysing Longitudinal or Panel Data"
3-
output:
3+
output:
44
rmarkdown::html_vignette:
55
toc: true
66
fig_width: 10.08
@@ -9,7 +9,7 @@ vignette: >
99
%\VignetteIndexEntry{Analysing Longitudinal or Panel Data}
1010
\usepackage[utf8]{inputenc}
1111
%\VignetteEngine{knitr::rmarkdown}
12-
editor_options:
12+
editor_options:
1313
chunk_output_type: console
1414
bibliography: bibliography.bib
1515
---
@@ -43,7 +43,7 @@ if (!all(sapply(pkgs, requireNamespace, quietly = TRUE))) {
4343
set.seed(333)
4444
```
4545

46-
This vignette explains the rational behind the `demean()` function.
46+
This vignette explains the rational behind the `demean()` function.
4747

4848
We give recommendations how to analyze multilevel or hierarchical data
4949
structures, when macro-indicators (or level-2 predictors, or higher-level units,
@@ -202,7 +202,7 @@ There are several ways how to address this using a mixed models approach:
202202
@gelman_data_2007, Chap. 12.6.].
203203

204204
* When time-varying predictors are "decomposed" into their time-varying and
205-
time-invariant components (demeaning), then mixed models can model **both**
205+
time-invariant components (de-meaning), then mixed models can model **both**
206206
within- and between-subject effects [@bell_fixed_2019] - this approach is
207207
essentially a further development of a long-known recommendation by Mundlak
208208
[@mundlak_pooling_1978].
@@ -284,7 +284,7 @@ rewb <- suppressWarnings(lmer(
284284

285285
**What about time-constant predictors?**
286286

287-
After demeaning time-varying predictors, "at the higher level, the mean term is
287+
After de-meaning time-varying predictors, "at the higher level, the mean term is
288288
no longer constrained by Level 1 effects, so it is free to account for all the
289289
higher-level variance associated with that variable" [@bell_explaining_2015].
290290

@@ -537,4 +537,14 @@ m2 <- lmer(y ~ x_between + (1 | grp), data = d)
537537
model_parameters(m2)
538538
```
539539

540+
# A final note - latent mean centering
541+
542+
It can be even more complicated. The person-mean is only observed, but the
543+
true value is not known. Thus, in certain situations, the coefficients after
544+
de-meaning still might be (more or less) biased, because it doesn't
545+
appropriately account for the uncertainty in the person-means. In this case,
546+
_latent mean centering_ is recommended, however, there are only few options
547+
to do this. One way is using the great **brms** package, and this approach
548+
[is described here](https://vuorre.netlify.app/posts/latent-mean-centering/).
549+
540550
# References

0 commit comments

Comments
 (0)