3-step manual calculation
Message/Author
 SF Wang posted on Friday, April 18, 2014 - 12:36 pm
Dear professors,

I need to do the 3-step manual calculation (to take uncertainty of latent class assignment into account) comparing some variables among the latent classes (to see whether they differ in different latent classes).

Could you check whether I am doing it correctly? Thanks a lot!

C_all2 is most likely assignment from GMM.

...

CLASSES = c(3);
!3 classes identified in GMM

Analysis:
estimator = mlr;
TYPE = MIXTURE;
starts 50 20;

model:
%overall%

%c#1%
[faq] (m1);
[C_all2#1@3.290];
[C_all2#2@1.041];

%c#3%
[faq] (m3);
[C_all2#1@-3.363];
[C_all2#2@-9.301];

%c#2%
[faq] (m2);
[C_all2#1@7.708];
[C_all2#2@11.832];

!Logits for the Classification...
! 1 2 3
! 1 3.290 1.041 0.000
! 2 7.708 11.832 0.000
! 3 -3.363 -9.301 0.000

model test: m3=m1; m3=m2;
!test all means are the same
 SF Wang posted on Friday, April 18, 2014 - 12:45 pm
Another question: what model is assumed in comparing the means? Thanks.
 Linda K. Muthen posted on Saturday, April 19, 2014 - 10:47 am
As long as you have NOMINAL = c_all2;

MODEL TEST should be specified as:

MODEL TEST:
0 = m3 - m1;
0 = m3 - m2;
 SF Wang posted on Tuesday, April 22, 2014 - 6:57 am
Dear Linda, thank you for your answer! Is it equivalent to ANOVA (uncertainty incorporated)?

Another questions: For categorical variables, the manual calculation could be the following, correct?

nominal is C_all2;
missing are all (-999);
idvariable is rid;
CLASSES = c(3);

Analysis:
TYPE = MIXTURE;
starts 50 20;

Model:
%overall%

c#1 on gender (m1);
c#2 on gender (m2);

%c#1%
[C_all2#1@3.290];
[C_all2#2@1.041];

%c#2%
[C_all2#1@7.708];
[C_all2#2@11.832];

%c#3%
[C_all2#1@-3.363];
[C_all2#2@-9.301];

model test: m1=0; m2=0;

Thanks a lot!
 Bengt O. Muthen posted on Wednesday, April 23, 2014 - 10:53 am
This looks correct. But you don't need Starts. Note that you findm appendices with Mplus scripts for 3-step on our website.
 SF Wang posted on Tuesday, April 29, 2014 - 6:17 am
for categorical variables with multiple categories, would it be right to create dummy variables, then use the dummy variables in the same way as above code?

e.g. 3-category nominal variable:

c#1 on dummy1 dummy2 (m1);
c#2 on dummy1 dummy2 (m2);
...
model test: m1=0; m2=0

?

Thank you!
 Linda K. Muthen posted on Wednesday, April 30, 2014 - 6:11 am
If you have a nominal variable as a covariate, you can create a set of dummy variables and use them as covariates. For an ordered categorical covariate, you can treat it as a continuous variable or create a set of dummy variables.

By putting a label at the end of

c#1 on dummy1 dummy2 (m1);

you are holding the regression coefficients of dummy 1 and dummy 2 equal. The z-test in the output tests if this coefficient is zero. I'm not sure what you are trying to do in MODEL TEST.
 Kiki van Broekhoven posted on Tuesday, July 04, 2017 - 5:36 am
I want to use the 3-step procedure to compare mean scores of some variables between classes. I want to use this 3-step procedure to take into account the classification uncertainty (that is what it does, right?). I already performed GMM and have a 3-class solution. What is the correct input for an ANOVA to compare scores on a continuous variable (OCPD) between classes? Would it be something like this, because I keep receiving error messages.

VARIABLE:
NAMES = numero OCPD depri planned opleid age n;
USEVAR = ocpd n;
CLASSES = c(3);
NOMINAL = n;
AUXILIARY = (R3STEP) ocpd;
ANALYSIS:
TYPE = MIXTURE; STARTS = 0;
MODEL:
%OVERALL%
%c#1%
[n#1@4.942];
[n#2@-0.907];
%c#2%
[n#1@1.704];
[n#2@2.185];
%c#3%
[n#1@-0.622];
[n#2@-3.607];
MODEL TEST:
0 = m1-m3;
0 = m3-m2;

What am I missing/doing wrong?
 Kiki van Broekhoven posted on Wednesday, July 05, 2017 - 8:14 am
I think I might have figured it out myself in the meantime; would this be correct?

VARIABLE:
NAMES = numero OCPD depri planned opleid age n;
USEVAR = ocpd n;
CLASSES = c(3);
NOMINAL = n;
AUXILIARY = ocpd (DU3STEP);
ANALYSIS:
TYPE = MIXTURE; STARTS = 0;
MODEL:
%OVERALL%
%c#1%
[n#1@4.942];
[n#2@-0.907];
%c#2%
[n#1@1.704];
[n#2@2.185];
%c#3%
[n#1@-0.622];
[n#2@-3.607];

The output looks alright, as it says "EQUALITY TESTS OF MEANS ACROSS CLASSES USING THE 3-STEP PROCEDURE
WITH 2 DEGREE(S) OF FREEDOM FOR THE OVERALL TEST".

The only thing that I'm confused about is that I get Chi-squared results, however the variable "OCPD" is a continuous variable. So would this output still be correct?
 Bengt O. Muthen posted on Wednesday, July 05, 2017 - 6:15 pm
With a continuous distal outcome you should use the BCH method - read our Mplus Web Note 21.
 Kiki van Broekhoven posted on Thursday, July 06, 2017 - 12:30 am
Thank you, I will look into that!