Description Usage Arguments Value Author(s) References Examples
Produces SPSS and SASlike output for canonical correlation analysis. Portions of the code were adapted from James Steiger (www.statpower.net).
1 
data 
A dataframe where the rows are cases & the columns are the variables. 
set1 
The names of the continuous variables for the first set,

set2 
The names of the continuous variables for the second set,

plot 
Should a plot of the coefficients be produced? 
plotCV 
The canonical variate number for the plot, e.g., plotCV = 1. 
plotcoefs 
The coefficient for the plots. 
verbose 
Should detailed results be displayed in the console? 
If verbose = TRUE, the displayed output includes Pearson correlations, multivariate significance tests, canonical function correlations and bivariate significance tests, raw canonical coefficients, structure coefficients, standardized coefficients, and a bar plot of the structure or standardized coefficients.
The returned output is a list with elements
cancorrels 
canonical correlations and their significance tests 
CoefRawSet1 
raw canonical coefficients for Set 1 
CoefRawSet2 
raw canonical coefficients for Set 2 
CoefStruct11 
structure coefficients for Set 1 variables with the Set 1 variates 
CoefStruct21 
structure coefficients for Set 2 variables with the Set 1 variates 
CoefStruct12 
structure coefficients for Set 1 variables with the Set 2 variates 
CoefStruct22 
structure coefficients for Set 2 variables with the Set 2 variates 
CoefStandSet1 
standardized coefficients for Set 1 variables 
CoefStandSet2 
standardized coefficients for Set 2 variables 
mv_Wilk 
Wilk's multivariate significance test 
mv_Pillai 
PillaiBartlett multivariate significance test 
mv_Hotelling 
HotellingLawley multivariate significance test 
mv_Roy 
Roy's Largest Root multivariate significance test 
mv_BartlettV 
Bartlett's V multivariate significance test 
mv_Rao 
Rao's' multivariate significance test 
CorrelSet1 
Pearson correlations for Set 1 
CorrelSet2 
Pearson correlations for Set 2 
CorrelSet1n2 
Pearson correlations between Set 1 & Set 2 
Brian P. O'Connor
Manly, B. F. J., & Alberto, J. A. (2017). Multivariate statistical methods:
A primer (4th Edition). Chapman & Hall/CRC, Boca Raton, FL.
Sherry, A., & Henson, R. K. (2005). Conducting and interpreting canonical correlation analysis
in personality research: A userfriendly primer. Journal of Personality Assessment, 84, 3748.
Steiger, J. (2019). Canonical correlation analysis.
www.statpower.net/Content/312/Lecture%20Slides/CanonicalCorrelation.pdf
Tabachnik, B. G., & Fidell, L. S. (2013). Using multivariate statistics (6th. ed.). New York, NY: Pearson.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28  # data that simulate those from De Leo & Wulfert (2013)
CANCOR(data = na.omit(data_CCA_De_Leo),
set1 = c('Tobacco_Use','Alcohol_Use','Illicit_Drug_Use','Gambling_Behavior',
'Unprotected_Sex','CIAS_Total'),
set2 = c('Impulsivity','Social_Interaction_Anxiety','Depression',
'Social_Support','Intolerance_of_Deviance','Family_Morals',
'Family_Conflict','Grade_Point_Average'),
plot = TRUE, plotCV = 1, plotcoefs='structure',
verbose = TRUE)
# data from Tabachnik & Fidell (2013, p. 589)
CANCOR(data = data_CCA_Tabachnik,
set1 = c('TS','TC'),
set2 = c('BS','BC'),
plot = TRUE, plotCV = 1, plotcoefs='structure',
verbose = TRUE)
# UCLA dataset
UCLA_CCA_data < read.csv("https://stats.idre.ucla.edu/stat/data/mmreg.csv")
colnames(UCLA_CCA_data) < c("LocusControl", "SelfConcept", "Motivation",
"read", "write", "math", "science", "female")
summary(UCLA_CCA_data)
CANCOR(data = UCLA_CCA_data,
set1 = c("LocusControl","SelfConcept","Motivation"),
set2 = c("read","write","math","science","female"),
plot = TRUE, plotCV = 1, plotcoefs='standardized',
verbose = TRUE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.