R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > y <- c(53,80,63,63,54,56,71,52,69,68,51,57,57,48,53,54,71,76,73,80,71,45,67,71,65,63,55,78,59,41,64,63,55,68,70,62,50,80,27,58,83,65,82,66,56,53,48,55,67,61,67,24,64,61,77,61,52,81,70,90,42,66,21,53,68,36,49,72,70,76,58,60,47,63,68,57,61,53,44,74,53,59,57,56,43,71,66,63,42,71,48,46,76,65,24,50,65,56,32,44,63,18,76,70,17,70,66,63,59,47,60,68,65,68,76,58,70,63,57,89,48,51,49,50,77,68,51,54,65,40,58,53,64,53,56,50,49,62,50,64,59,43,44,61,41,72,56,80,54,50,82,64,71) > x <- c(62,90,75,62,62,44,62,20,82,62,69,62,44,47,47,62,65,54,75,69,62,65,58,80,68,66,74,70,48,78,68,73,78,73,75,45,71,68,73,65,75,75,90,50,62,62,75,69,65,62,69,37,75,75,75,58,54,69,90,69,62,69,75,69,62,54,62,65,75,65,65,62,20,50,62,69,65,90,82,69,65,69,65,58,58,62,62,62,58,75,62,65,65,58,50,62,65,44,69,65,75,40,82,65,65,69,75,82,82,35,69,69,58,69,62,58,65,69,65,65,47,20,69,58,68,85,82,69,58,65,62,54,54,69,35,54,58,50,69,73,60,72,71,68,52,69,90,69,69,69,82,90,72) > par2 = 'two.sided' > par1 = 'pearson' > ylab = 'exam' > xlab = 'pr' > par2 <- 'two.sided' > par1 <- 'pearson' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Ian E. Holliday, 2012, Pregnancy and Cognition (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_Pregnancy%20and%20cognition.wasp/ > #Source of accompanying publication: > # > postscript(file="/var/wessaorg/rcomp/tmp/10i2v1403092816.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,y, xlab=xlab, ylab=ylab) > abline(coef=(lm(y ~ x))$coeff, col='red') > ctp<-cor.test(x, y, use='pair', method='pearson') > legend('bottomright', c('cor =', as.character(round(ctp$estimate, digits=4)))) > dev.off() null device 1 > (sw1<-shapiro.test(x)) Shapiro-Wilk normality test data: x W = 0.9306, p-value = 8.886e-07 > (sw2<-shapiro.test(y)) Shapiro-Wilk normality test data: y W = 0.9709, p-value = 0.00251 > (cxy<-cor.test(x, y, method=par1)) Pearson's product-moment correlation data: x and y t = 4.0696, df = 151, p-value = 7.569e-05 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.1638818 0.4505848 sample estimates: cor 0.3143845 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,paste('Shapiro Test (', xlab,')',sep=''),3,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Statistic W',header=TRUE) > a<-table.element(a,'Probability',header=TRUE) > a<-table.element(a,'Link',header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,round(sw1$statistic, digits=4)) > a<-table.element(a,round(sw1$p.value, digits=4)) > a<-table.element(a,hyperlink('http://en.wikipedia.org/wiki/Shapiro%E2%80%93Wilk_test','Shapiro-Wilk Test','Shapiro-Wilk Test')) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/2lhad1403092816.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, paste('Shapiro Test (', ylab,')',sep=''),3,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Statistic W',header=TRUE) > a<-table.element(a,'probability',header=TRUE) > a<-table.element(a,'Link',header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,round(sw2$statistic, digits=4)) > a<-table.element(a,round(sw2$p.value, digits=4)) > a<-table.element(a,hyperlink('http://en.wikipedia.org/wiki/Shapiro%E2%80%93Wilk_test','Shapiro-Wilk Test','Shapiro-Wilk Test')) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3eluy1403092816.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Correlation Test X-Y',5,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Statistic',header=TRUE) > a<-table.element(a,'Value',header=TRUE) > a<-table.element(a,'probability',header=TRUE) > a<-table.element(a,'Method',header=TRUE) > a<-table.element(a,'alternative',header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,names(cxy$estimate)) > a<-table.element(a,round(cxy$estimate, digits=4)) > a<-table.element(a,round(cxy$p.value, digits=4)) > a<-table.element(a,cxy$method) > a<-table.element(a,cxy$alternative) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/459vt1403092816.tab") > > try(system("convert tmp/10i2v1403092816.ps tmp/10i2v1403092816.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.495 0.119 0.618