ds.mediationTest: The Sobel mediation test

View source: R/ds.mediationTest.R

ds.mediationTestR Documentation

The Sobel mediation test

Description

This function is similar to the R function mediation.test that is included in the bda package. The function computes statistics and p-values for three versions of Sobel mediation test: Sobel test, Aroian test and Goodman test.

Usage

ds.mediationTest(mv = NULL, iv = NULL, dv = NULL, datasources = NULL)

Arguments

mv

a string character, the name of the mediator variable

iv

a string character, the name of the independent variable

dv

a string character, the name of the dependent variable

datasources

a list of DSConnection-class objects obtained after login. If the datasources argument is not specified the default set of connections will be used: see datashield.connections_default.

Details

To test whether a mediator carries the influence on an independent variable to a dependent variable. Missing values will be automatically excluded with a warning.

Value

A table showing the values of the test statistics (z-values) and the corresponding p-values for the Sobel, Aroian and Goodman tests for each study separately.

Author(s)

Demetris Avraam for DataSHIELD Development Team


datashield/dsMediationClient documentation built on June 15, 2022, 12:19 p.m.