R/canonVariate.R

Defines functions canonVariate

Documented in canonVariate

canonVariate <-
function(A,B,nofns){

##Perform canonical correlation
canon<-cca(A,B)

##Determine names of variables in set B
Blist<-dimnames(B)[[2]]

##Build output object
CCdata<-vector("list",nofns)

##For each function requested:
##  Get commonality data
for (i in 1:nofns)
{
   CVA<-canon$canvarx[,i]
   data<-cbind(B,CVA)
   CCdata[[i]]<-commonalityCoefficients(data,"CVA", Blist, "F")
}
return(CCdata)
}

Try the yhat package in your browser

Any scripts or data that you put into this service are public.

yhat documentation built on May 29, 2017, 10:39 p.m.