# These examples correspond to those shown in the SAS code x <- c(1,2,3) y <- c(1,3,2) # Pearson correlation cor.test(x,y,method="pearson",alternative = "two.sided") rm(x,y) hours <- c(2, 2.75, 10.5, 5.5) price <- c(20, 27, 50, 150) # Spearman correlation, note that exact p values are available cor.test(hours,price,method="spearman",alternative = "two.sided", exact = TRUE) # Spearman correlation, without using exact p value cor.test(hours,price,method="spearman",alternative = "two.sided", exact = FALSE) # Kendall's tau, note that exact p values are available cor.test(hours,price,method="kendall",alternative = "two.sided", exact = TRUE) # Kendall's tau, without using exact p value cor.test(hours,price,method="kendall",alternative = "two.sided", exact = FALSE) rm(hours,price)