analytical solution for latent variable correlation

24 views
Skip to first unread message

Maximilian Ernst

unread,
Nov 28, 2019, 3:34:15 PM11/28/19
to lavaan
Hi together,

I have two dichotomous variables A and B.
I know their joint distribution, e.g. P(A), P(B), P(A and B). (I have no data, but I can simulate it with this information)

Under the assumption that those variables reflect latent variables that are normally distributet, I can use the simulated data and estimate the correlation of the latent Variables with the following model:

modAB <- "
factorA =~ 1*A
factorB =~ 1*B
factorA ~~ factorB
A ~~ 0*A
B ~~ 0*B

factorA ~~ 1*factorA
factorB ~~ 1*factorB
"

fitAB <- sem(modAB, datAB, ordered = c("A", "B"))

However, I have many of those pairs, which makes this approach computationally expensive (first drawing data, then fitting the model, then extracting the parameter of interest.)

I assume that because I only have two dichotomous variables and I know their distribution, there is a way to directly calculate die correlation of the latent variables from the known probabilities. Does someone now how to do that?

Maximilian Ernst

unread,
Nov 28, 2019, 3:46:18 PM11/28/19
to lavaan
A direct follow-up: is the latent variable correlation in this case equivalent to the polychoric correlation of A and B?

Terrence Jorgensen

unread,
Nov 29, 2019, 6:25:12 AM11/29/19
to lavaan
A direct follow-up: is the latent variable correlation in this case equivalent to the polychoric correlation of A and B?

Yes, the tetrachoric correlation since both are binary.  If A and B are endogeous variables, you can simply rely on lavaan to do this.  That is how DWLS estimation works:




I assume that because I only have two dichotomous variables and I know their distribution, there is a way to directly calculate die correlation of the latent variables from the known probabilities. Does someone now how to do that?

Googling "how to calculate tetrachoric correlation" returned this:


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

Maximilian Ernst

unread,
Nov 29, 2019, 9:45:12 AM11/29/19
to lavaan
Thanks, also for the nice paper!! I found the r-package polycor, which computes the tetrachoric correlation from the 2x2 contingency table of a pair of variables. So now instead of fitting a latent variable model each time, I just compute the correlation directly, which speeds up my code extremely.

Best,

Maximilian
Reply all
Reply to author
Forward
0 new messages