Constraining variance of endogenous latent variable

2,632 views
Skip to first unread message

Mark Seeto

unread,
Oct 31, 2013, 1:40:20 AM10/31/13
to lav...@googlegroups.com
Dear lavaan group,

In this model specification

"F1 =~ x1 + x2 + x3
F2 =~ x4 + x5 + x6
F2 ~ F1
F1 ~~ 1*F1
F2 ~~ 1*F2"

does "F2 ~~ 1*F2" constrain the variance of F2 to be 1, or does it constrain the residual variance of F2 to be 1? If it constrains the residual variance, is there a way to instead constrain the variance of F2 itself?

Thanks,
Mark

Edward Rigdon

unread,
Oct 31, 2013, 6:56:34 AM10/31/13
to lav...@googlegroups.com
Mark--
     You are correct.  If a variable is dependent, then that specification fixes the residual variance, not the total variance.  The total variance of a dependent variable is not a model parameter, but you can standardize all factors with the std.lv option on the command (cfa, sem, lavaan) that you use to estimate the model.
--Ed Rigdon

Sent from my iPad
--
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 post to this group, send email to lav...@googlegroups.com.
Visit this group at http://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/groups/opt_out.

Mark Seeto

unread,
Oct 31, 2013, 3:51:19 PM10/31/13
to lav...@googlegroups.com
Thanks for your reply, Ed.

says that std.lv=TRUE will constrain the residual variance to be 1, not the total variance.

I'm not even sure that it is sensible to want to constrain the total variance of endogenous latent variables to be 1, so I'd be interested to hear opinions on that.

Thanks,
Mark

Terrence Jorgensen

unread,
Oct 31, 2013, 5:04:28 PM10/31/13
to lav...@googlegroups.com

 
I'm not even sure that it is sensible to want to constrain the total variance of endogenous latent variables to be 1, so I'd be interested to hear opinions on that.

Ultimately, the choice of metric for our latent variables is arbitrary because we haven't observed them, so we don't know what their metric really is.  We just want to choose something either meaningful (using marker indicators, which I think is dubious) or interpretable (using standard normal latent variables).  You can fix the latent residual variance to whatever you like just to fit the model, and then you can interpret the residual variance in the standardized solution, which is it's R-squared minus 1 (i.e., a standardized MS-error).  If you want the raw estimate to be standardized as well (for significance testing, I suppose?), then you can label the residual variance and use a model constraint statement to make the total variance 1 (although if you have a small residual variance, sampling error might yield negative residual variances on occasion, and that would cause problems here):

syntax <- "

F1 =~ x1 + x2 + x3
F2 =~ x4 + x5 + x6
F2 ~ Beta*F1
F1 ~~ 1*F1
F2 ~~ ResVar*F2

## MODEL CONSTRAINTS:
ResVar == 1 - Beta^2
"

Terry

Mark Seeto

unread,
Oct 31, 2013, 6:12:25 PM10/31/13
to lav...@googlegroups.com
Thanks Terry. Your model specification seems to be what I was looking for, but when I fit it using sem(), the F1=~x1 and F2=~x4 coefficients are constrained to be 1, which seems like too many constraints. I assume that lavaan() could be used to fit the model without these extra constraints, but is there a way to do it with sem()?

Thanks,
Mark
Message has been deleted

Terrence Jorgensen

unread,
Oct 31, 2013, 8:49:08 PM10/31/13
to lav...@googlegroups.com

Thanks Terry. Your model specification seems to be what I was looking for, but when I fit it using sem(), the F1=~x1 and F2=~x4 coefficients are constrained to be 1, which seems like too many constraints. I assume that lavaan() could be used to fit the model without these extra constraints, but is there a way to do it with sem()?


Good point, and no, you can't simultaneously remove the marker-variable constraint and the standardized-latent-variable constraints in the cfa or sem functions.  You can control it in lavaan, though, by setting both "auto.fix.first" and "std.lv" to FALSE (actually, those are the default settings in the lavaan function).  You just need to make sure your constructs are adequately identified manually in the model syntax.  Also, you need to either identify ALL parameters in the syntax, or you need to set some lavaan arguments to TRUE, such as automatically estimating the residual variances or intercepts of indicators.  Check whether this model syntax works with the following call to lavaan (notice that the raw and standardized estimates of the regression AND the residual variance are equal):

syntax <- "
F1 =~ x1 + x2 + x3
F2 =~ x4 + x5 + x6
F2 ~ Beta*F1
F1 ~~ 1*F1
F2 ~~ ResVar*F2

## MODEL CONSTRAINTS:
ResVar == 1 - Beta^2
"

fit <- lavaan(syntax, data = HolzingerSwineford1939, auto.var = TRUE,
              int.ov.free = TRUE, meanstructure = TRUE)

summary(fit, standardized = TRUE)

                   Estimate  Std.err  Z-value  P(>|z|)   Std.lv  Std.all
Regressions:
  F2 ~
    F1     (Beta)     0.461    0.064    7.195    0.000    0.461    0.461

Variances:
    F2     (RsVr)     0.788    0.059                      0.788    0.788


Also, if this example is smaller than your full model, then you may need to use more labels/constraints.  For instance, if you have 2 predictors (e.g., F3 ~ F1 + F2), and those predictors are correlated, then you will need to label the residual variance of the outcome, the variances of the predictors (if they are not 1), and the covariance between the predictors, and set the total outcome variance to 1 using all the information about the predictors:

syntax <- "
F1 =~ x1 + x2 + x3
F2 =~ x4 + x5 + x6
F3 =~ x7 + x8 + x9
F1 ~~ 1*F1 + Cov*F2
F2 ~~ 1*F2
F3 ~~ ResVar*F3
F3 ~ Beta1*F1 + Beta2*F2

## MODEL CONSTRAINTS:
ResVar == 1 - (Beta1^2 + Beta2^2 + 2*Beta1*Cov*Beta2)
"


Terry

Mark Seeto

unread,
Oct 31, 2013, 10:13:49 PM10/31/13
to lav...@googlegroups.com
Thanks Terry, you've been very helpful.
Message has been deleted

Reubs Walsh

unread,
Feb 21, 2019, 2:09:53 PM2/21/19
to lavaan
Hi Terry and lavaan comrades!
This is extremely useful, but I'm having trouble applying it to my case, so I wonder whether you can make sense of it for me. I have a latent variable (IDD) which is indicated by four formative variables (<~ operator) and two outcome variables, treated as dependents in a regression. I want to be able to estimate the loading of all the formatives on my latent variable, so I don't want to fix any paths to 1. I tried fixing it using my observed variable 'US' which is supposed to be the closest thing I can get to a direct measure of IDD, but the model couldn't identify. Instead, to set the scale of IDD I was going to constrain the mean to 0 and variance to 1, same as Mark. But I have so many variables, and three different types, it's hard to work out what the code for the model constraint should be in the lavaan syntax (ironic, given how remarkably intuitive lavaan syntax is for pretty much everything else I've tried). Possibly adding to the issue is that this is for a registered report so I'm working on simulated data at this stage.

My syntax:

The version that runs:

model<-"


! regressions 
IDD <~  1*Exp + DE + ST + IAT
MH ~ IDD
US ~ IDD
DE ~ IAT
Exp ~ ST
! residual covariances and variances
IDD ~~ IDD
Exp ~~ IAT
MH ~~ 0*US
! observed means
Exp~0;
IAT~0;
MH~0;
ST~0;
DE~0;
US~0;

";

the version that I'm trying to create here:
model<-"


! regressions 
IDD <~  a*Exp + b*DE + c*ST + d*IAT
MH ~ e*IDD
US ~ f*IDD
DE ~ IAT
Exp ~ ST
! residual covariances and variances
IDD ~~ ResVar*IDD
Exp ~~ IAT
MH ~~ 0*US
! observed means
Exp~0;
IAT~0;
MH~0;
ST~0;
DE~0;
US~0;
IDD~0
!Model Contraints
ResVar == 1- (function involving a-f? or something else?)
";


Thank you very much in advance!

Edward Rigdon

unread,
Feb 21, 2019, 2:27:39 PM2/21/19
to lav...@googlegroups.com
Don't use the "formative" operator <~ . It is wonky, and lways has been wonky.
Just code the "formative indicators" as predictors of factor IDD, same as any other predictors.

model<-"

IDD =~ MH + US
IDD ~ Exp + DE + ST + IAT
DE ~ IAT
Exp ~ ST

and et cetera
--Ed Rigdon

--
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 post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.

Reubs Walsh

unread,
Feb 21, 2019, 2:56:22 PM2/21/19
to lav...@googlegroups.com
Thank you for this. I will do that then. However this doesn’t solve the issue at hand. Do you have any thoughts? Thanks. 

Best Wishes,
Reubs Walsh

Sent from my phone while away from my computer so please excuse any excessive brevity or typos. 


Ms Reubs J Walsh BA (Oxon) MSc (Lond)  
Promovendus, KNOP (Clinical and Neuro-Developmental Psychology) 
Faculteit der Gedrags- en Bewegingswetenschappen (Faculty of Behavioural and Movement Sciences)

Vrije Universiteit Amsterdam

https://fd7.formdesk.com/vuamsterdam/email_vu_logo_fgbw_nl.png

T +31 (0) 598 97 77 | r.j....@vu.nl
POSTADRES: Van der Boechorststraat 9, 1081 BT Amsterdam  
BEZOEKADRES: Van der Boechorststraat 7, 1081 BT Amsterdam | Disclaimer   

 

Reubs Walsh

unread,
Feb 21, 2019, 3:01:13 PM2/21/19
to lav...@googlegroups.com
Oh also, MH is caused by IDD but isn’t a measure of IDD per se. Does it make sense to treat it as an indicator variable?


Best Wishes,
Reubs Walsh

Sent from my phone while away from my computer so please excuse any excessive brevity or typos. 


Ms Reubs J Walsh BA (Oxon) MSc (Lond)  
Promovendus, KNOP (Clinical and Neuro-Developmental Psychology) 
Faculteit der Gedrags- en Bewegingswetenschappen (Faculty of Behavioural and Movement Sciences)

Vrije Universiteit Amsterdam

https://fd7.formdesk.com/vuamsterdam/email_vu_logo_fgbw_nl.png

T +31 (0) 598 97 77 | r.j....@vu.nl
POSTADRES: Van der Boechorststraat 9, 1081 BT Amsterdam  
BEZOEKADRES: Van der Boechorststraat 7, 1081 BT Amsterdam | Disclaimer   

 


On 21 Feb 2019, at 20:27, Edward Rigdon <edward...@gmail.com> wrote:

Edward Rigdon

unread,
Feb 21, 2019, 3:08:38 PM2/21/19
to lav...@googlegroups.com
Reubs--
That is a semnet question more than a question about lavaan. Still, my answer is:
Arithmetic is arithmetic. Dependent is dependent. Nothing is qualitatively different.
If you want to standardize IDD, which is a common factor in this model, use the option
std.lv=T
when you estimate the model
--Ed Rigdon

Terrence Jorgensen

unread,
Feb 21, 2019, 3:23:45 PM2/21/19
to lavaan
IDD ~~ ResVar*IDD

!Model Contraints
ResVar == 1- (function involving a-f? or something else?)

I think the constraint you are asking for only makes sense in the context of a common factor (with reflective indicators), not a formative construct.  But if you want to do the same trick, IDD's explained variance subtracted from 1 only involves its predictors (its indicators), so you would need to label all of their variances and covariances as well to include all the path tracing (which will be super complicated).

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reubs Walsh

unread,
Feb 22, 2019, 7:42:29 AM2/22/19
to lavaan
Thanks all, you've been very kind.

matta...@gmail.com

unread,
Oct 6, 2020, 5:28:05 AM10/6/20
to lavaan
Is there a way of getting the ResVar of an unstandardized observed  endogenous  variable?

Terrence D. Jorgensen

unread,
Oct 6, 2020, 5:43:19 AM10/6/20
to lav...@googlegroups.com
The syntax and math are the same for observed and latent variables. 

--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/SHh0quPtFqM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/ee207fe3-207c-478a-bb21-f67d18cd2a4bn%40googlegroups.com.
--

matta...@gmail.com

unread,
Oct 6, 2020, 6:18:19 AM10/6/20
to lavaan

Except:  
ResVar == 1 - Beta^2 
Won't work for unstandardized observed, because the total variance is not necessarily equal to 1..? 

Terrence D. Jorgensen

unread,
Oct 6, 2020, 6:53:49 AM10/6/20
to lav...@googlegroups.com
Right, but the math is the same. You can see in your data what the variance is, so use that in place of the arbitrary 1 used for latent variables. 

matta...@gmail.com

unread,
Oct 6, 2020, 7:04:29 AM10/6/20
to lavaan
Okay, great - thanks!
Reply all
Reply to author
Forward
0 new messages