test.spear: Hypothesis test for a Spearman correlation

View source: R/statpsych2.R

test.spearR Documentation

Hypothesis test for a Spearman correlation

Description

Computes a t test for a test of the null hypothesis that a population Spearman correlation is equal to 0, or a z test using a Fisher transformation for a test of the null hypothesis that a Spearman correlation is equal to some specified nonzero value. The hypothesis testing results should be accompanied with a confidence interval for the population Spearman correlation value.

Usage

test.spear(cor, h, n)

Arguments

cor

estimated correlation

h

null hypothesis value of correlation

n

sample size

Value

Returns a 1-row matrix. The columns are:

  • Estimate - estimate of correlation

  • t or z - t test statistic (for h = 0) or z test statistic

  • p - two-sided p-value

See Also

ci.spear

Examples

test.spear(.471, .2, 100)

# Should return:
# Estimate        z           p
#     0.471 3.009628 0.00261568


test.spear(.342, 0, 100)

# Should return:
#  Estimate        t df            p
#     0.342 3.602881 98 0.0004965008



statpsych documentation built on Sept. 11, 2024, 7:42 p.m.