Doubt about lavInspect: $theta

310 views
Skip to first unread message

Hugo Harada

unread,
Mar 27, 2019, 12:07:29 AM3/27/19
to lav...@googlegroups.com
Hello all,

Can someone clarify what lavInspect(fit,what = 'est')$theta returns? I thought that it would be the same as  lavInspect(fit,what = 'cov.ov') but they return different results. 

What is the difference?

Regards,

Hugo

> data(HolzingerSwineford1939)
> HS.model <- ' visual  =~ x1 + x2 + x3
+               textual =~ x4 + x5 + x6
+               speed   =~ x7 + x8 + x9 '
> fit <- cfa(HS.model, data=HolzingerSwineford1939)
> lavInspect(fit,what = 'est')$theta

   x1    x2    x3    x4    x5    x6    x7    x8    x9  
x1 0.549                                                
x2 0.000 1.134                                          
x3 0.000 0.000 0.844                                    
x4 0.000 0.000 0.000 0.371                              
x5 0.000 0.000 0.000 0.000 0.446                        
x6 0.000 0.000 0.000 0.000 0.000 0.356                  
x7 0.000 0.000 0.000 0.000 0.000 0.000 0.799            
x8 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.488      
x9 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.566
> lavInspect(fit,what = 'cov.ov')
   x1    x2    x3    x4    x5    x6    x7    x8    x9  
x1 1.358                                                
x2 0.448 1.382                                          
x3 0.590 0.327 1.275                                    
x4 0.408 0.226 0.298 1.351                              
x5 0.454 0.252 0.331 1.090 1.660                        
x6 0.378 0.209 0.276 0.907 1.010 1.196                  
x7 0.262 0.145 0.191 0.173 0.193 0.161 1.183            
x8 0.309 0.171 0.226 0.205 0.228 0.190 0.453 1.022      
x9 0.284 0.157 0.207 0.188 0.209 0.174 0.415 0.490 1.015
>

--


Adaptativa

Hugo Harada
Sócio-fundador - COO

Adaptativa Inteligência Educacional S.A.
Cel: (11) 96345-0390
Rua Claudio Soares, 72 - Sala 411Pinheiros, CEP 05422-030, São Paulo - SP 
http://www.adaptativa.com.br

Facebook Twitter Google Plus Youtube

Terrence Jorgensen

unread,
Mar 29, 2019, 6:41:15 AM3/29/19
to lavaan
lavInspect(fit,what = 'est')$theta

This is a matrix of parameters.  Specifically, it is the residual covariance matrix of observed variables.

lavInspect(fit,what = 'cov.ov')

This is the model-implied (total, not residual) covariance matrix of the observed variables.  This does not contain model parameters; it is a function of model parameters (explained + unexplained variance).

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

Hugo Harada

unread,
Apr 1, 2019, 1:22:01 PM4/1/19
to lav...@googlegroups.com
Hi, Terrence!!

Thank you for your reply. 


This is a matrix of parameters.  Specifically, it is the residual covariance matrix of observed variables.

I can think of two ways to interpret your answer. The residual does not seem to imply Sample - Implied as below. 

image.png

Could it be that;

image.png

Theta would be var(e_i) from the formula above?

Parameterization = "theta" would set var(e_i) =1, correct?
Parameterization = "delta" would set var(x*_i) =1, correct?

If so, I cannot understand why the simple experiment below does not give different results?

image.png

Can you point out what I am missing?

Hugo

--
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.

Hugo Harada

unread,
Apr 3, 2019, 1:47:05 AM4/3/19
to lav...@googlegroups.com
Hi Terrence,

Please ignore my previous email. I will try to rewrite it using Bollen terminology below.

image.png

$Theta would be measurements errors for x list above?

Another questions about the parameterization parameter. Is the interpretation below correct?

Parameterization = "theta" would set var(delta) =1.
Parameterization = "delta" would set var(x) =1. 

If so, I cannot understand why the simple experiment below does not give different results? $theta should change with the parameterization parameter, right?

image.png

Can you point out what I am missing?  

Regards,

Hugo

Terrence Jorgensen

unread,
Apr 4, 2019, 9:38:15 AM4/4/19
to lavaan
This is a matrix of parameters.  Specifically, it is the residual covariance matrix of observed variables.

I can think of two ways to interpret your answer. The residual does not seem to imply Sample - Implied

No, that would be the matrix of covariance residuals.

Parameterization = "theta" would set var(e_i) =1, correct?
Parameterization = "delta" would set var(x*_i) =1, correct?

Yes, by default for categorical data, unless you have multiple groups and set group.equal = "thresholds" (which would free var(e) or var(x*) in all but the first group).

If so, I cannot understand why the simple experiment below does not give different results?

Because you are using continuous data, so the parameterization= argument is ignored/irrelevant.  Try this:

HS9 <- HolzingerSwineford1939[,c("x1","x2","x3","x4","x5",
                                 
"x6","x7","x8","x9")]
HSbinary <- as.data.frame( lapply(HS9, cut, 2, labels=FALSE) )
HS
.model <- ' visual  =~ x1 + x2 + x3

textual =~ x4 + x5 + x6
speed   =~ x7 + x8 + x9 '


fit
<- cfa(HS.model, data=HSbinary, ordered=names(HSbinary))
lavInspect
(fit, 'est')$theta
lavInspect
(update(fit, parameterization = "theta"), 'est')$theta

Hugo Harada

unread,
Apr 8, 2019, 11:53:30 PM4/8/19
to lav...@googlegroups.com
Hi, Terrence!

Thank you very much for your help. It is all clear now. 

I am sharing the script I created to understand Lavinspect here so that others can reference.

Regards,

Hugo

--
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.
0029-Lavaan-Basics.r
Reply all
Reply to author
Forward
0 new messages