Learn R Programming

candisc (version 1.0.0)

PsyAcad: Psychological Measures and Academic Achievement

Description

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.

Usage

data("PsyAcad")

Arguments

Format

A data frame with 600 observations on the following 8 variables.

LocControl

locus of control, a numeric vector

SelfConcept

self concept, a numeric vector

Motivation

motivation, a numeric vector

Read

reading score, a numeric vector

Write

writing score, a numeric vector

Math

mathematics score, a numeric vector

Science

science score, a numeric vector

Sex

a factor with levels M, F

Examples

Run this code
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)

Run the code above in your browser using DataLab