-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.qmd
58 lines (48 loc) · 2.3 KB
/
index.qmd
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
---
title: "About lavaan"
format: html
---
### News:
- (pinned): Exciting things are being planned for lavaan’s future development!
Click [here](https://lavaan.ugent.be/about/donate.html) to read more, or
use the donate button below to donate to our efforts:
<form action="https://actieplatform.ugent.be/en-GB/p/lavaan-project/step-1" method="get" target="_blank"><button class="btn btn-outline-warning" type="submit">DONATE for lavaan</button></form>
- (26 September 2024): lavaan version 0.6-19 has been released on
[CRAN](https://cran.r-project.org/web/packages/lavaan/). See [Version
History](http://lavaan.ugent.be/history/dot6.html) for more information.
- (1 Aug 2024): the lavaan discussion group is back online.
- (15 July 2024): the lavaan discussion group was taken offline (by google)
after a spam attack.
- (7 June 2024): lavaan version 0.6-18 has been released on
[CRAN](https://cran.r-project.org/web/packages/lavaan/). See [Version
History](http://lavaan.ugent.be/history/dot6.html) for more information.
### What is lavaan?
The lavaan package is developed to provide useRs, researchers and teachers a free open-source, but commercial-quality package for latent variable modeling. You can use lavaan to estimate a large variety of multivariate statistical models, including path analysis, confirmatory factor analysis, structural equation modeling and growth curve models.
::: callout-tip
## The official reference to the lavaan package is the following paper:
Yves Rosseel (2012). lavaan: An R Package for Structural Equation Modeling. *Journal of Statistical Software*, 48(2), 1-36. URL <http://www.jstatsoft.org/v48/i02/>
:::
### First impression
To get a first impression of how lavaan works in practice, consider the following example of a SEM model. The figure below contains a graphical representation of the model that we want to fit.
![](/figures/sem.png){fig-alt="lavaan example" width="70%"}
This is the corresponding lavaan model syntax:
```{r, eval=FALSE}
myModel <- '
# latent variables
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem65 =~ y5 + y6 + y7 + y8
# regressions
dem60 ~ ind60
dem65 ~ ind60 + dem60
# residual covariances
y1 ~~ y5
y2 ~~ y4 + y6
y3 ~~ y7
y4 ~~ y8
y6 ~~ y8
'
fit <- sem(model = myModel,
data = PoliticalDemocracy)
summary(fit)
```