data(Atar);attach(Atar)
op<-par(mfrow=c(1,1))
plot(TBL,TFL,main="",xlab="Backward Linkage Index",ylab="Forward Linkage Index",pch=19,
cex=0.9,col="olivedrab")
abline(h=mean(TFL),col="black",lty=2,lwd=1)
abline(v=mean(TBL),col="black",lty=2,lwd=1)
par(op)
r<-comprank(TBL,TFL,"spearman","wgh")
ranktes(r, length(TBL), "spearman", "st",FALSE, "two", TRUE)
detach(Atar)
###
data(Sharpe);attach(Sharpe)
op<-par(mfrow=c(1,1))
plot(AVR,VAR, type = "p",pch=19,cex=1.1,col="violetred",main="Mutual fund performance")
text(AVR,VAR, labels = rownames(Sharpe), cex=0.5, pos=3)
abline(h=mean(AVR),col="black",lty=2,lwd=1)
abline(v=mean(VAR),col="black",lty=2,lwd=1)
par(op)
r<-comprank(AVR,VAR,"gini","wgh")
ranktes(r, length(AVR), "gini", "st",FALSE, "two", TRUE)
detach(Sharpe)
###
# Sun,J.-G. and Jurisicova, A. and Casper, R.F. (1997). "Detection of Deoxyribonucleic
# Acid Fragmentation in Human Sperm: Correlation with Fertilization In Vitro".
# Biology of Reproduction, 56, 602-607.
n<-c(222,298,143,143,291,148);
r<-c(-0.18,-0.12,-0.16,-0.20,-0.06,-0.003)
App<-c("Ga","St","Vg")
N<-length(n)
Ta<-matrix(NA,N,5)
for (i in 1:length(n)){
Ta[i,1]<-r[i];Ta[i,2]<-n[i]
for (j in 1:3){
app<-App[j]
a<-ranktes(r[i],n[i],"S",app,FALSE,"t",FALSE);Ta[i,2+j]<-a$Cpv
}}
Df<-matrix(Ta,6,5)
rownames(Df)<-c("Conc. sperm/mL","Motility", "Fertilization rate", "Cleavage rate",
"Male age","Abstinence days")
colnames(Df)<-c("Spearman's rho","n of samples","Appr. Gaussian","Appr. t-Student",
"Appr. GGFR")
Df<-as.data.frame(Df)
print(round(Df,5))
###
data(Starshi);attach(Starshi)
op<-par(mfrow=c(1,1))
plot(Sm15F,Sm15M, type = "p",pch=19,cex=0.9,col="violetred",main="Smokers ")
text(Sm15F,Sm15M,labels = rownames(Starshi),cex=0.6,pos=c(1,rep(2,10),3,2))
abline(h=mean(Sm15M),col="black",lty=2,lwd=1)
abline(v=mean(Sm15F),col="black",lty=2,lwd=1)
par(op)
r<-comprank(Sm15F,Sm15M,"r4","wgh")
a<-ranktes(r, length(Sm15F), "r4", "ex",TRUE, "two", FALSE)
cat(a$Value,a$Cpv,a$Lpv,"")
r<-comprank(Sm15F,Sm15M,"s","wgh")
a<-ranktes(r, length(Sm15F), "s", "ex",TRUE, "two", FALSE)
cat(a$Value,a$Cpv,a$Lpv,"")
r<-comprank(Sm15F,Sm15M,"k","wgh")
a<-ranktes(r, length(Sm15F), "k", "ex",TRUE, "two", FALSE)
cat(a$Value,a$Cpv,a$Lpv,"")
r<-comprank(Sm15F,Sm15M,"g","wgh")
a<-ranktes(r, length(Sm15F), "g", "ex",TRUE, "two", FALSE)
cat(a$Value,a$Cpv,a$Lpv,"")
detach(Starshi)
Run the code above in your browser using DataLab