spearmanR: calculate the Spearman correlation for a 2 dimensional...

Description Usage Arguments Value Examples

View source: R/spearmanR.r

Description

calculate the Spearman correlation for a 2 dimensional contingency table.

Usage

1

Arguments

P

a 2 dimensional contingency table.

Value

the Spearman correlation value (r) for the observed data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(table4);
#fit an empirical correlation
mySR <- spearmanR(table4);
(boot(mySR));

#example with a dataframe:
mydf <- data.frame(W=rbinom(100,1,.5), X=rbinom(100,2,.5), Y=rbinom(100,3,.5), 
        Z=rbinom(100,4,.5));
myMC <- corrMatrix(mydf,method="spearman");

#results should be exactly identical to:
cor(mydf,method="spearman")	

jeroenooms/JJcorr documentation built on May 17, 2017, 6:15 p.m.