# NOT RUN {
y = rnorm(100)
x = cbind(y,y*2,(y-2)/3,y+1,y*5) # all variables are related by similarity transforms
# compute all types of correlations for x:
for (ty in c("total.lower","total.upper","pairwise","m.multi.3","multi"))
for (mty in c("normalized"))
print(paste(format(multicorrelation(
x,type=ty,multicorrelation.type = mty,estimator.type = "biased")
,digits=3,nsmall = 3,width = 7),mty,ty,"correlation - biased estimate"))
for (ty in c("total.upper.lower","pairwise"))
for (mty in c("normalized"))
print(paste(format(multicorrelation(
x,type=ty,multicorrelation.type = mty,estimator.type = "bias.corrected")
,digits=3,nsmall = 3,width = 7),mty,ty,"correlation - bias corrected estimate"))
for (ty in c("m.multi.2","m.multi.3","multi"))
for (mty in c("unnormalized"))
print(paste(format(multicorrelation(
x,type=ty,multicorrelation.type = mty,estimator.type = "biased")
,digits=3,nsmall = 3,width = 7),mty,ty,"correlation - biased estimate"))
# }
Run the code above in your browser using DataLab