# data
n <- 12
f <- sample(c("Group1","Group2"), size=n, replace=TRUE)
x <- round(rnorm(n=n, mean=50, sd=10), 2)
y <- round(rnorm(n=n, mean=50, sd=10), 2)
z <- round(rnorm(n=n, mean=50, sd=10), 2)
mydata <- data.frame(f,x,y,z)
rm(f); rm(x); rm(y); rm(z)
# correlation and covariance
Correlation(x,y)
# short name
cr(x,y)
# brief form of output
cr.brief(x,y)
# correlation matrix
# first remove the categorical variable f from mydata
mydata <- subset(mydata, select=c(x:z))
# now analyze remaining variables x, y and z
Correlation(mydata)
# analysis with data not from data frame mydata
data(attitude)
Correlation(rating, learning, dframe=attitude)
Run the code above in your browser using DataLab