ps_one: PS-Test for the indirect effect - Single mediator path

View source: R/RcppExports.R

ps_oneR Documentation

PS-Test for the indirect effect - Single mediator path

Description

This function takes estimates and covariances, or 2 U values, for the ps-test for either one mediator of one path of an unordered mediation scenario. If estimates are passed to the function, the user must specify what distribution is to be used to find the cumulative probabilities. The p-value of the ps-test is returned. Additionally, the cutoff, specified by the percentage towards the center of the transformation region, can be specified.

Usage

ps_one(
  u1 = NULL,
  u2 = NULL,
  V1Dist = NULL,
  V1 = NULL,
  V1_VAR = NULL,
  V1_DF = NULL,
  V2Dist = NULL,
  V2 = NULL,
  V2_VAR = NULL,
  V2_DF = NULL,
  V2b = 0,
  V2b_VAR = 0,
  V2bmult = 1L,
  V1_V2_cov = 0,
  V1_V2b_cov = 0,
  V2_V2b_cov = 0,
  V1_0 = 0,
  V2_0 = 0,
  V2b_0 = 0,
  upLim = 0.5,
  alpha = NULL
)

Arguments

u1, u2

The U values to be used in the test. Given priority over estimates, but both must be supplied.

V1Dist

String value specifying the distribution of the estimate of the independent variable on the mediator. Ignored if u1 and u2 are supplied.

V1

Value of the estimate of the independent variable on the mediator. Ignored if u1 and u2 are supplied.

V1_VAR

Value of the variance of the estimate of the independent variable on the mediator. Ignored if u1 and u2 are supplied.

V1_DF

Degrees of freedom for V1. Only needed if t-distribution is used.

V2Dist

String value specifying the distribution of the estimate of the mediator (and interaction term) on the response.

V2

Value of the estimate of the mediator on the response. Ignored if u1 and u2 are supplied.

V2_VAR

Value of the variance of the estimate of the mediator on the response.. Ignored if u1 and u2 are supplied.

V2_DF

Degrees of freedom for V2. Only needed if t-distribution is used..

V2b

Value of the estimate of the effect of the interaction of the independent and mediator variable on the response. Ignored if u1 and u2 are supplied.

V2b_VAR

Value of the variance of the estimate of the effect of the interaction of the independent and mediator variable on the response. Ignored if u1 and u2 are supplied.

V2bmult

Value indicating the value of the independent variable used for the interaction. Typically 1.

V1_V2_cov

Value of the covariance between V1 and V2. Typically 0 for fully observed data.

V1_V2b_cov

Value of the covariance between V1 and V2b. Typically 0 for fully observed data.

V2_V2b_cov

Value of the covariance between V2 and V2b.

V1_0

Null value for V1.

V2_0

Null value for V2.

V2b_0

Null value for V2b.

upLim

The allowed extension, between 0 and 1, of the band towards the center of the region

alpha

Used to ensure correctly controlled type I error for large values of upLim.

Value

The smallest alpha value for which the generated rejection region leads to rejection of the hypothesis test. Can be used as a p-value.

Examples

ps_one(u1 = .02, u2= .015, upLim = .55)

ieTest documentation built on April 12, 2025, 1:49 a.m.