Time-varying covariates PreviousNext
Mplus Discussion > Latent Variable Mixture Modeling >
 Anonymous posted on Thursday, May 20, 2004 - 2:23 pm
In many published papers that have employed proc traj to define latent trajectory classes, the authors have assigned subjects to their "most likely class" via the posterior probs. and then assessed differences in both non-time varying and time-varying covariates as a function of class membership. Of course, the mplus approach of including the covariates in the gmm model seems much more desirable. While I understand how to incorporate non-time varying covariates (both predictors of class membership and distal outcomes of class membership) in a gmm, I'm unclear on how best to incorporate time-varying covariates. Ultimately, I'd like to present the probability of several different time-varying covariates at each age for each of my latent trajectory classes. Do you have any advice for me?
 bmuthen posted on Friday, May 21, 2004 - 9:10 am
Time-invariant covariates are typically modeled as predictors of the latent class variable and therefore you can easily see how class probabilities change as a function of those predictors, examining the estimated slopes. For all other variables, you get the estimated means in each class when you request Tech7 and/or Residual output. Typically, time-varying covariates would not be predictors of the latent class variable since the latent class variable is typically viewed as time-invariant - unless you want to use latent transition modeling.
 Anonymous posted on Friday, May 21, 2004 - 12:26 pm
Thank you for your response. To add the time-invariant predictors to the model would I just include them in the usevariables command and allow them to be considered y variables? And, does this violate any assumptions given that the time varying covariates are likely to be correlated with one another?
 bmuthen posted on Friday, May 21, 2004 - 12:50 pm
Yes, you simply include them in the usev command. Saying "yt on xt" in the Model command, they will be considered x variables and are therefore freely correlated.
 Anonymous posted on Tuesday, June 08, 2004 - 2:22 pm
Thank you for your advice on this. I've been exploring my data using this technique and I have a clarification question. I'm modeling the latent trajectory classes of committing an assault (binary) over 13 measurement occassions. I want to include several time-varying covariates that I believe are subtantively important, including gang membership and illicit drug use. My intent is to allow them to be part of the model in order to develop the best possible growth mixture model of assault and also to see how these TVC's change over time as a function of group membership. I'm confused about how these should be entered into my model. That is, if I just include them as Y variables should I allow them to be correlated with one another and with assault within measurement occassion? Do you have any advice for the best specification of my model? Thank you!
 Linda K. Muthen posted on Wednesday, June 09, 2004 - 8:05 am
You could include the repeated measures of gang membership and illicit drug use either as time-varying covariates or as parallel growth processes.
 Anonymous posted on Wednesday, June 09, 2004 - 8:32 am
As a TVC, should I allow them to be correlated within time within each class-assault at age 20 with gang membership at age 20? And, is this possible with binary outcomes in mplus (both assault and gang membership are binary in my model)? Do you have an example on your website (or in your book) in which a TVC is added to a growth mixture model - I've looked but can't seem to find one. Thank you again for your help.
 Linda K. Muthen posted on Thursday, June 10, 2004 - 8:12 am
The TVC's are correlated automatically. The model is estimated conditioned on the x variables and you can obtain the correlations among the TVC's by asking for SAMPSTAT in the OUTPUT command. You can generalize Example 6.12 which has time-varying covariates to the mixture case.
 Anonymous posted on Thursday, June 10, 2004 - 9:41 am
Thank you. By correlation within time, I meant that I wanted to be able to correlate assault at age 13 with gang membership at 13, and assault at age 14 with gang membership at 14, etc. Is it possible to do this with binary items in a GMM?
 Linda K. Muthen posted on Friday, June 11, 2004 - 9:09 am
I believe all of the variables you are referring to are exogenous. They are not part of the model estimation. The model is estimated conditioned on them. Because of this these correlations are not part of the results. If they were, they would be the values obtained from the sample statistics. I think you might be confused by the fact the the covariances of latent class indicators cannot be correlated using the WITH option. This must be done using a trick.
 Anonymous posted on Sunday, June 13, 2004 - 9:11 pm
I see, thank you for your patience with me. So, if I understand correctly, then by including TVC's in this way, the GMM model shouldn't change at all. Rather, the sampstat output simply gives me the correlations. This is exactly what I want because I don't want my GMM of assault to be changed by the inclusion of the TVC's...(like what would happen if I thought of the model as a dual trajectory model). I simply want to graphically plot how the means of my TVC's change over time differently across the latent trajectory classes estimated by the GMM. Is my understanding of this correct? And, one last question...it seems that anyone with a missing TVC is deleted (my sample size is cut in half when I include the TVC's in the USEV command). Is there a way that the missing TVC's could be estimated using FIML with the rest of the model?
 Linda K. Muthen posted on Monday, June 14, 2004 - 6:47 am
The GMM model may change by adding covariates. But the correlations among these covariates will be the values of the sample statistics. The following paper can be downloaded from the homepage of our website. It discusses model changes when covariates are added.

Muthén, B. (2004). Latent variable analysis: Growth mixture modeling and related techniques for longitudinal data. In D. Kaplan (ed.), Handbook of quantitative methodology for the social sciences. Newbury Park, CA: Sage Publications, in press.

Regarding losing cases with missing on covariates, if you mention their variances in the model command, you will not lose them. The normality assumption will change from normality conditioned on the x's to normality.
 Anonymous posted on Monday, June 14, 2004 - 6:41 pm
Thank you for the reference, the paper was extremely helpful. I can't seem to find the examples that you refer to in the footnote on page 362. Have they been moved?
 Linda K. Muthen posted on Tuesday, June 15, 2004 - 9:06 am
The examples have not yet been posted.
 Anonymous posted on Tuesday, August 30, 2005 - 7:02 am
I am trying to estimate a lgmm that includes 12 timepoints over the course of a year but each timepoint of the outcome measure (y) does not represent the same month for each individual. I would like to add time-varying covariates (x) that were measured at baseline, 6-, and 12-months for all individuals. Essentially I want to regress class membership on the slope of the time-varying covariate. Using y6 on x6 does not work in this case because y6 is not month 6 for all individuals.

Can Mplus estimate a model that includes the intercept and slope of the covariates as predictors of either class membership or the i and s of the outcome variable?

 bmuthen posted on Tuesday, August 30, 2005 - 7:22 am
Mplus can predict class membership from latent variables such as growth factors. This requires numerical integration in the ML estimation (algorithm = integration).

Indidividually-varying times of observation (different months of measurement) can be handled in Mplus. But if "y_t on x_t" changes as a function of t (time; i.e. month), the estimation would be problematic since each person (measurement time) would have its own slope in this regression. Perhaps you can group months together that have approximately the same slope.
 Arina Gertseva posted on Monday, July 12, 2010 - 10:06 am
Hello, I'm fitting the latent mixture model for the homicide rate at the county level over 20 years. My first question concerns with counties with homicide rate of 0.000. Does Mplus inclide them in the analysis? On a graph these points are missing, and in the individual graph file these counties are assigned 999.000 numbers. I tried to use a rate of 0.001 instead of 0.000, but it did not help. Please advise me on what could be done in such instances? My second question refers to the time of execution. For example, a four-class model takes more than 176 hours to execute. Is there any way to speed up the execution?
 Linda K. Muthen posted on Tuesday, July 13, 2010 - 7:57 am
Mplus does not exclude any data from the analysis. An analysis that takes so long may be set up incorrectly. Please send the files and your license number to support@statmodel.com.
 Philippa Clarke posted on Tuesday, December 07, 2010 - 11:15 am
I am running a growth mixture model with a binary outcome and a time varying covariate. Is it possible to estimate a random slope for the time varying covariate when TYPE=MIXTURE?
 Linda K. Muthen posted on Tuesday, December 07, 2010 - 1:54 pm
Yes, this is possible using TYPE=MIXTURE RANDOM.
 Hemant Kher posted on Friday, December 17, 2010 - 8:49 am
Hello Professor Muthen, I have a question about my model with a time varying covariate (TVC). I have modeled growth in Y measured at 4 points (y1-y4). X is TVC measured at same time points (x1-x4). The growth model (M1) for Y with TVC fits well. When I include gender, a time-invariant covariate in the growth model with TVC (M2), the fit deteriorates. However, when I regress y1-y4 on Gender directly while retaining x1-x4 as TVC (M3) the fit for M3 improves significantly compared to M2. I have not seen such a model before (and it seems like I am modeling growth while controlling for TVC and gender). Do you have any thoughts on this (at your convenience). Thank you as always.
 Linda K. Muthen posted on Friday, December 17, 2010 - 9:05 am
Please send the outputs that illustrate the problem and your license number to support@statmodel.com. It would be impossible to say without further information.
 Laura posted on Tuesday, November 13, 2012 - 3:09 am
Hi! I am doing a latent class growth analysis with a count outcome similar to the example 8.11. in the Userís Guide. Is it possible to add a time-varying covariate to this model? Or is it only possible with GMM models?
 Linda K. Muthen posted on Tuesday, November 13, 2012 - 8:38 am
You can add time-varying covariates to that model.
 Joe posted on Wednesday, September 10, 2014 - 10:36 am
What is the equation for the estimated outcome mean at timepoint t with a dichotomous time-varying covariate?
 Bengt O. Muthen posted on Wednesday, September 10, 2014 - 12:59 pm
Just add

+ beta*Mean(x_t) to the formulas on slides
97-98 of Topic 3.
 Joe posted on Wednesday, September 10, 2014 - 1:44 pm
Where Mean(x_t) is the observed mean of the categorical time-varying variable x at time-t?

In this case, at t1, the beta = -0.027 and the observed mean for x at t1 = .054. This difference is negligible at the intercept and I am having trouble with interpretation.
 Bengt O. Muthen posted on Wednesday, September 10, 2014 - 3:50 pm

When you say negligible I assume you also take into account the variance of the DV you consider. A rare x event together with a small beta might not have much of an impact.
 Joe posted on Thursday, September 11, 2014 - 7:24 am
Please forgive my lack of understanding.

What is the difference between my dichotomous indicator (special education) predicting the intercept versus time0? Assume no other predictors in the model.

In these cases:

i ON sped; beta = -2.616 (0.250)

t0 ON sped; beta = -0.742 (0.154)

The first most closely matches the observed means of the outcome at t0
 Bengt O. Muthen posted on Thursday, September 11, 2014 - 12:36 pm
The effect on the intercept has an indirect effect on the outcome at all time points. You may want to study our video and handout for Topics 3 and 4 on our website.
 Richard E. Zinbarg posted on Sunday, March 27, 2016 - 3:05 pm
I am trying to run a survival analysis predicting onsets of major depression with a latent variable as a time-invariant covariate (Neuroticism) together with an observed, time-varying covariate (major stressful life events) and I'd like to include the interaction of the two covariates. When I only have the time-varying predictor in the model, Mplus allows me to constrain the effects of that variable to be equal over all the waves of assessment which I find very desirable to get a single test of the effects of that variable with greater power than the test of its effect at each assessment wave. This also makes it comparable, in my view, to a conventional survival analysis which provides a single test of the effect of a time-varying covariate. Once I add the time-invariant covariate, however, I get the following "Fatal Error" message:

Can I get a single test in Mplus of the effect of the time-varying covariate (and its interaction wtih the time-invariant covariate) with the time-varying covariate in the model? If so, how? Thanks in advance!
 Bengt O. Muthen posted on Sunday, March 27, 2016 - 6:00 pm
Please send the output with the Fatal Error message to Support along with your license number.
 Eva Guerin posted on Wednesday, June 08, 2016 - 11:41 am
Hi there Dr. Muthen,

I am fairly new to Mplus.
Basically, I am hoping to find examples of syntax for dual trajectory and/or multitrajectory latent class growth analyses.

I have figured out how to find single variable trajectories in my 5-year cohort study data, but now I want to see if people also follow specific trajectories for a combination of variables (i.e., for some people depression goes up and vigour goes down over 5 years, for others depression and vigour stay consistently high, etc. So far, I can only do depression and vigour seperately).

Any resources or sample syntaxes you could provide would be immensely helpful. I just need a starting point! I have read articles where results are presented (using Mplus or SAS) but what I really need is how to write in my variables in Mplus...
 Bengt O. Muthen posted on Wednesday, June 08, 2016 - 12:55 pm
 J.D. Haltigan posted on Sunday, September 11, 2016 - 11:45 am
I am attempting to model Nagin et al.'s (2003) concept of turning points in an LCGA within Mplus.

My understanding is that the time varying-covariate (TVC) or 'turning point' [which is a binary yes/no occurrence] is regressed on the latent trajectory classes such that in the case of a 3-class LCGA:

c#1 ON TVC;
c#2 ON TVC;

But I'm not sure if this is what I want which is how the turning point (say school transition) effects the within class 'average' trajectory parameters of a given construct. Perhaps to conceptually replicate the turning points analyses it is necessary to move to GMM?
 J.D. Haltigan posted on Sunday, September 11, 2016 - 12:54 pm
Adding to the above, perhaps Nagin's turning point concept could be recast as the probability of a known class (did or did not experience the turning point) transitioning into one of the latent growth classes?
 Bengt O. Muthen posted on Sunday, September 11, 2016 - 4:15 pm
Could you give the full reference for that?
 J.D. Haltigan posted on Sunday, September 11, 2016 - 6:11 pm
Sure thing:

The original paper:

Nagin et al (2003). Life course turning points: The effect of grade retention on physical aggression. Dev. & Psychopathology, 15, 343-361.

The only other article I have seen with the same 'analytic template' as the Nagin et al. piece is:

Gaudreau et al. (2009). Trajectories of affective states in adolescent hockey players: Turning point and motivational antecedents. Dev. Psychology, 45, 307-319.

Both analyses done using SAS PROC TRAJ.
 Bengt O. Muthen posted on Monday, September 12, 2016 - 10:56 am
Sounds similar to what we have in the handout for short course topic 3, slides 157 and on. See also the reference given there.
 J.D. Haltigan posted on Monday, September 12, 2016 - 11:48 am
Many thanks!
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