Hello,
I am using Stata 18 to run multiple regression analyses using the sem command, and applied method(mlmv) to handle missing data (data missing completely at random). Excep cov1, all variables are continuous. iv1, iv2, iv3 and m are mean-centered. And I generated the interaction terms (iv1*m iv2*m iv3*m) because the sem command does not allow factor notation. The sample size is 204.
Code:
The results show that the interaction term iv1*m was significant, so I proceeded with simple slope analysis, using the 'margins' command with 'dydx' option to obtain simple slopes of IV on DV at three points (representing a low score, a medium score, and a high score) along the moderator.
-.66 0 and .66 represent value of the moderator at mean, 1SD below and above the mean.
It turns out the output provides estimates based on a smaller sample without missing values (N = 165), and the dydx estimates are exactly the same for all three points of the moderator, which sounds strange if there is an interaction effect.
I tried the same margins code if I use the 'reg' command instead of the 'sem' command with mlmv, (on the smaller sample without missing values) and the output makes so much sense. I can generate the margins plot with 3 lines of different slopes to illustrate the interaction effect.
Grateful if someone may point out the issue with the code and suggest a solution for the situation. Thank you in advance.
I am using Stata 18 to run multiple regression analyses using the sem command, and applied method(mlmv) to handle missing data (data missing completely at random). Excep cov1, all variables are continuous. iv1, iv2, iv3 and m are mean-centered. And I generated the interaction terms (iv1*m iv2*m iv3*m) because the sem command does not allow factor notation. The sample size is 204.
Code:
Code:
sem (dv <- cov1 cov2 cov3 cov4 iv1 iv2 iv3 m iv1*m iv2*m iv3*m), method(mlmv) nocapslatent
Code:
margins, dydx(iv) at(m=(-.66 0 .66))
It turns out the output provides estimates based on a smaller sample without missing values (N = 165), and the dydx estimates are exactly the same for all three points of the moderator, which sounds strange if there is an interaction effect.
I tried the same margins code if I use the 'reg' command instead of the 'sem' command with mlmv, (on the smaller sample without missing values) and the output makes so much sense. I can generate the margins plot with 3 lines of different slopes to illustrate the interaction effect.
Grateful if someone may point out the issue with the code and suggest a solution for the situation. Thank you in advance.

Comment