1.2.3-SNAPSHOT
permalink

- (spearmans-rho a b)

http://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient

In statistics, Spearman's rank correlation coefficient or Spearman's rho, is a non-parametric measure of correlation – that is, it assesses how well an arbitrary monotonic function could describe the relationship between two variables, without making any other assumptions about the particular nature of the relationship between the variables. Certain other measures of correlation are parametric in the sense of being based on possible relationships of a parameterised form, such as a linear relationship.

© incanter
See http://incanter.org for copyright and license details.

(defn spearmans-rho " http://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient In statistics, Spearman's rank correlation coefficient or Spearman's rho, is a non-parametric measure of correlation ‚Äì that is, it assesses how well an arbitrary monotonic function could describe the relationship between two variables, without making any other assumptions about the particular nature of the relationship between the variables. Certain other measures of correlation are parametric in the sense of being based on possible relationships of a parameterised form, such as a linear relationship. " [a b] (let [_ (assert (= (count a) (count b))) n (count a) arank (rank-index a) brank (rank-index b) dsos (apply + (map (fn [x y] (pow (- (arank x) (brank y)) 2)) a b))] (- 1 (/ (* 6 dsos) (* n (- (pow n 2) 1))))))

© incanter
See http://incanter.org for copyright and license details.

Used in 0 other vars

## Comments top

## No comments for

spearmans-rho. Log in to add a comment.