Variable Constraint PreviousNext
Mplus Discussion > Structural Equation Modeling >
Message/Author
 Joseph Jones posted on Thursday, January 25, 2018 - 9:59 am
Hello,
I am conducting a simulation study using Latent Growth Curves. I based the initial code from example 12.2 in the user manual. However, I need to restrict the range for one of the predictor (x1) variables (i.e. a value between 0-9). Ideally, I would like an even distribution of those numbers.
I tired using the GENERATE command and making x1 an ordered categorical variable. None of my attempts have worked.
Could you direct me to the appropriate code that would solve my problem?
Thank you in advance.
-Jones
 Bengt O. Muthen posted on Thursday, January 25, 2018 - 12:58 pm
You can do this in 2 steps in line with the 2 steps of ex 12.6. Step 1 generates the ordinal data and Step 2 ("external Monte Carlo) analyzes it as continuous.
 Joseph Jones posted on Thursday, January 25, 2018 - 2:25 pm
This was very helpful. Thank you.
However, I think I am still missing something. I need the uniformly "clustered" variable as the IV affecting the growth factors.
When I run the below syntax, 6 variables are created and it looks like the clustered variable is not congruent with the population model (based on Step two of 12.6).
Thank you again for the help.
MONTECARLO:
NAMES ARE y1-y4 age;
NOBSERVATIONS = 500;
NREPS = 500;
SEED = 4533;
NCSIZES = 10;
CSIZES = 1 (50) 1 (50) 1 (50) 1 (50) 1 (50) 1 (50) 1 (50) 1 (50) 1 (50) 1 (50);
REPSAVE = ALL;
SAVE = test1_rep_*.dat;
MODEL POPULATION:
%WITHIN%
iw sw | y1@0 y2@1 y3@2 y4@3;
y1-y4*.5;
iw ON age*0;
sw ON age*.5;
iw*1; sw*.2;
%BETWEEN%
ib sb | y1@0 y2@1 y3@2 y4@3;
y1-y4@0;
ib ON age*0;
sb ON age*.5;
[ib*10 sb*2];
ib*1; sb*.2;
ANALYSIS: TYPE = TWOLEVEL;
MODEL:
%WITHIN%
Same as above
%BETWEEN%
Same as above
OUTPUT: TECH8 TECH9;
 Bengt O. Muthen posted on Friday, January 26, 2018 - 4:22 pm
I assume your "age" variable is your IV that you want equal probs for. You should put that variable on the Categorical list and give it thresholds that provide equal category probabilities. See Monte Carlo versions of the UG examples on our website for how to generate categorical variables.
 Joseph Jones posted on Monday, January 29, 2018 - 12:32 pm
When I try that, I get the following error message:
The CATEGORICAL option is used for dependent variables only.
The following variable is an independent variable in the model.
Problem with: AGE
I have looked at the MONTE CARLO COMMAND in Chapter 19 as well, still unsure on how to specify an IV as Ordered Categorical.
Thank you for the continued help.
 Bengt O. Muthen posted on Monday, January 29, 2018 - 3:57 pm
Mention the variance of age - this turns it into "a y variable" and is therefore suitable for being on the Categorical list.
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: