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
Appending excel files - Error r(601)Hi. I am trying to append all excel files in a single folder into one big file, but the code below t…
Unexpected error with -bayes:mixed-The following Code: sysuse bplong bayes: mixed bp i.when || patient: , noconstant residuals(exchang…
Mixed-Effect Zero Inflated Negative Binomial model ??Hello, I have a study where I am evaluating the relationship between the total number of health care…
Why does the asreg command give me values for the first observations of my sample even thought I specified a min?Hello everyone! I am using the asreg command to calculate betas using one year of daily data, but I…
R-squared and -didregress-Good evening all, Is there a way to have -didregress- show a value for r-squared- as you would see …
Subscribe to:
Post Comments (Atom)
0 Response to SEM and lincom with categorical variables
Post a Comment