Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Why p-value is NaN or 0 using corrcoef ?
Date: Mon, 13 Apr 2009 20:08:01 +0000 (UTC)
Organization: CSU
Lines: 28
Message-ID: <gs0631$am3$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1239653281 10947 172.30.248.38 (13 Apr 2009 20:08:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 13 Apr 2009 20:08:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 951788
Xref: news.mathworks.com comp.soft-sys.matlab:532427


I play around with [R,sig] = corrcoef(a,b)

Are there any pros can explain why I got "NaN" and "0" in P-value?

Thanks,
Michael

>> a = [1 2 3 4 5 6]';
>> b= [3 4 5 6 7 8]';
>> [R,sig] = corrcoef(a,b)
R =
    1.0000
sig =
   NaN
>> a = [1 2 3 4 5 6]';
>> b= [1 2 3 NaN 5 6]';
>> [R,sig] = corrcoef(a,b)
R =
    1.0000
sig =
   NaN
>> a= [1 2 4 NaN 5 6]';
>> b= [1 2 4 NaN 5 6]';
>> [R,sig] = corrcoef(a,b)
R =
    1.0000
sig =
     0