Multilevel mixture modeling PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 xue li posted on Friday, June 16, 2006 - 12:32 pm
Hi, every one:

There are 3000 clusters, within each cluster there are 10 subjects . Each subject has a depent variable measured 0 or 1, and each subject has no covariate.

I want to use two level mixture model to analysis this data. The reason is the observed data are grouped into 2 classes. Class one has mean -3 and variance approximately 0; and the second class has mean 0 and variance approcimately 4.Approximately 37.7% subjects are in class 1. The problem is the model never converge. Could someone tells me whether there is mistakes in my program. Thanks.
my email xli28@uic.edu

I use the following code.
Title: Mixture model for breast cancer project-race by age specific poverty
two-level logistic regression


Data:
!file is C:\xli28\project1\EB\mplus for EB\EB6ageg.dat;
file is C:\xli28\project1\EB\sim_age3.dat;
!file is F:\xue new\sim_age3.dat;
variable: names are ncluster povind int;
usevariables are povind;
missing are . ;
classes = c (2);
categorical=povind;
cluster=ncluster;
analysis: type =twolevel random mixture;
algorithm=integration;
estimator=ML;
integration=GAUSSHERMITE(15);
adaptive=on;

model:


%within%
%overall%
i|povind@0;
[i];
i;


%c#1%
[i*-3];
i@0;


%c#2%
[i*0];
i*4;


%between%
%overall%
[povind$1@0];
output: tech1; tech8;
 xue li posted on Friday, June 16, 2006 - 12:37 pm
Hi, the error message is as follows.
Since the data set is created by simulation. The starting value will be plausible. I can't figure out the reason.


Error message:

Unperturbed starting value run did not converge.


THE ESTIMATED WITHIN COVARIANCE MATRIX IN CLASS 1 COULD NOT
BE INVERTED. COMPUTATION COULD NOT BE COMPLETED IN ITERATION 1.
CHANGE YOUR MODEL AND/OR STARTING VALUES.

THE ESTIMATED WITHIN COVARIANCE MATRIX IN CLASS 0 COULD NOT
BE INVERTED. COMPUTATION COULD NOT BE COMPLETED IN ITERATION 1.
CHANGE YOUR MODEL AND/OR STARTING VALUES.

SERIOUS PROBLEM IN THE OPTIMIZATION WHEN COMPUTING THE POSTERIOR
DISTRIBUTION. CHANGE YOUR MODEL AND/OR STARTING VALUES.
THE LOGLIKELIHOOD DECREASED IN THE LAST EM ITERATION. CHANGE YOUR MODEL,
STARTING VALUES AND/OR THE NUMBER OF INTEGRATION POINTS.



THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ERROR IN THE
COMPUTATION. CHANGE YOUR MODEL AND/OR STARTING VALUES.






MODEL RESULTS

Estimates

Within Level

Latent Class 1

I |
POVIND 1.000

Means
I -3.000


Variances
I 0.000

Latent Class 2

I |
POVIND 1.000

Means
I 0.000


Variances
I 4.000

Between Level

Latent Class 1

Thresholds
POVIND$1 0.000

Latent Class 2

Thresholds
POVIND$1 0.000

Categorical Latent Variables

Within Level

Means
C#1 0.000
 Bert Weijters posted on Friday, October 17, 2008 - 8:35 am
I'm running a mixture twolevel model in mplus. However, I would like to define the latent class variable as a between level variable. In other words, I would like to classify 'clusters' (in the mplus multilevel language). How can I do this?

I tried including the statement
BETWEEN = c;
but it looks as if this statement is being ignored.

The reason why I want to classify at the between level is that my respondents are situated at this level; the within level has 18 ratings of different experimental scenario's by each respondent. I'm not interested in segmenting at this level (because I would probably end up with 18 classes corresponding to the 18 ratings), but at the respondent level.
In the previous discussion I found the following statement - has this been implemented?
"In future Mplus versions, we will also have a latent class variable varying on the between level. That would be a school-level variable, classifying different schools."
 Linda K. Muthen posted on Friday, October 17, 2008 - 8:43 am
See Example 10.2. If this is being ignored, perhaps you are using a version of Mplus where this was not yet implemented.
 Bert Weijters posted on Friday, October 17, 2008 - 11:50 am
I was wrong. "between=c" is not being ignored, but I misinterpreted the output: it lists the class counts in terms of level 1 (the within level), but I now see that observations from the same cluster are indeed assigned to the same class. Thanks.
 M.Heidari posted on Thursday, July 21, 2016 - 9:50 pm
Hi,
Is it possible to run multilevel mixture factor models in Mplus?
Is it related to example 10.4 & 10.5?

Thank you very much.
 Linda K. Muthen posted on Friday, July 22, 2016 - 5:58 am
Yes to both.
 Ryan Marek posted on Friday, August 26, 2016 - 11:12 am
I'm working with some behavioral weight loss data. We have two variables: percent weight loss and a date variable (converted to number of days since starting treatment). We have more data (i.e., baseline lab results, psychosocial measures, etc., that are being entered). We're curious to see at this point if the longitudinal weight loss curves can be clustered into a subset of classes (such as weight losers, weight plateauers, etc.). Because the data were not collected in discrete time intervals, I thought multilevel modeling was the best approach to use. I found a 3 class solution to fit the data best. I wanted to read these classes out to place in our database; however, it appears individuals are being placed in different classes at different time points. For example, case 508 shows that they were classified in class 3 on day 0, but class 2 by day 36. Any idea what may be wrong?

TITLE: LCA for Weight Loss Trajectories;
DATA: File is wtloss.dat;
VARIABLE: names are caseid wt pwl days;

Usevar = pwl days;
Classes = c (3);
Cluster = caseid;
within = days;
missing are all (-999);

ANALYSIS: type = twolevel mixture;
Estimator = ML;
Starts = 0;

MODEL:
%WITHIN%
%OVERALL%
pwl on days;
c on days;

Output: sampstat stdyx tech1 tech8;
PLOT: Type = PLOT2;

SAVEDATA: FILE IS "threeclass.txt";
SAVE IS CPROB;
 Bengt O. Muthen posted on Friday, August 26, 2016 - 5:20 pm
I think you want classes of subjects where in this case subjects is level 2. This means that the latent class variable should be put on the Between list. See UG for between-level latent class examples.
 Linda Lin posted on Monday, November 14, 2016 - 10:02 am
I'm running a mixture twolevel model in mplus. I tried to let the between level model to be different across classes. However, it seems like the Mplus does not allowed between level parameter to be different across classes. Here is the code and the error message I got:

Model:
%within%
%Overall%
M_w by M1-M8;
SS_w by SS1-SS4;
M_w (fw);
M_w on SS_w;
[M_w ];
SS_w;
[SS_w];

%G#2%
M_w (nw);
M_w on SS_w@0;


%between%
%Overall%
M_b by M1-M8;
SS_b by SS1-SS4;
M_b on SS_b;
M_b (fb);
[M_b ];
SS_b;
[SS_b];

%G#2%
M_b on SS_b@0;
M_b (nb);


*** ERROR in MODEL command
Parameters involving between-level variables are not allowed to
vary across classes. Parameter: M_B ON SS_B
*** ERROR in MODEL command
Variances of between-level variables are not allowed to vary across
classes. Variance of between-level variable: M_B

Does Mplus allow me to fit two different between level models for two different groups?

Thanks!
 Tihomir Asparouhov posted on Tuesday, November 15, 2016 - 10:42 am
If the latent class variable is a within level variable it is illogical to expect that it affects these coefficients. It has to be a between level variable. If so that has to be specified in the input. See user's guide example 10.2.
 Melvin C Y posted on Sunday, October 29, 2017 - 9:42 am
I'm trying to specify a 3 class ML LPA model and specified

classes cw(3);

However I've seen past papers that specified both within and between level classes:

classes cw(3) cb(3);

I've tried both and know there's a difference but just not sure which is more appropriate. If it helps, my LPA indicators are at the within level and I'd like to test a between level predictor on profile membership.

Thank you.
 Bengt O. Muthen posted on Sunday, October 29, 2017 - 5:55 pm
If your are interested in a between-level latent class variable you should use only cb (declared as Between= cb).
 John B. Nezlek posted on Friday, December 28, 2018 - 1:56 pm
Hi Bengt et al.,

I have been running some multilevel mixture models. I am interested in only level 2 classes and have specified the following:

classes = cb(3);
between = cb;

There is no between model statement other than the specification for cb. To wit:

%between%
%overall%
%cb#1%
[s1 s2 s3 s4]
%cb#2%
[s1 s2 s3 s4]

Where s1 s2 s3 s4 are random coefficients from the within model.

The analyses work okay (I am not certain how well the models fit, but that is another matter).

I write because I am curious why I receive what appears to be a latent class analysis at the within level that has the same number of classes that were specified for the between level. This analysis has class counts and proportions based on the number of within observations.

Nevertheless, I do not receive a similar summary for the between level, which is the focus of the analyses. I assume that this is available via the savedata option, but I was wondering if there was a way to obtain this directly in the initial output.

Thank you for reading this.

Happy New Year,
John
 Tihomir Asparouhov posted on Friday, December 28, 2018 - 10:17 pm
Unfortunately not but it is easy to get via savedata. For example, add to user's guide example 10.2 this command
savedata: file=1.dat; save=cprob;

Then using a second run like this can get you various quantities

DATA: FILE = 1.dat;
VARIABLE:NAMES ARE y x1 x2 w cp1 cp2 cb clus;
USEVARIABLES = cp1;
useobs are cb eq 1;
BETWEEN = cp1;
CLUSTER = clus;
ANALYSIS: TYPE = basic twolevel;
 John B. Nezlek posted on Saturday, December 29, 2018 - 12:24 am
Dear Tihomir,

Thank you for the quick reply. I assume that the within classes are based on means for the within variables, without regard to clustering. Yes?

John
 John B. Nezlek posted on Saturday, December 29, 2018 - 12:26 am
Excuse me, not means, but observations.
 Tihomir Asparouhov posted on Sunday, December 30, 2018 - 6:39 pm
The within level proportions are based on the observations distribution across classes. If a cluster is in class 2, then all observations in that cluster are in class 2.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: