var_error_spearman: Estimate the error variance of Spearman rank correlations

View source: R/var_error.R

var_error_spearmanR Documentation

Estimate the error variance of Spearman rank correlations

Description

Estimates the variance of Spearman rank correlations (\rho) using the Fieller correction.

Usage

var_error_spearman(r, n, correct_bias = TRUE)

Arguments

r

Vector of rank correlations.

n

Vector of sample sizes.

correct_bias

Logical argument that determines whether to correct error-variance estimates for small-sample bias in correlations (TRUE) or not (FALSE).

Details

The sampling variance of a Spearman rank correlation is approximately:

var_{e}=\frac{1.06 \times (1-r^{2})^{2}}{n-1}

This can be corrected for bias in the sample correlation by first correcting the correlation (see correct_r_bias()) prior to estimating the error variance.

Value

A vector of sampling-error variances.

References

Bishara, A. J., & Hittner, J. B. (2017). Confidence intervals for correlations when data are not normal. Behavior Research Methods, 49(1), 294–309. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/s13428-016-0702-8")}

Examples

var_error_spearman(r = .3, n = 30, correct_bias = TRUE)
var_error_spearman(r = .3, n = 30, correct_bias = FALSE)

psychmeta/psychmeta documentation built on April 29, 2024, 11:30 p.m.