Learn R Programming

coin (version 1.0-24)

SpearmanTest: Spearman's Test on Independence

Description

Testing the independence of two numeric variables.

Usage

## S3 method for class 'formula':
spearman_test(formula, data, subset = NULL, weights = NULL, \dots)
## S3 method for class 'IndependenceProblem':
spearman_test(object,
    distribution = c("asymptotic", "approximate"), ...)

Arguments

formula
a formula of the form y ~ x | block where y and x are numeric variables and block is an optional factor for stratification.
data
an optional data frame containing the variables in the model formula.
subset
an optional vector specifying a subset of observations to be used.
weights
an optional formula of the form ~ w defining integer valued weights for the observations.
object
an object of class IndependenceProblem.
distribution
a character, the null distribution of the test statistic can be approximated by its asymptotic distribution (asymptotic) or via Monte-Carlo resampling (approximate). Alternatively, the functions
...
further arguments to be passed to or from methods.

Value

Details

The null hypothesis of the independence of y and x is tested.

Examples

Run this code
spearman_test(CONT ~ INTG, data = USJudgeRatings)

Run the code above in your browser using DataLab