Help on Fit statistics and contraining error variance (theta-delta)

956 views
Skip to first unread message

tom...@rhsmith.umd.edu

unread,
Feb 29, 2016, 4:35:56 PM2/29/16
to lavaan
Hi, I've been trying to do an CFA on my dataset in R to replicate what my professor did in Lisrel (he's old-school and doesn't believe R can handle SEM and CFA). The parameter estimates are very close to what I got in Lisrel but the the fit statistics are way off. Lisrel gave me an CFI of 0.99 while lavaan gave me 0.00. Can someone help identifying what's driving the difference? Lisrel and R code are posted as follows and dataset is attached. Also another question I couldn't figure out is how to constrain theta-delta (error variance) in lavaan. In Lisrel you can do "Set the Error Covariance of perform to 18.749", for example. THANK YOU SO MUCH

Lisrel Code
Title: Exercise Three 5 factor model

Observed variables:
tnp1 tnp2 tnp3 conp1 conp2 conp3 snap1 snap2 snap3 effp1 effp2 effp3 perform

Raw data from file 'F:\Academics\Maryland\2015\BMGT828F (FA & SEM)\Exercises\Exercise3b.psf'
Sample Size 247
Latent Variables: Tnp Con Snp Effp Perf
Relationships
perform=0.948683*Perf
tnp1-tnp3=Tnp
conp1-conp3=Con
snap1-snap3=Snp
effp1-effp3=Effp
LISREL OUTPUT: SC AD=OFF
Path Diagram
Print Residuals
End of Problem

R Code
mod='Perf=~0.948683*perform
     Tnp=~tnp1+tnp2+tnp3
     Con=~conp1+conp2+conp3
     Snp=~snap1+snap2+snap3
     Effp=~effp1+effp2+effp3'
fit=sem(mod,data=Exercise3parcel,std.lv=TRUE)
summary(fit, standardized=TRUE,fit.measures=TRUE)

Exercise3parcel.csv

yrosseel

unread,
Mar 1, 2016, 2:45:34 AM3/1/16
to lav...@googlegroups.com
On 02/29/2016 10:35 PM, tom...@rhsmith.umd.edu wrote:
> Hi, I've been trying to do an CFA on my dataset in R to replicate what
> my professor did in Lisrel (he's old-school and doesn't believe R can
> handle SEM and CFA).

The problem is the the lisrel model is not identified. The 'Perf' latent
variable gets (by default) a free variance, and a free residual variance
for its single indicator 'perform'. As a result, LISREL says:

W_A_R_N_I_N_G: TD 13,13 may not be identified.
Standard Errors, T-Values, Modification Indices,
and Standardized Residuals cannot be computed.

Unlike lavaan, it still reports fit indices in this case.

To mimic this underidentified model in lavaan, you can use:

model <- '
Perf =~ 0.948683*perform
Perf ~~ NA*Perf
perform ~~ perform
Tnp =~ tnp1 + tnp2 + tnp3
Con =~ conp1 + conp2 + conp3
Snp =~ snap1 + snap2 + snap3
Effp =~ effp1 + effp2 + effp3
'
fit <- sem(model, data = Data, std.lv = TRUE, mimic = "EQS")

To get an identified model in lavaan: remove either the second (Perf ~~
NA*Perf) or third (perform ~~ perform) line. IN LISREL: either fix the
variance of 'Perf' to unity, or fix the residual variance (in the
theta-delta matrix) to zero.

> Also another question I couldn't figure out is
> how to constrain theta-delta (error variance) in lavaan. In Lisrel you
> can do "Set the Error Covariance of perform to 18.749", for example.

To fix the residual variance of, say, 'conp2' to 18.749, you should add
a line like this:

conp2 ~~ 18.749*conp2

Hope this helps,

Yves.



Tom Taiyi Yan

unread,
Mar 4, 2016, 2:58:14 PM3/4/16
to lav...@googlegroups.com
Hi Yves,

Sorry I didn't get back to you later. I want to learn more about what you said and did. First of all, when I ran the following code. It didn't give me that error message that you mentioned, although before I've seen error before. I attached my Lisrel output here. I have a couple of questions here for you and I know you don't have to do this, but I really really appreciate your responses. Bottom line, THANK YOU SO MUCH!

1. Regarding line "perform=0.948683*Perf", here what I'm trying to do is to follow Chen, Sully, Whiteman & Kilcullen (2000)'s instruction to correct the potential drawbacks of single-indicator latent variables. They "set the path from latent variable to its single indicators (i.e. lambda) equal to the square root of reliability". In the psychology literature, we typically assume the reliability of the single indicator measure to be 0.9 thus its square root is 0.948683. My question is, does this line of code actually accomplish this purpose? In my code Perf is the latent variable and perform is the observed variable. Specifically, shouldn't the line be "Perf=0.948683*perform"? But when I ran this line with the rest of the code, it did give me that error message of "W_A_R_N_I_N_G: PS 1_1 may not be identified. Standard Errors, T-Values, Modification Indices, and Standardized Residuals cannot be computed." 

2. Perf ~~ NA*Perf
    perform ~~ perform

I know that ~~ is how lavaan specify covariance relationship but I'm not sure what these two lines accomplish. Could you please explain the purpose of these two lines? You said before that these two lines would mimic the unidentified model, but the following and attached code seems not to have that error message. So to replicate the attached result in R, should I not have these two lines of code? 



Title: Exercise Three Five Factor Model
Observed variables:
tnp1 tnp2 tnp3 conp1 conp2 conp3 snap1 snap2 snap3 effp1 effp2 effp3 perform

Raw data from file 'F:\Academics\Maryland\2015\BMGT828F (FA & SEM)\Exercises\Exercise3b.psf'

Sample Size 247

Latent Variables: Tnp Con Snp Effp Perf

Relationships
perform=0.948683*Perf
tnp1-tnp3=Tnp
conp1-conp3=Con
snap1-snap3=Snp
effp1-effp3=Effp

Set the Error Covariance of perform to 18.749

LISREL OUTPUT: SC AD=OFF
Path Diagram
Print Residuals
End of Problem




--
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/UTyAIRObfQM/unsubscribe.
To unsubscribe from this group and all its topics, 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.



--
Tom Taiyi Yan
--------------------------------------------
Management & Organization
Robert H. Smith School of Business
University of Maryland
Lisrel Output.docx

Terrence Jorgensen

unread,
Mar 5, 2016, 6:26:44 AM3/5/16
to lavaan
1. Regarding line "perform=0.948683*Perf", here what I'm trying to do is to follow Chen, Sully, Whiteman & Kilcullen (2000)'s instruction to correct the potential drawbacks of single-indicator latent variables. They "set the path from latent variable to its single indicators (i.e. lambda) equal to the square root of reliability". In the psychology literature, we typically assume the reliability of the single indicator measure to be 0.9 thus its square root is 0.948683. My question is, does this line of code actually accomplish this purpose? In my code Perf is the latent variable and perform is the observed variable. Specifically, shouldn't the line be "Perf=0.948683*perform"?

Yes, that would fix the reliable variance to 0.9, but the operator for a factor loading is not "=", it is "=~", so you line should read 

perform =~ 0.948683*Perf


2. Perf ~~ NA*Perf
    perform ~~ perform

I know that ~~ is how lavaan specify covariance relationship but I'm not sure what these two lines accomplish. Could you please explain the purpose of these two lines?

This was to help you mimic the unidentified LISREL model.  You free the latent variance with the first line (override the default to fix it to 1), and also estimate the residual variance in the second line.

You said before that these two lines would mimic the unidentified model, but the following and attached code seems not to have that error message. So to replicate the attached result in R, should I not have these two lines of code? 

I don't see any R output, so I can't comment.  But I will suggest reading this article, particularly the section comparing the LISREL and Mplus models beginning on p. 487


That's a multiple-group context, but still relevant to help you understand why lavaan uses the Mplus method instead of the LISREL method.  In fact, this Mplus documentation would probably also help:


Terry

Reply all
Reply to author
Forward
0 new messages