Hello,
I am trying to understand how lavaan calculates variances of a categorical endogenous variable, when the categorical output depends on a mediator variable.
I have this simple model for illustration:
dat <- data.frame(a=rnorm(1000000))
dat$b <- dat$a*0.80+rnorm(1000000,0,0.1)
dat$c <- factor(ifelse(+5-2*dat$b+rnorm(1000000,0,1)>0,1,0),ordered = TRUE)
sem('b~a
c~b', data=dat, meanstructure=TRUE)
which gives the following output:Regressions:
Estimate Std.Err z-value P(>|z|)
b ~
a 0.800 0.000 8027.399 0.000
c ~
b -1.970 0.019 -105.891 0.000
Intercepts:
Estimate Std.Err z-value P(>|z|)
.b -0.000 0.000 -0.538 0.590
.c 0.000
Thresholds:
Estimate Std.Err z-value P(>|z|)
c|t1 -4.936 0.034 -146.734 0.000
Variances:
Estimate Std.Err z-value P(>|z|)
.b 0.010 0.000 707.188 0.000
.c 0.961
Scales y*:
Estimate Std.Err z-value P(>|z|)
c 1.000
I am wondering how the estimate for the variance of the categorical variable is calculated (marked in yellow). If b was an exogenous variable, the variance of c would be 1. But here, b is endogenous (and a mediator) and the variance is 0.961. I understand that the threshold estimates for c are obtained from the intercept of a ordered probit-regression model. But, how is the variance here calculated?
Could someone help me here please?
(I think a similar question remained unsanswered in
this post)
Thank you very much!