R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-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(4.59511985 + ,4.543294782 + ,4.382026635 + ,4.248495242 + ,4.605170186 + ,4.691347882 + ,4.127134385 + ,4.394449155 + ,4.304065093 + ,4.795790546 + ,4.605170186 + ,4.290459441 + ,4.477336814 + ,4.465908119 + ,4.290459441 + ,4.17438727 + ,4.48863637 + ,4.454347296 + ,4.983606622 + ,4.672828834 + ,4.060443011 + ,4.48863637 + ,4.304065093 + ,4.990432587 + ,4.406719247 + ,4.510859507 + ,4.532599493 + ,4.875197323 + ,4.477336814 + ,4.672828834 + ,4.143134726 + ,4.905274778 + ,4.304065093 + ,4.406719247 + ,4.262679877 + ,4.828313737 + ,4.189654742 + ,4.442651256 + ,4.521788577 + ,4.304065093 + ,4.477336814 + ,4.127134385 + ,4.510859507 + ,4.59511985 + ,4.795790546 + ,4.564348191 + ,4.553876892 + ,4.615120517 + ,4.465908119 + ,4.369447852 + ,4.219507705 + ,4.624972813 + ,4.553876892 + ,4.356708827 + ,4.762173935 + ,4.564348191 + ,4.532599493 + ,4.110873864 + ,4.110873864 + ,4.382026635 + ,4.394449155 + ,4.369447852 + ,4.406719247 + ,4.718498871 + ,4.624972813 + ,4.543294782 + ,4.59511985 + ,4.317488114 + ,4.905274778 + ,4.394449155 + ,4.356708827 + ,4.624972813 + ,4.454347296 + ,4.418840608 + ,4.709530201 + ,4.276666119 + ,4.454347296 + ,4.615120517 + ,4.382026635 + ,4.709530201 + ,4.343805422 + ,4.430816799 + ,4.418840608 + ,4.17438727 + ,4.605170186 + ,4.521788577 + ,4.663439094 + ,4.248495242 + ,4.49980967 + ,4.510859507 + ,4.59511985 + ,4.770684624 + ,4.189654742 + ,4.343805422 + ,4.430816799 + ,4.615120517 + ,4.158883083 + ,4.477336814 + ,4.418840608 + ,4.65396035 + ,4.844187086 + ,4.356708827 + ,4.248495242 + ,4.691347882 + ,4.644390899 + ,4.454347296 + ,4.574710979) > x <- c(30,27,9,20,3,15,5,10,23,34,20,17,26,16,17,15,38,16,38,15,5,18,8,33,12,22,23,45,8,45,9,45,21,16,17,31,15,22,14,13,37,23,22,15,43,27,21,36,38,12,1,25,20,11,55,39,24,2,3,16,45,24,12,34,43,18,18,34,29,15,6,58,37,13,12,9,20,29,13,36,33,23,22,1,3,15,13,44,11,20,28,14,7,8,9,33,4,22,7,14,24,13,30,19,34,9,27) > par2 = 'two.sided' > par1 = 'pearson' > ylab = 'lnStress' > xlab = 'Stress' > 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/fisher/rcomp/tmp/1ca8d1369219651.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.9601, p-value = 0.002709 > (sw2<-shapiro.test(y)) Shapiro-Wilk normality test data: y W = 0.989, p-value = 0.5373 > (cxy<-cor.test(x, y, method=par1)) Pearson's product-moment correlation data: x and y t = 6.3818, df = 105, p-value = 4.827e-09 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.3765972 0.6529759 sample estimates: cor 0.5286566 > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/27bgx1369219651.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/fisher/rcomp/tmp/3v42u1369219651.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/fisher/rcomp/tmp/472vx1369219651.tab") > > try(system("convert tmp/1ca8d1369219651.ps tmp/1ca8d1369219651.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.910 0.184 1.068