Here is the little R function I write
[ QUOTE ]
> tptcor
function(x){
res<-c()
l<-length(x)
hl<-as.integer(l/2)
for (n in 1:length(x)) {
rindex<-sample(1:l,replace=FALSE)
res<-c(res,cor(x[rindex[1:hl]],x[rindex[(hl+1)
2*hl)]],method="pearson"))
}
return(mean(res))
}
[/ QUOTE ]