I am trying to build a Monte Carlo simulation to reflect a growth curve model of an accelerated longitudinal design. Each participant is measured at 3 timepoints, but they may begin the study at any age between 20 and 60.
The important point with respect to Monte Carlo in Mplus is that I would like to sample their ages from a normal distribution for the first TSCORE variable, but each subsequent TSCORE variable should just be a linear transformation of the first one.
The syntax as I have it is below. The problem with it is that as set up now I get unrealistic values for each of the three TSCORE variables that are supposed to reflect age.
Thanks for any help!
MONTECARLO: NAMES ARE scale1-scale3 age1-age3; NOBSERVATIONS = 500; NREPS = 500; SEED = 123; MISSING = scale2 scale3; Tscores = age1(0 10) age2(1 10) age3(2 10); REPSAVE = ALL; SAVE = mc1-rep*.dat Analysis: Type=random; MODEL POPULATION: i s | scale1-scale3 AT age1-age3; [i*1 s*.25]; i*30; s*.15; i WITH s*-.5; scale1-scale3*52; MODEL MISSING: [scale2@-1scale3@-.74]; MODEL: i s | scale1-scale3 AT age1-age3; scale1 scale2 scale3 (1); OUTPUT: TECH9;
I appreciate the observation. However, I am attempting to simulate a wide range of ages for the first wave -- something like ages 18-65. I want the age at wave 2 and wave 3 to be age at wave 1 plus 1 and 2 years. (The tscores in this case stand in for centered age scores). I know I could have subtle variation about three ages, 1 year apart by reducing the SD in the TSCORES line, but I actually want quite wide variation in each tscore variable--but I want the second two tscore variables to be defined by the first. I hope that makes sense.
I do not know of any way to do what you want in the Monte Carlo setting. You might try generating the time scores for the first time point and save the data. Then in a second step use TYPE=MONTECARLO and create the other time scores using the DEFINE command, for example, time 2 = time 1 plus 1. I don't know if this two step procedure would be statistically correct however.
Thank you. One last question, somewhat related: Is there a way to constrain the values of continuous variables? For example, the scale variables in the above syntax should have a range between 0 and 100. I was exploring the GENERATE command, but couldn't find much info on it.