require(MASS) ##to use the 'mvrnorm' function
#Generate a matrix without concordance
# for three observers in two samples
matRandom <- matrix(rnorm(3*20),20,3)
concordance.test(matRandom)
#Generate a corresponding matrix with strong concordance
sigma<-matrix(0.8,3,3)
diag(sigma)<-1
matConcordant <- mvrnorm(20,mu=rep(0,3),Sigma=sigma)
concordance.test(matConcordant)
#Test concordances between the two matrices
aTest <- concordance.test(matConcordant, matRandom)
getPsi(aTest)
coef(aTest)
Run the code above in your browser using DataLab