Re: A problem with the Spearman rank correlation function (spcorr)

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun Feb 20 2011 - 09:21:57 MST

Hi Emily,

I am not sure what the problem might be.

I have made the code used by NCL available via the WWW.

single precision:
http://www.cgd.ucar.edu/~shea/SPCORR.f

double precision:
http://www.cgd.ucar.edu/~shea/VSPCORR.f

                                        
I assume R agrees with the 3 examples at
    http://www.ncl.ucar.edu/Document/Functions/Built-in/spcorr.shtml

====
Does your ascii data contain missing values ( _FillValue )?

D

On 2/18/11 1:48 PM, Emilie Vanvyve wrote:
> Hello,
>
> 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.
>
> Emilie
>
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Feb 20 09:22:05 2011

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