Basic question about 2 x 2 contingenc... PreviousNext
Mplus Discussion > Categorical Data Modeling >
 Phil Wood posted on Saturday, October 17, 2009 - 8:27 am
I must have a bit of chess blindness, but wanted to show a colleague a simple case of analyzing a 2 x 2 contingency table with the logit link function. I adapted the following code from a data set in the manual:
TITLE: 2 x 2 contingency table
DATA: FILE IS ex8.12.dat;
VARIABLE: NAMES ARE u1-u4 c1-c4;
USEV = u1-u2;
ANALYSIS: estimator=mlr;
[u1$1* u2$1*];
u1 on u2;
My question: Shouldn't the marginal proportions of the two classes by equal to
exp(u1$1)/(1+u1$1) and exp(u2$1)/(1+u2$1)
respectively? The estimated values of .081 and .344 yield .52 and .58, and, for these data, Mplus reports .49 and .59.
Sorry to bother with such a simple-minded question!
 Bengt O. Muthen posted on Saturday, October 17, 2009 - 12:17 pm
You want


Also, for the marginal of u1 you want to take into account that it is regressed on u2, so not use only the intercept [u1$1] - but that is a bit messy. Alternatively you can turn the u's into equivalent c's and use the loglinear parameterization and c1 WITH c2 and then you get both marginals as the [cj$1]s.
 Phil Wood posted on Saturday, October 17, 2009 - 2:09 pm
I'm sorry, the formula you give is what I typed in my excel spreadsheet. The .081 and .344 still yield .52 and .58, so what you're saying is that the .59 is within rounding error? The second bit I'm not quite parsing- Is what you mean by turning the u's into c's is to make them classes?
 Bengt O. Muthen posted on Saturday, October 17, 2009 - 3:25 pm
Yes, make the u's into identical latent class variables - like in the loglinear modeling example 7.15 in the User's Guide. Then you have more modeling freedom to let the variables associate - you can say WITH for two c's but not for two u's in the ML framework. - And you can sometimes handle measurement error in the u's: latent loglinear modeling (I haven't seen anyone pick up on that yet).
 thanoon younis posted on Tuesday, May 05, 2015 - 7:46 am
Hi Prof Muthen,
I want to ask you about categorical data in SEMs. My question, can i use contingency table to solve the problem of ordered categorical data when converting the ordered categ. data to continuous normal bu using percentage of each category in each variable.

Thank you in advance
 Bengt O. Muthen posted on Tuesday, May 05, 2015 - 12:05 pm
I would not recommend that, but instead use polychoric correlations. You may want to ask on SEMNET.
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Enable HTML code in message
Automatically activate URLs in message