[R] cor.test formula

Chuck Cleland ccleland at optonline.net
Mon Dec 17 16:50:30 CET 2007


Monica Pisica wrote:
> Hi everybody,
>  
> I am interested in seeing how the p value is calculated for a t test for a correlation coefficient. I know that cor.test delivers the correlation coefficient and the t-test, p-value and the 95 confidence interval. I am interested  in how the p-value is calculated.
>  
> Usually if i type the name of the function i get explicitly the coding of that function, but if i type
>  
>> cor.testfunction (x, ...) UseMethod("cor.test")<environment: namespace:stats>
>  
> So .... How can i get the coding to find out how the p-value is calculated for this function?

  The following Google search finds coding for cor.test:

cor.test site:https://svn.r-project.org/R/trunk/src/

  From those 6 hits, it is a short trip to the following link:

https://svn.r-project.org/R/trunk/src/library/stats/R/cor.test.R

> Thanks,
>  
> Monica
> _________________________________________________________________
> [[replacing trailing spam]]
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894



More information about the R-help mailing list