Skip to content

Data Science Tutorials

  • Home
  • R
  • Statistics
  • Course
  • Machine Learning
  • Guest Blog
  • Contact
  • About Us
  • Toggle search form
  • How to perform MANOVA test in R
    How to perform the MANOVA test in R? R
  • Box Cox transformation in R
    Box Cox transformation in R R
  • Methods for Integrating R and Hadoop
    Methods for Integrating R and Hadoop complete Guide R
  • How to Calculate Relative Frequencies in R
    How to Calculate Relative Frequencies in R? R
  • gganatogram Plot in R
    How to create Anatogram plot in R R
  • How to Add Superscripts and Subscripts to Plots in R?, The basic syntax for adding superscripts or subscripts to charts in R is as follows:
    How to Add Superscripts and Subscripts to Plots in R? R
  • Tips for Rearranging Columns in R
    Tips for Rearranging Columns in R R
  • ggdogs on ggplot2
    ggdogs on ggplot2 R
How to test the significance of a mediation effect

How to test the significance of a mediation effect

Posted on December 4December 4 By Jim 1 Comment on How to test the significance of a mediation effect
Tweet
Share
Share
Pin

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

Tweet
Share
Share
Pin
R

Post navigation

Previous Post: Hypothesis Testing in R
Next Post: How To Become a Business Intelligence Analyst

Related Posts

  • How to compare the performance of different algorithms in R
    How to compare the performance of different algorithms in R? R
  • How to Get a Job as a Data Engineer
    How to Get a Job as a Data Engineer? R
  • How to do Conditional Mutate in R
    How to do Conditional Mutate in R? R
  • How to Filter Rows In R
    How to Filter Rows In R? R
  • Is Data Science a Dying Profession
    Is Data Science a Dying Profession? R
  • How to Calculate Lag by Group in R
    How to Calculate Lag by Group in R? R

Comment (1) on “How to test the significance of a mediation effect”

  1. StatistikinDD says:
    December 16 at 8:43 pm

    Nice! Wasn’t aware of this function.

    Reply

Leave a Reply Cancel reply

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

  • About Us
  • Contact
  • Disclaimer
  • Guest Blog
  • Privacy Policy
  • YouTube
  • Twitter
  • Facebook
  • Defensive Programming Strategies in R
  • Plot categorical data in R
  • Top Data Modeling Tools for 2023
  • Ogive Graph in R
  • Is R or Python Better for Data Science in Bangalore

Check your inbox or spam folder to confirm your subscription.

  • Data Scientist Career Path Map in Finance
  • Is Python the ideal language for machine learning
  • Convert character string to name class object
  • How to play sound at end of R Script
  • Pattern Searching in R
  • display the last value of each line in ggplot
    How to add labels at the end of each line in ggplot2? R
  • How to Join Data Frames for different column names in R
    How to Join Data Frames for different column names in R R
  • Remove Columns from a data frame
    How to Remove Columns from a data frame in R R
  • Two-Way ANOVA Example in R
    How to perform One-Sample Wilcoxon Signed Rank Test in R? R
  • glm function in R
    glm function in r-Generalized Linear Models R
  • Change ggplot2 Theme Color in R
    Change ggplot2 Theme Color in R ggthemr Package R
  • Is Data Science a Dying Profession
    Is Data Science a Dying Profession? R
  • How to Use “not in” operator in Filter
    How to Use “not in” operator in Filter R

Copyright © 2023 Data Science Tutorials.

Powered by PressBook News WordPress theme