| PsyAcad | R Documentation |
A researcher collected data on three psychological variables, four academic variables (standardized test scores) and gender for 600 college freshman. She is interested in how the set of psychological variables relates to the academic variables and gender. In particular, the researcher is interested in how many dimensions (canonical variables) are necessary to understand the association between the two sets of variables.
data("PsyAcad")
A data frame with 600 observations on the following 8 variables.
LocControllocus of control, a numeric vector
SelfConceptself concept, a numeric vector
Motivationmotivation, a numeric vector
Readreading score, a numeric vector
Writewriting score, a numeric vector
Mathmathematics score, a numeric vector
Sciencescience score, a numeric vector
Sexa factor with levels M, F
Taken from https://stats.oarc.ucla.edu/r/dae/canonical-correlation-analysis/
data(PsyAcad)
PsyAcad$Sex <- as.numeric(PsyAcad$Sex)
PsyAcad.can <- cancor(cbind(LocControl, SelfConcept, Motivation) ~
Read + Write + Math + Science + Sex, data = PsyAcad)
PsyAcad.can
# redundancy analysis
redundancy(PsyAcad.can)
# Plots
canR <- PsyAcad.can$cancor
plot(PsyAcad.can, pch=16, id.n = 3)
text(-2, 3, paste("Can R =", round(canR[1], 3)), pos = 3)
plot(PsyAcad.can, which = 2, pch=16, id.n = 3)
text(-2, 3.5, paste("Can R =", round(canR[2], 3)), pos = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.