[R] correlation given p value and sample size

2014-06-16 Thread Witold E Wolski
Hi,


Looking for and function which produces the minimum r (pearson
correlation) so that H0 (r=0) can be rejected, given sample size and
p-value?


Witold

-- 
Witold Eryk Wolski

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] correlation given p value and sample size

2014-06-16 Thread peter dalgaard
There's a simple relation 

t = r / sqrt(1 - r^2) * sqrt(n - 2)
r = t / sqrt(n - 2 + t^2)

where t has a t distribution on n-2 df. Insert t = +-qt(p/2, n-2).

-pd


On 16 Jun 2014, at 11:23 , Witold E Wolski wewol...@gmail.com wrote:

 Hi,
 
 
 Looking for and function which produces the minimum r (pearson
 correlation) so that H0 (r=0) can be rejected, given sample size and
 p-value?
 
 
 Witold
 
 -- 
 Witold Eryk Wolski
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.