6
$\begingroup$

The very basic framework for mediation analysis (as I understand it) is below (DV = dependent variable, IV = independent variable):

Step 1: DV ~ IV
Step 2: Mediator ~ IV
Step 3: DV ~ IV + Mediator – check if the effect of the IV is reduced or lost after controlling for the mediator

However, if the mediator has to be log-transformed in step 2 to improve normality of residuals, should it also be log-transformed in step 3 (bolded below)? I have been told yes by one mentor, as it is a carry-through of the same analysis. If it should be, it would look like below. In my case the DV also had to be log-transformed, so I’ll include that as well.

Step 1: log(DV) ~ IV
Step 2: log(Mediator) ~ IV
Step 3: log(DV) ~ IV + log(Mediator) ?

In the example above, the DV and Mediator were log-transformed in steps 1 and 2, respectively, to ensure normality of residuals in those models.

Happy to provide specific variable names and R code, but the question is a general one and may not need it.

$\endgroup$
1
  • 1
    $\begingroup$ There are no theoretical reasons to avoid using the log of Mediator in step 2 but keeping Mediator as is in step 3 -- indeed, it's easy to imagine situations where that's exactly the right thing to do. (There's no basis whatsoever, though, to suppose that taking the log of one variable forces you to take logs of all the others.) But the answers you have gotten hint that you might be conducting this analysis within some larger framework; and if so, you do need to be careful that your approach doesn't violate any of the assumptions made within that framework or create inconsistencies. $\endgroup$
    – whuber
    Commented Jul 23, 2023 at 16:06

2 Answers 2

8
$\begingroup$

First, the process you have outlined is the Baron and Kenny approach. It isn't wrong, but it's quite old-fashioned and more modern approaches are available. See e.g. McGill University

Second, I agree with Rhys. If you are going to transform, you have to do it in all steps. Otherwise, you have a mess. Maybe it won't violate any statistical "rules" but it will be very hard to interpret.

Finally, why transform to get to normal residuals? Instead, use a different kind of regression that does not assume normal residuals. Two of these are robust regression and quantile regression. I would only transform if it made substantive sense (this is often the case with monetary variables). When possible, don't fit the data to the model, fit the model to the data.

$\endgroup$
2
  • $\begingroup$ Thank you so much for your response! I do hear your point about finding a better model rather than transforming to 'force' normal residuals. Transformation (log, sqrt, cube root) did not normalise the residuals for some of my other models anyway, so I may need to find alternatives after all. I had a look at your suggestion of quantile regression, and it looks like it might fit what I need! Conceptually, would you consider quantile regression to be a non-parametric alternative to a linear model? E.g. similar to Mann-Whitney U as a non-parametric alternative to student's t-test? $\endgroup$
    – Jade
    Commented Jul 24, 2023 at 4:23
  • 1
    $\begingroup$ I am not a huge fan of the terms "parametric" and "non-parametric". Rather, I like to look at what each model assumes about the data. $\endgroup$
    – Peter Flom
    Commented Jul 24, 2023 at 9:52
5
$\begingroup$

Ahh the joys of mediation analysis. This has been the bane of my life for the last year. My first tip will be to read up on the Hayes guide to mediation, and to play around with the Hayes Process Macro: http://afhayes.com/introduction-to-mediation-moderation-and-conditional-process-analysis.html . This was an absolute life saver for me in the write stage of the research.

From my understanding, you need to be consistent in the treatment of the variables throughout the analysis. Otherwise you will have a nightmare in calculating the change of effect sizes, as you will inevitably be comparing different regression coefficients. This will ultimately cause weirdness for the final sums.

Manually calculating the mediation effect through running the separate regression models is a fantastic way to conceptually understanding the mediation process, and will make you a better researcher. But for simplifying your analysis and increased confidence, I do recommend using the Hayes Process macro (it’s available for SPSS, R and SAS). Here’s the link: https://www.processmacro.org/index.html

Good luck with the analysis!

$\endgroup$
2
  • 1
    $\begingroup$ Thank you very much for your helpful response! I will have a look through the resources. I have so far used the 'mediate' function from the mediation package to calculate mediated and direct effects from the models above, and it works quite nicely, even with linear mixed models to account for repeated measures. However, it doesn't seem to work with lqmm objects (linear quantile mixed models), which I'm now using for models where the normality assumption is violated and transformations do not correct it. This is probably a different question, but just in case you've had similar issues! $\endgroup$
    – Jade
    Commented Jul 24, 2023 at 4:33
  • $\begingroup$ No worries, glad to help. As an extra potentially useful rabbit hole to explore, it may be worth investigating the SEM framework for conducting mediation analyses. I’m not familiar with lqmm, but my instinctive guess would that an SEM approach might facilitate mediation analysis through this approach? On a more painful rabbit hole approach, it might also be worth exploring why the assumptions are being violated, and what implications this might have for your data (as a proactive methodological evaluation). Missing data, outliers and/or unreliable entries maybe influencing your results. $\endgroup$ Commented Jul 24, 2023 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.