# How to compute and interpret the mean of a latent variable in structural equation modeling using lavaan

i am looking at a simple psychological construct defined by two Subscales A and B. My supervisor told me to estimate the latent means of A and B. Looking on cross validated i found a similar question: providing mean, sd, and correlations in sem .However the answer belongs to MPlus and i don´t know if i can simply translate it like that into code for lavaan.

## What i have done so far:

1.) lavaan model: constraining loadings (to 1) and intercepts (to 0) of A1 and B1, while estimating the intercepts and variances of the latent variables A and B freely.

  model ="A =~ A1 + A2 + A3 + A4 + A5
B =~ B1 + B2 + B3 + B4 + B5
A1 ~ 0*1
A2 ~ 0*1
A ~ NA*1
b ~ NA*1"


2.) estmating the model:

  sem = cfa(model, data = data, meanstructure = TRUE)
summary(sem)


## My questions:

1.) can i see the intercept of A and B as the mean of A and B?

2.) in the lavaan Documention -http://lavaan.ugent.be/tutorial/means.html- it says, that "By default, the cfa() and sem() functions fix the latent variable intercepts (which in this case correspond to the latent means) to zero.". Is this no longer true, because i have estimated the intercepts freely?

3.) How can i interpret the mean of the latent variables? Is it like the mean of the Subscale?

Means and intercepts of latent variables are kind of weird.

1. It looks to me like you've constrained the means of the intercepts to zero. If you haven't, then model is not identified.
2. You estimate the intercepts freely with:

A1 ~ 1


I don't think you did that. (But post your output if you want me to be sure.)

3. Means (and intercepts) of latent variables are not directly interpretable, because they are arbitrary. You can set the mean to be any value you want it to be. You can interpret latent variable means relative to each other - e.g. you can constrain one latent mean to be equal to 0 and (as long as there are identifying constraints), a second mean might be 1 - you can then say that the second mean is one unit higher than the first. But you can also constrain the first mean to be 16.5, and then you'll discover that the second mean is 17.5, so it's one unit higher.

After some months of studying I´ll guess I´m able to complete the answer given above.

concerning my own question

1.) Yes, the intercepts of A and B shown in the output of lavaan are the means of A and B

2.) just like it is said in the documentary: By Default the intercepts/means of the latent variables are fixed to Zero. You can estimate them freely using:

   A ~ 1
B ~ 1


or by:

   A ~ NA*1
B ~ NA*1


both have the same effect. However, referring to Jeremy: If you wish to estimate the latent variables mean/intercept freely, you have to set the intercept of one of the manifest variables (defining that latent variable) to zero. Otherwise the model will be not identified. Note: You can also fix intercepts to any value you like using:

   A ~ <value>*1
B ~ <value>*1


3.) the third question was already answered as well. However, here is an example on how to constrain one latent variable to 0, to compare the means.

(the data being used is given by the lavaan package)

    #install.packages("lavaan")

library(lavaan)
data = data("HolzingerSwineford1939")
HS.model =  "visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9

x1 ~ 0*1 # Setting the intercepts of the manifest
x4 ~ 0*1 # variables to zero
x7 ~ 0*1

visual ~ 0*1 # Setting the mean of visual to zero
textual ~ 1  # while estimating the mean of textual
speed ~ 1   # and Speed freely"

fit = sem(HS.model, data=HolzingerSwineford1939, meanstructure =TRUE)
summary(fit)


Note: Here the latent variables are scaled by setting the loadings of x1, x4 and x7 to 1