Problem Plotting LCGA results with individually-varying time scores

Skip to first unread message

Kevin Swartout

Mar 17, 2016, 1:08:45 PM3/17/16
to MplusAutomation
Hi All,

I've plotted results of mixture models using MplusAutomation in the past with great results! But I have encountered an issue when i attempt to plot trajectories from a latent class growth model with individually-varying times of observation (tscores). I need to plot the probabilities of a three-trajectory model across the tscore values. The syntax seems to be working, as R opens a graphic window; but all of the point estimates are zero. Requesting 'mplus.get.time_scores' returns a matrix of zeros, which might be the root of the problem. The Mplus output looks good--the model terminates normally, replicating the best LL without any errors or warnings.

Am I missing a step? Or might there be something wrong with the .gh5 file?

Thanks in advance!


Jun 16, 2016, 4:15:24 PM6/16/16
to MplusAutomation
Hi Kevin,

Sorry for the long lag on this one. I'm not sure where Mplus stores the probabilities of the LCGA. This would be something to ask Mplus support, and if they can point you to the right place, we may be able to help you read it into R via MplusAutomation. The matrix of zeros you describe sounds like the data you're looking for are not available in the expected location. If the GH5 file is read in, it's unlikely to be corrupt per se, but it may not have the information you need.


Lina van Drunen

Jan 28, 2022, 9:35:54 AM1/28/22
to MplusAutomation
Hi Kevin,

I am also analyzing an LCGA with three classes and individually-varying times of observation (tscores) using MplusAutomation. I would like to plot the data in R as well but I can't manage to write a correct visualization script. At this moment I am using the following script:

# LCGA analysis
createMixtures(classes = 1:4, filename_stem = "XX",
               model_overall = "i s | x1 x2 x3 AT T1 T2 T3;\ni@0;\ns@0;",
               VARIABLE = "TSCORES = T1 T2 T3;",
               rdata = data,
               ANALYSIS = "TYPE = random mixture; STARTS = 50 10; ESTIMATOR = MLR;",
               usevariables = c("x1", "x2", "x3", "T1", "T2", "T3"),
               OUTPUT = "tech8 tech11 tech14;")

runModels(filefilter = "XX", replaceOutfile = "always")
results_XX <- readModels(filefilter = "XX")

# =visualize plot
plotGrowthMixtures(results_XX, rawdata = TRUE, jitter_lines = .1)  ## This doesn't seem to work..

Do you mind sharing your R script with me on how to visualize my LCGA data using TSCORES?
Thank you in advance!

Kind regards,

Op donderdag 17 maart 2016 om 18:08:45 UTC+1 schreef
Reply all
Reply to author
0 new messages