corr2p: Convert correlation coefficient to p-value

Description Usage Arguments Value Examples

View source: R/generic.R

Description

This functions converts an R value from a correlation calculation into a p-value, using a T distribution with the provided number of samples N minus 2 degrees of freedom

Usage

1
corr2p(r, N)

Arguments

r

a correlation coefficient

N

a number of samples

Value

p a p-value

Examples

1
2
3
4
5
set.seed(1)
a<-rnorm(1000)
b<-a+rnorm(1000,sd=10)
r<-cor(a,b,method='pearson')
corr2p(r,N=length(a))

vulcan documentation built on Nov. 8, 2020, 8:15 p.m.