Significance Levels for Correlations

Share:

Description

Returns asterisks denoting statistical significance levels for a vector of correlations

Usage

1
sig.r(r, n, tail)

Arguments

r

A numeric vector of correlation coefficients

n

n the sample size associated with the vector of correlation coefficients

tail

An integer of value 1 or 2 indicating whether a one-tailed (1) or two-tailed (2) significance level is to be used.

Details

This function is called by the q.cor function to put statistical significance levels next to the resulting correlations.

Value

A symbol is returned to identify the significance level of a correlation coefficient. A value of " " denotes p > .1. A value of "+ " denotes p < .1. A value of "* " denotes p < .05. A value of "** " denotes p < .01. A value of "***" denotes p < .001.

Author(s)

Ryne A. Sherman

See Also

q.cor, ~~~

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
	# A correlation of r=.15 with a sample of 100 is significant 
	#at p < .05 using a one-tailed t-test
sig.r(r=.15,n=200,tail=1) 
	# A correlation of r=.1 is trending toward significance at p < .1.
sig.r(r=.1,n=200,tail=1)	
	# Or it can be used on a vector. 
	#This is helpful for displaying significance levels of results.
v <- c( .1, .3, .4, .05, .04, .8)
sig.labels <- sig.r(v, 200, 1)
table1 <- data.frame(v, sig.labels)
colnames(table1) <- c("r", "sig level")
table1

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.