S2z: Convert RESI (S) estimate to Z statistic

View source: R/S2z.R

S2zR Documentation

Convert RESI (S) estimate to Z statistic

Description

Converts the robust effect size index (S) to Z statistic. Vector arguments are accepted. If different length arguments are passed they are dealt with in the usual way of R.

Usage

S2z(S, n, unbiased = TRUE)

Arguments

S

The value of the RESI estimate.

n

Number of independent samples.

unbiased

Logical, whether the unbiased or alternative estimator was used to compute RESI estimate. Default is TRUE.

Details

The formula for converting a RESI estimate to a corresponding Z statistic depends on which estimator was used to compute the RESI estimate (unbiased vs. alternative, see z2S). For the unbiased estimator, the RESI can be positive or negative and there is a 1-1 transformation from S to Z. The formula for converting S (unbiased) to the Z statistic is:

\sqrt(n)*S

For the alternative formula, if the RESI estimate is 0, the Z statistic is only known within an interval, [-1, 1]. For a non-zero S, the formula is:

\sqrt{S^2}/S\sqrt(n*abs(S) + 1)

Value

Returns a scalar or vector argument of the Chi-square statistic.

Examples

# convert S estimates with corresponding degrees of freedom to
# Z statistics estimates (using unbiased formula)
S_ests = c(-0.2, 0, 0.1)
S2z(S = S_ests, n = 300, unbiased = TRUE)

# convert S estimates with corresponding degrees of freedom to
# Z statistics estimates (using alernative formula)
S_ests = c(-0.2, 0, 0.1)
S2z(S = S_ests, n = 300, unbiased = FALSE)

RESI documentation built on April 3, 2025, 5:26 p.m.