#This correlation function from the Psych package give a rich, SPSS-like matrix output

#Temp, SAT, and Income are columns 2, 3 and 4 of Wk04
#ZTemp, ZSAT, and ZIncome are columns 6, 7 and 8

Wk04b <- Wk04[,c(2,6,3,7,4,8)]
View(Wk04b)

#From the psych package, corr.test gives us a good matrix (like SAS or SPSS)

library(psych)
psych::corr.test(Wk04b)
## Call:psych::corr.test(x = Wk04b)
## Correlation matrix
## Temp ZTemp SAT ZSAT Income ZIncome
## Temp 1.00 1.00 -0.03 -0.03 0.00 0.00
## ZTemp 1.00 1.00 -0.03 -0.03 0.00 0.00
## SAT -0.03 -0.03 1.00 1.00 0.05 0.05
## ZSAT -0.03 -0.03 1.00 1.00 0.05 0.05
## Income 0.00 0.00 0.05 0.05 1.00 1.00
## ZIncome 0.00 0.00 0.05 0.05 1.00 1.00
## Sample Size
## Temp SAT Income
## Temp 365 365 365 365 365 365
## 365 365 365 365 365 365
## SAT 365 365 365 365 365 365
## 365 365 365 365 365 365
## Income 365 365 365 365 414 414
## 365 365 365 365 414 414
## Probability values (Entries above the diagonal are adjusted for multiple tests.)
## Temp ZTemp SAT ZSAT Income ZIncome
## Temp 0.00 0.00 1.00 1.00 1 1
## ZTemp 0.00 0.00 1.00 1.00 1 1
## SAT 0.56 0.56 0.00 0.00 1 1
## ZSAT 0.56 0.56 0.00 0.00 1 1
## Income 0.95 0.95 0.37 0.37 0 0
## ZIncome 0.95 0.95 0.37 0.37 0 0
##
## To see confidence intervals of the correlations, print with the short=FALSE option