Hi Statalist,
I would like to test a U-shaped relationship using utest. There is a moderator in the model.
I am not sure how to put moderator in utest. Has anyone had experience with this?
I have tried to write the code below, but I am not sure whether it is correct.
Dependent variable: Y
Independent variable: X
Moderator: M
Control Variables: A, B, C
Code:
I would like to test a U-shaped relationship using utest. There is a moderator in the model.
I am not sure how to put moderator in utest. Has anyone had experience with this?
I have tried to write the code below, but I am not sure whether it is correct.
Dependent variable: Y
Independent variable: X
Moderator: M
Control Variables: A, B, C
Code:
Code:
gen X_squard = X^2 reg Y X X_squard M c.X#c.M c.X_squard#c.M M A B C utest X X_squard
Comment