Bivariate ordered probit model

734 views
Skip to first unread message

Gouri Shankar Mishra

unread,
Mar 17, 2016, 3:16:24 AM3/17/16
to lavaan
Hello All: I have trying to estimate a bivariate ordered probit model

model1 <- '
Y1 ~ x1+x2
Y2 ~ x1 + x2 + x3
Y1 ~~ Y2 
'

fit <- sem(

I have a few questions and would appreciate your comments
(a) Lavaan gives both "Variances:" and "Scales y*:" for the endogenous variables. In my case, the values are 1 in both cases for both Y1 and Y2. Is that possible? 
Variances:
                   Estimate  Std.Err  Z-value  P(>|z|)
    Y1            1.000                           
    Y2     1.000                           

Scales y*:
                   Estimate  Std.Err  Z-value  P(>|z|)
    Y1            1.000                           
    Y2     1.000 

(b) I get the following error. Can you point to the literature that explains this error 
Warning message:
In muthen1984(Data = X[[g]], ov.names = ov.names[[g]], ov.types = ov.types,  :
  lavaan WARNING: trouble inverting W matrix; used generalized inverse

(c) I modified my model to make it non-recursive by adding Y1 as an explanatory variable.
model2 <- '
Y1 ~ x1+x2
Y2 ~ x1 + x2 + x3 + Y1
Y1 ~~ Y2 
'
I expected the model to be un-identified because both x1 and x2 appear in the second equation also. However, lavaan was able to estimate the model without any errors (using bootstrapping estimator). Further, the coefficient estimates and SE are almost exactly the same. Except - the variance estimates are now not equal to 1 for Y2. Also - as expected - the sum of estimated covariance of Y1 & Y2, and coefficient of Y1 in model2 is equal to the covariance of Y1 & Y2 from model1.  
Variances:
                   Estimate  Std.Err  Z-value  P(>|z|)
    Y1            1.000                           
    Y2             0.560                           

Scales y*:
                   Estimate  Std.Err  Z-value  P(>|z|)
    Y1            1.000                           
    Y2             1.000 

Thanks for your time. 

Terrence Jorgensen

unread,
Mar 17, 2016, 5:43:48 AM3/17/16
to lavaan
(a) Lavaan gives both "Variances:" and "Scales y*:" for the endogenous variables. In my case, the values are 1 in both cases for both Y1 and Y2. Is that possible? 

You expect the default delta parameterization to return Scales of y* == 1 (with residual Variances == 1 - explained variance), or theta parameterization to return residual Variances == 1 (with Scales of y* == 1 + explained variance).  The reason you do not see this is because the default is "fixed.x = TRUE", so the variances of the predictors are not model parameters.  Hence, there is no way to estimate the "explained variance" component in the above equations.  You will get the expected behavior if you set the argument sem(..., fixed.x = FALSE)

(b) I get the following error. Can you point to the literature that explains this error 
Warning message:
In muthen1984(Data = X[[g]], ov.names = ov.names[[g]], ov.types = ov.types,  :
  lavaan WARNING: trouble inverting W matrix; used generalized inverse

It is not an error. It is a warning.  You are using weighted least squares, and the weight matrix couldn't be inverted, so it used a generalized inverse (you can read about it on Wikipedia, or Wolfram Alpha under "Moore-Penrose matrix inverse").  I don't know if this means you can't trust your results.  I assume neither does the developer -- that's why it's just a warning.

(c) I modified my model to make it non-recursive by adding Y1 as an explanatory variable.
model2 <- '
Y1 ~ x1+x2
Y2 ~ x1 + x2 + x3 + Y1
Y1 ~~ Y2 
'

That is still a recursive model.  It is a very common mediation model (well, common with continuous variables).  If this is actually a model from which you are interested in interpreting indirect effects, have a look at the caveats for mediation with categorical variables in these slides (starting with slide 22).


If you just wanted to make a non-recursive model for the fun of it, you can add a feedback loop (e.g., also have Y2 predict Y1, or have either Y predict any of the Xs).

Terry

Gouri Shankar Mishra

unread,
Mar 17, 2016, 3:42:45 PM3/17/16
to lav...@googlegroups.com

Thanks so much Terrance.

 

(1) I indicated fixed.x = FALSE, however, I got the following error.

> fit <- sem(model1, data=analysisdata,  debug = FALSE, fixed.x = FALSE)

Error in lav_options_set(opt) :

  lavaan ERROR: fixed.x=FALSE is not supported for estimator DWLS


I resolved the error by changing the estimator to ULSMV.

 

> fit <- sem(model1, data=analysisdata, se =  "robust.sem",  debug = FALSE, fixed.x =FALSE, estimator = "ULSMV")

Warning message:

In muthen1984(Data = X[[g]], ov.names = ov.names[[g]], ov.types = ov.types,  :

  lavaan WARNING: trouble inverting W matrix; used generalized inverse


I have some additional questions – Why does the fixed.x = FALSE not work with DWLS. IS it a conceptual problem, or is it that the feature has not been incorporated in the current version of lavaan. 


Second, when I am using ULS estimator,  I am basically using a unwieghted LS estimator (as the name suggests). Why do I still get the warning that the W matrix cannot be inverted.


Finally, the change to fixed.x = FALSE, does not seem to affect the output of lavaan. Specifically, I continue to get variances as well as scale of 1. It also does not matter whether I explicitly indicate parameterization = "delta" or parameterization = "theta". The results are exactly the same. I wonder what I am doing wrong here...

 

Variances:
                   Estimate  Std.Err  Z-value  P(>|z|)
    Y1            1.000                           
    Y2     1.000                           

Scales y*:
                   Estimate  Std.Err  Z-value  P(>|z|)
    Y1            1.000                           
    Y2     1.000 


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



--

Best Regards,
- GSM

Institute of Transportation Studies
University of California, Davis

Terrence Jorgensen

unread,
Mar 18, 2016, 6:16:26 AM3/18/16
to lavaan

(1) I indicated fixed.x = FALSE, however, I got the following error.

> fit <- sem(model1, data=analysisdata,  debug = FALSE, fixed.x = FALSE)

Error in lav_options_set(opt) :

  lavaan ERROR: fixed.x=FALSE is not supported for estimator DWLS


Woops, I forgot about that.  Sorry for the false hope.

Even if you could do that, it wouldn't change the fact that neither the scales nor residual variances of y* are identified (unless they are among multiple indicators of a common factor).  So the only thing you could really do is derive a proportion of variance in y* that is explained by the predictors -- which you can request using summary(fit, rsq = TRUE). 

FYI, the topic of pseudo-r-squareds is still unsettled in the logistic regression literature -- there are several ones proposed, and different experts recommend different ones for different reasons.

Terry

yrosseel

unread,
Mar 25, 2016, 1:51:07 PM3/25/16
to lav...@googlegroups.com
On 03/17/2016 08:42 PM, Gouri Shankar Mishra wrote:
> Thanks so much Terrance.
>
> (1) I indicated fixed.x = FALSE, however, I got the following error.

If you really need this, you can 'trick' lavaan by upgrading these 'x'
variables to latent variables (with a single indicator).

> I have some additional questions – Why does the fixed.x = FALSE not work
> with DWLS. IS it a conceptual problem, or is it that the feature has not
> been incorporated in the current version of lavaan.

It is a conceptual problem, in lavaan, but also in Mplus, and in most of
the literature. In a nutshell: when data is categorical, lavaan (and
Mplus) switch to 'conditional x' mode, implicitly treating the x's as
fixed. While for continuous data, lavaan (and Mplus) work in
unconditional model, modeling the joint distribution (y,x), usually
treating x as fixed too.

In dev 0.5-21, there is a new argument: conditional.x which can be set
to TRUE or FALSE. This can be combined with fixed.x TRUE or FALSE. But
it is not ready for the categorical case (yet).

> Second, when I am using ULS estimator,I am basically using a unwieghted
> LS estimator (as the name suggests). Why do I still get the warning that
> the W matrix cannot be inverted.

W is needed for inference. (for standard errors and robust test statistic)

Yves.
Reply all
Reply to author
Forward
0 new messages