Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mediation testing with -medeff-: levels for continuous treatment

    Dear Statalist members,

    I am using Stata 14.2 on MacOS to test a mediator model where the treatment (IV) is continuous, the mediator (M) is binary and the outcome (DV) is continuous. I use the user-written command -medeff- to estimate whether the indirect effect (IV on DV via M) is statistically significant. -medeff- is part of the Mediation package from SSC and documented in the following article in the Stata Journal:

    Hicks, R., & Tingley, D. (2011). Causal mediation analysis. Stata Journal, 11(4), 605-619.

    However, I am not sure (and sincerely hope that I haven't missed it somewhere) whether the IV needs to be a binary variable. The -medeff- command requires users to set "levels" of the treatment variable (i.e., control and treatment condition). If nothing is specified, the command assumes that the levels of the treatment are 0 and 1. However, my treatment variable (IV) can take values from 1 to 7 and everything in between, as the variable was measured with multi-items each on a Likert scale from 1 to 7.

    I have estimated three different sets of models (x1-3 are control variables):

    1) Using my original treatment variable (without specifying the levels for the treatment, thus, the command assumes [0 1]
    Code:
    medeff (logit M IV x1 x2 x3) (regress DV IV M x1 x2 x3), treat(IV) mediate(M)
    
    [output omitted]
    
    ------------------------------------------------------------------------------------
            Effect                 |  Mean           [95% Conf. Interval]
    -------------------------------+----------------------------------------------------
            ACME                   |  .0002402     -.0203698      .0240611
            Direct Effect          |  .1552511     -.0003194      .3100036
            Total Effect           |  .1554913      .0033906      .3079827
            % of Tot Eff mediated  |  .0014808      .0006634      .0110117
    ------------------------------------------------------------------------------------
    2) Using a normalized treatment variable that is in the range between 0 and 1

    Code:
    medeff (logit M IV_normalized x1 x2 x3) (regress DV IV_normalized M x1 x2 x3), treat(IV_normalized) mediate(M)
    
    [output omitted]
    
    ------------------------------------------------------------------------------------
            Effect                 |  Mean           [95% Conf. Interval]
    -------------------------------+----------------------------------------------------
            ACME                   | -.0940051     -.2580492      .0304379
            Direct Effect          |  .8625058     -.0017743      1.722242
            Total Effect           |  .7685007     -.0944182      1.656022
            % of Tot Eff mediated  | -.1130681     -.9799373      .6520454
    ------------------------------------------------------------------------------------
    3) Original treatment variable, but I specified treatment levels 1 to 7 (and tried other levels as well) leading to an error message

    Code:
    medeff (logit M IV x1 x2 x3) (regress DV IV M x1 x2 x3), treat(IV [1 7]) mediate(M)
    
    r(3000)
    nothing found where subexp expected
    Interestingly, the regressions in all three models (which -medeff- estimate) yield the exact same results in terms of Chi2-values (logit) and F-values (OLS) and the indirect effect (ACME) seems to be non-signifikant (CI include 0) in 1) and 2), while 3) yields only an error message.

    Long story short: Can I use -medeff- for my model after all and if not, what would be alternatives (-paramed- requires also levels for the treatment and -gsem- cannot distinguish the direct/indirect effect)?

    My apologies for the long text and thank you in advance for any suggestions on this matter!

    Kind regards,
    Florian

  • #2
    Added: The square brackets are not to be typed: they indicate that what's inside is optional. See, for example, the help for regress.

    The program expects one or three terms in the treat() option; the required term is the treatment variable; the optional ones are the "to" and "from" values. So specify
    Code:
    treat(IV 1 7)
    Last edited by Steve Samuels; 08 Aug 2018, 19:57. Reason: Corrected number of terms allowed for the treatment option.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Originally posted by Steve Samuels View Post
      Added: The square brackets are not to be typed: they indicate that what's inside is optional.

      So specify
      Code:
      treat(IV 1 7)
      Thank you for the hint, Steve - that has worked!

      The results of my set of models 2 (normalized treatment variable) and 3 (treat 1 7) are rather similar (which makes sense, as in both cases the difference in levels comprises the full range of the treatment scale).

      I will still ask the authors of -medeff- whether their command can be used for models with a continuous treatment to be on the safe side before I report the results somewhere.

      Comment


      • #4
        Dear Florian, I came to this topic because I also work with a continuous treatment variable. I was wondering, did you ask the authors if you can use the model for a continuous treatment variable and what was their response?

        Comment


        • #5
          Dear Lisa, sorry for the belated response. Unfortunately, I haven't contacted them, as the research project was halted for other reasons in the meantime. If you find a solution, I would be pleased to hear about it!

          Comment


          • #6
            Dear Lisa, did you by any chance find support for having a continuous treatment variable in medeff?

            Comment


            • #7
              Originally posted by Karin Freiberg View Post
              Dear Lisa, did you by any chance find support for having a continuous treatment variable in medeff?
              Dear Karin, did you find any support for having a continuous or discrete treatment used in medeff?

              Comment

              Working...
              X