Hello,

I collected data on BMI and social support at 3 time points (all continuous variables). I also collected race (0/1) and group (0/1).


I want to look at the association between the change in social support and the change in BMI from Time 1 to Time 3 (calculated by subtracting the value at Time 1 from that at Time 3). I was interested in testing the interaction between race and change in social support. I start off with 48 participants and at Time 3, I have data from only 39 participants. I wanted to use -sem- to use the mlmv option to get around the problem of missing data. However, I learned this does not support categorical variables (race and group). So I made the interaction term by multiplying the change in social support by the race variable.

I wanted to further inspect the interaction using -margins-, however, it seems this cannot be done. Thus, I turned to -lincom-. However, because the race variable is not being treated as a categorical variable in my model, it seems this cannot be done either.

Can anyone suggest a way around this? I will repeat this same model for 3 additional types of social interactions.

Here is my code:

sem (BMI_31 <- SS31 Ethnicity XSS BMI_T1 Ver_SocialSupportT1 Interventionorcontrol), method(mlmv) nocapslatent

BMI_31: change in BMI
SS31: change in social support
Ethnicity: race variable
XSS: Ethnicity * SS31
BMI_T1: BMI at time 1
Ver_SocialSupportT1: social support at time 1
Interventionorcontrol: group