Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Old bug in corrcoef not yet fixed
Date: Thu, 8 Jan 2009 03:43:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <gk3so5$h1e$1@fred.mathworks.com>
References: <gk3k0q$hko$1@fred.mathworks.com> <gk3oon$be3$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1231386182 17454 172.30.248.35 (8 Jan 2009 03:43:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 8 Jan 2009 03:43:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1334789
Xref: news.mathworks.com comp.soft-sys.matlab:510353


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message 
>   As I understand it, the confidence level set with the 'alpha' parameter is used in computing the confidence interval bounds, 'rlo' and 'rup', returned in the third and fourth output values of 'corrcoef':
> 
>  [r,p,rlo,rup] = corrcoef(...)
> 
> It has nothing to do with the 'r' and 'p' values returned.  In particular the 'p' values, which are based on a statistical normality assumption about the data, do not involve a confidence level setting.  To quote Mathworks' documentation, "Each p-value is the probability of getting a correlation as large as the observed value by random chance, when the true correlation is zero."  You don't need a confidence level to make such a probability assessment, just a reference to an assumed probability distribution.

-----------------
Sorry, but what I see in the docs is

[...]=corrcoef(...,'param1',val1,'param2',val2,...) specifies additional parameters and their values. Valid parameters are the following. 
  'alpha' A number between 0 and 1 to specify a confidence level of 100*(1 - alpha)%. Default is 0.05 for 95% confidence intervals.

No mention that, when 'alpha' is provided, one must have 4 argouts

And why should p be the probability for the 95% confidence only? Which is in fact is what it does.

We can confirm that by hacking the code and changing the value of variable rv before it calls tpvalue. We can than use the values from the table at 
http://physics.mercer.edu/Younce/pearson.html
to confirm that what is return is the 95% confidence value.

Why the preference to 95%?
Why not let the user choose the prefered confodence level, as the documentation suggests?