Dear Statalist,

Hello! I would like to conduct a mediation analysis with the help of -medeff- command in STATA.
My treatment (T) is a discrete variable that can take 0, 2, 4, and 7. The mediator (M) and the outcome (Y) is a continuous variable.

Code(simply), medeff (regress M T x) (regress Y T M x), mediate(M) treat(T) sims(1000) seed(1)

However, I am not sure whether the X needs to be a binary variable. when I checked the -help medeff-, I finded -medeff- command,treat (varname [# #]) is required and specifies the treatment variable to use in the analysis, where the numbers following the treatment name are values to use for the control and treatment conditions, respectively. By default, these are set to 0 and 1.

Should I use the command -medeff- for my models with a discrete treatment (which can take values of 0, 2, 4, and 7)? If not, I sincerely hope you can give me any suggestions on this matter. Thank you a lot!

Best wishes.
Joan Xiao