setwd("~/Google Drive/ReillyRData/DC013063") library(ggplot2) ctrls <- read.csv("ControlsMoca.csv", header=T) plot(ctrls$zBNT ~ ctrls$MoCa) ctrls$zBNT <- scale(ctrls$BNT) write.csv(ctrls, "ControlsZScored.csv") ggplot(ctrls, aes(x=MoCa, y=zBNT)) + geom_point(shape=16, size=1.5, color="blue") + theme_bw() + stat_smooth(method=loess, color="blue", fill="blue") + xlab("Global Cognition (MoCA)") + ylab("Boston Naming Test (z-score)") + theme_bw() + theme(axis.line=element_line(color="black"), panel.grid.major=element_blank(), panel.grid.minor=element_blank(), panel.border=element_blank()) + scale_x_continuous(breaks = pretty(ctrls$MoCa)) + scale_y_continuous(breaks = c(-3,-2,-1,0,1,2,3)) cor.test(ctrls$BNT, ctrls$MoCa, method = "pearson", use = "complete.obs")