kosukeimai / mediation

R package mediation
58 stars 29 forks source link

Could Package "mediate" support multi-categorical treatment? #49

Open minhengw opened 1 year ago

minhengw commented 1 year ago

Could Package "mediate" support multi-categorical treatment?

I could find arguments 'control.value' & 'treat.value' in the function mediate, it seems that the function could support binary treatment. I am not sure whether mediate can support multi-categorical treatment (# groups >= 3) as well. Thank you for your help in advance!

David

YiLIU001 commented 1 year ago

From what I understand, yes. In example 1: Linear Outcome and Mediator Models of mediate function documentation, the categorical treatment demonstrates this. You just need to specify the parameters control.value and treat.value.

minhengw commented 1 year ago

Got it, thank you so much!