Descriptive statiscs of latent variables

652 views
Skip to first unread message

Eran Itskovich

unread,
Aug 8, 2022, 12:23:13 PM8/8/22
to lavaan
Hi all, 

I produced a model with 5 latent variables. In my reporting of the reults I want to include the following statistics for the latent variables: N, mean, and standard deviation.
I have found a way to get the means, using "lavinspect(fit, what = "mean.lv")", but couldn't figure out how to get the N and standard deviation. Is that possible?

In addition, the mean of 4 of my 5 latent variables is negative. Does it makes sense?

Thanks,
Eran

Jeremy Miles

unread,
Aug 8, 2022, 12:49:04 PM8/8/22
to lav...@googlegroups.com
The mean and standard deviation of latent variables is arbitrary, it depends on what constraints you place on the model (there are conventions that are used by almost everyone, but you don't have to use them). You can make them take on any value you want (well, as long as the SD is negative).

The standard model output gives the variance if the latent variable is exogenous, and the residual variance if it's not. It's rare to report the variance of an endogenous latent variable.

The N is the size of your sample used in the analysis. The variable is latent - unmeasured, hidden. Everyone in the sample is assumed to have a value of it.

Hope that this helps,

Jeremy



--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/47eee934-5e0b-46c1-a340-ccede96d4291n%40googlegroups.com.

Shu Fai Cheung

unread,
Aug 8, 2022, 1:54:33 PM8/8/22
to lavaan
As long as you are aware of the important points shared by Jeremy, if you do want to report the SDs, lavInspect(fit, what = "cov.lv") gives you the model-implied variance-covariance matrix of the latent variables. The square roots of the diagonal elements are the model implied SDs of the latent variables.

I modified the example of cfa() to create two structural models to illustrate that changing the first indicator of a factor, which by default has its loading set to one, will change the variances and SDs this factor and its covariances with other factors:

``` r
library(lavaan)
#> This is lavaan 0.6-12
#> lavaan is FREE software! Please report any bugs.
HS.model <- ' visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9
              visual ~ textual + speed'
fit <- sem(HS.model, data = HolzingerSwineford1939)
lavInspect(fit, "cov.lv")
#>         visual textul speed
#> visual  0.809              
#> textual 0.408  0.979      
#> speed   0.262  0.173  0.384

HS.model.2 <- ' visual  =~ x3 + x2 + x1
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9
              visual ~ textual + speed'
fit2 <- sem(HS.model.2, data = HolzingerSwineford1939)
lavInspect(fit2, "cov.lv")
#>         visual textul speed
#> visual  0.431              
#> textual 0.298  0.979      
#> speed   0.191  0.173  0.384
```


You can remove the line 'visual ~ textual + speed' and call cfa() to see what happen to the model implied variances and covariances.

Hope this helps.

-- Shu Fai

Eran Itskovich

unread,
Aug 9, 2022, 12:40:37 AM8/9/22
to lavaan
Thank you both!
Reply all
Reply to author
Forward
0 new messages