if (FALSE) {
mydat <- read.csv(
system.file("extdata", "ex8.2.csv", package = "MplusAutomation"))
res <- createMixtures(classes = 1:3, filename_stem = "ex8.2",
                      model_overall = 
                                    "i s | V1@0 V2@1 V3@2 V4@3;  i s on V5;",
                      rdata = mydat,
                      OUTPUT = "tech11 tech14;", 
                      usevariables = c("V1", "V2", "V3", "V4", "V5"),
                      run = 1L)
plotGrowthMixtures(res, estimated = TRUE, rawdata = TRUE, 
                   time_scale = c(0, 1, 2, 3))
plotGrowthMixtures(res, estimated = FALSE, rawdata = TRUE, poly = TRUE)
res <- createMixtures(classes = 1:3, filename_stem = "ex8.2_free",
                      model_overall = "i s | V1@0 V2* V3* V4@3;  i s on V5;",
                      rdata = mydat,
                      OUTPUT = "tech11 tech14;",
                      usevariables = c("V1", "V2", "V3", "V4", "V5"),
                      run = 1L)
plotMixtureDensities(res, variables = c("V1", "V2", "V3", "V4"))
plotGrowthMixtures(res, estimated = TRUE, rawdata = TRUE,
                   bw = TRUE, time_scale = c(0, 1, 2, 3),
                   alpha_range = c(0, .05))
plotGrowthMixtures(res, estimated = FALSE, rawdata = TRUE,
                   poly = TRUE, bw = TRUE, time_scale = c(0, 1, 2, 3))
}
Run the code above in your browser using DataLab