Define/ recode variable with Imputed ... PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Yuli Tak posted on Thursday, June 13, 2013 - 1:04 pm
I'm am trying to understand a 2-way interaction gender x condition (both dichotomous variables) in a regression model using clustered imputed data.
To understand the interaction completely I have to recode the variables, to change the reference group of gender. Is there a way by which this is possible in Mplus? I understood that the Define option might work. Is this possible? Where in the syntax should it be written? Should I save the data first before running the analysis?

title: Imputation adolescent vars T4 effect
data: FILE IS imputelist.dat;
FORMAT IS 4f8.0, 14f8.2;
TYPE=individual;
TYPE=imputation;
variable:NAMES ARE imp id con sex age_at1 eth
sch scn_at1 age_at4
u1-u4 u12 u14 x1 x2 x12;
define: if sex=0 then sex=1;
if sex=1 then sex=0;
USEVARIABLES ARE age_at1 eth sch scn_at1 x12 con sex u12 int1 int2;
IDVARIABLE IS id;
missing=blank;
cluster=sch;
CATEGORICAL IS x12;

define: int1=con*sex;
int2=con*u12;
model: x12 on age_at1 eth scn_at1 con sex u12 int1 int2;

Thanks in advance
 Linda K. Muthen posted on Thursday, June 13, 2013 - 2:46 pm
You can use the DEFINE command to recode gender. See the user's guide.
 Kristen D. Seay posted on Thursday, March 06, 2014 - 10:14 pm
I am using the define command to combine two variables into a single variable. When PDS_AGPT is present in the data, then this will be the score for the new variable (TOT_AGPT). For children 11 and older with a missing value (-9) for PDS_AGPT, YCM_AGPT will be the score for TOT_AGPT. When I added my new variable TOT_AGPT into the model replacing PDS_AGPT, the syntax runs fine but output looks identical to the model with PDS_AGPT. I'm concerned I am incorrectly defining the new variable. Any suggestions are greatly appreciated!


DEFINE:

TOT_AGPT = PDS_AGPT;
IF (chdAgeY > 10 AND PDS_AGPT == -9) THEN YCM_AGPT = TOT_AGPT;
 Linda K. Muthen posted on Friday, March 07, 2014 - 12:13 pm
Use TYPE=BASIC with no MODEL command. Put only the variables used in DEFINE on the USEVARIABLES list. Save the data. Check the first few cases of the saved data and do hand calculations to see where your DEFINE statement went wrong.
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: