A problem with the Spearman rank correlation function (spcorr)

From: Emilie Vanvyve <evanvyve_at_nyahnyahspammersnyahnyah>
Date: Fri Feb 18 2011 - 13:48:13 MST


I ran into another issue with the Spearman rank correlation (NCL function spcorr).

I compare two ASCII files which each contains 1 column of 1085 values (see attached). I read them in, give the data to spcorr and obtain a value of the Spearman correlation that differs from that computed with R (independently on the same files). This has been confirmed by another person who used NCL on another computer and got the same results using these files. I use NCL 5.2.0 on a Linux cluster and he uses NCL 5.2.1 on a Mac OS workstation. We also both computed the Pearson correlation (with escorc in NCL) and obtain the correct values, i.e. they match the Pearson correlation as calculated by R.

Here are the values we obtain (note that this is the square of spcorr):
- NCL value: 0.382914,
- R value: 0.005104339.

I would really appreciate if anyone could confirm/infirm this. I guess we're wrong (again), but I just can't figure out where. This time, the arrays have no missing values, just plenty of 0 and some non-zero values.


ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Fri Feb 18 13:48:19 2011

This archive was generated by hypermail 2.1.8 : Wed Feb 23 2011 - 16:47:57 MST