How to test the significance of a mediation effect

How to test the significance of a mediation effect?, To perform a sobel test in R is covered in this lesson.

Using R to run a Sobel test
We can use the bda package to run a sobel test in R.

install.packages('bda')
library(bda)

How to test the significance of a mediation effect

The following is the fundamental syntax for performing a sobel test.

Best Data Science YouTube Tutorials Free to Learn – Data Science Tutorials

mediation.test(mv,iv,dv)

where iv stands for the independent variable, dv for dependent variable, and mv is for the mediator variable.

Using a list of 50 normal random variables as the mediator variable, independent variable, and dependent variable, the following code performs a Sobel test.

              Sobel Aroian Goodman
z.value -0.5312235 -0.4533736 -0.6708299
p.value 0.5952639 0.6502797 0.5023289

In this instance, the values in the Sobel column are what we are most concerned with. The p-value that corresponds to the z-value of -0.5312235 is 0.5952639.

Hypothesis Testing Examples-Quick Overview – Data Science Tutorials

We would be unable to reject the null hypothesis that there is no mediation effect because this p-value is higher than the alpha level of 0.05.

There is therefore no statistically significant mediation effect.

Note: In your own test, you can use a different alpha level. The usual options for alpha are 0.01, 0.05, and 0.10.

How to perform the Kruskal-Wallis test in R? – Data Science Tutorials

You may also like...

No Responses

  1. Nice! Wasn’t aware of this function.

Leave a Reply

Your email address will not be published. Required fields are marked *

sixteen − 4 =

Ads Blocker Image Powered by Code Help Pro

Quality articles need supporters. Will you be one?

You currently have an Ad Blocker on.

Please support FINNSTATS.COM by disabling these ads blocker.

Powered By
100% Free SEO Tools - Tool Kits PRO