IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    How to test the significance of a mediation effect

    Jim发表于 2022-12-04 07:30:00
    love 0
    [This article was first published on Data Science Tutorials, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
    Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

    The post How to test the significance of a mediation effect appeared first on Data Science Tutorials

    What do you have to lose?. Check out Data Science tutorials here Data Science Tutorials.

    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.

    Check your inbox or spam folder to confirm your subscription.

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

    The post How to test the significance of a mediation effect appeared first on Data Science Tutorials

    Learn how to expert in the Data Science field with Data Science Tutorials.

    To leave a comment for the author, please follow the link and comment on their blog: Data Science Tutorials.

    R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
    Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
    Continue reading: How to test the significance of a mediation effect


沪ICP备19023445号-2号
友情链接