# Compute the coefficient and compare to the xi coefficient
simulCompare <- function(n = 20, B = 1000)
{
diffsim <- rep(0,B)
xvec <- 1:n
for (i in 1:B)
{
yvec <- sample(n,n)
diffsim[i] <- FRpredcorhalf(xvec,yvec)-xicor(xvec,yvec)
}
return(diffsim)
}
compare1K <- simulCompare()
summary(compare1K)
Run the code above in your browser using DataLab