Description Usage Arguments Details Value Note Author(s) Examples
For a given level of significance, this routine computes approximated or exact conservative and/or liberal critical values under the hypothesis of no association.
1 2 
prob 
the nominal level of significance. 
n 
the number of ranks. 
index 
a character string that specifies the rank correlation used in the test. Acceptable values are: "spearman", "kendall","gini", "r4" (Tarsitano), "fy1" (FisherYates based on means), "fy2" (FisherYates based on medians),"sbz" (symmetrical BorroniZenga). Only enough of the string to be unique is required. 
approx 
a character string that specifies the type of approximation to the null distribution: "vggfr", "exact","gaussian","student". 
print 

lower.tail 
logical; if 
This routine provides two exact quantiles corresponding to a conservative level (next smaller exact size) and a liberal level (next larger exact size). It can be noted that, liberal levels yield critical values of the twosided 2<alphalevel test.
In the case of n>26 (Spearman) or n>60 (Kendall) or n>24 (Gini) or n>15 (r_4, fy1, fy2 and sbzZ), an approximated, but unique quantile is produced according to approx
. The default option is "vggfr"
in the case of Spearman and r_4; "gaussian"
for Kendall, "fy1", "fy2", and "sbz"; "student"
for Gini's cograduation.
A recursive formula is employed in the case of Kendall's rank correlation. Exact computations use frequencies obtained by complete enumeration for the other coefficients.
a list containing the following components:
n 
number of ranks. 
Statistic 
coefficient of rank order association 
Level 
nominal level 
Cq 
conservative quantile 
Cv 
conservative pvalue 
Lq 
liberal quantile 
Lv 
liberal pvalue 
The quantile function Q(.) of a symmetrical distribution satisfies:
Q(0.5)Q(p)=Q(1p)Q(0.5)\quad for \ 0<p< 0.5
Agostino Tarsitano, Ilaria Lucrezia Amerise and Marco Marozzi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 
data(Insuhyper); attach(Insuhyper)
op<par(mfrow=c(1,1), mgp=c(1.8,.5,0), mar=c(2.8,2.7,2,1),oma=c(0,0,0,0))
plot(PI,TG,main="Rank correlation between obesity and triglyceride response",
xlab="Ponderal Index", ylab="Plasma triglyceride concentration", pch=19,
cex=0.9, col= "rosybrown4")
text(PI,TG,labels=rownames(Insuhyper),cex=0.6,pos=c(rep(3,10),1,3,1,rep(3,4),1.3))
abline(v=mean(PI),col="black",lty=2,lwd=1)
abline(h=mean(TG),col="darkblue",lty=2,lwd=1)
par(op)
r<comprank(PI,TG,"spearman","gh")$r
a1<qrank(0.025, length(PI), "sp", "vggfr", print = FALSE,lower.tail = TRUE)$Cq
a2<qrank(0.975, length(PI), "sp", "vggfr", print = FALSE,lower.tail = TRUE)$Cq
cat(round(a1,4),round(r,4),round(a2,4))
r<comprank(PI,TG,"kendall")$r
b1<qrank(0.95, length(PI), "ke", "ex", lower.tail = TRUE)$Cq # p = .05, onetailed (upper)
b2<qrank(0.05, length(PI), "ke", "ex", lower.tail = TRUE)$Cq # p = .95, onetailed (upper)
cat(round(b2,4),round(r,4),round(b1,4))
detach(Insuhyper)
#####
#
a<qrank(0.10,61,"Ke","St")
a<qrank(0.01,25,"Sp","Ga",FALSE,FALSE);a$Cq
a<qrank(0.03,11,"fy1","Ga",FALSE,FALSE);a$Cq
a<qrank(0.03,11,"fy2","Ga",FALSE,FALSE);a$Cq
a<qrank(0.03,11,"sbz","Ga",FALSE,FALSE);a$Cq
a<qrank(0.001,15,"r4","Ex",FALSE,FALSE);cat(a$Cq,a$Lq,"\n")
a<qrank(0.01,14,"fy2","Ex",FALSE,FALSE);cat(a$Cq,a$Lq,"\n")
#####
#
a<qrank(0.05,27,"Gi","Vg",FALSE,FALSE);a$Cq

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.