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
Related Posts with SEM and lincom with categorical variables
Generate variables with ratios of subgroup valuesHello! I got stuck solving a problem which must be very simple to address, apologies if I am overloo…
Which method do I need for my research project?Hi guys, currently I'm working on a research project... or at least I try to find out if it is suit…
Data input: Please help!How do I answer this questions using stata. 1. Describe your sample i.e. provide sample characteris…
Fixed Effects with non-stationary variables and panel dataHello, I have a technical question surrounding a fixed effects model using the xtreg (variables) ,f…
Looping over cell-range with import excelDear All, This is my first post on the forum. My task is to import into stata a number of excel fi…
Subscribe to:
Post Comments (Atom)
0 Response to SEM and lincom with categorical variables
Post a Comment