R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(159,158,155,163,158,165,160,165,165,171,170,168,165,168,160,153,165,161,170,165,160,159,158,NA,173,158,163,NA,169,160,163,161,155,171,163,159,161,NA,150,158,163,175,163,170,165,160,160,161,160,165,153,154,163,160,160,173,160,150,164,165,163,171,165,163,175,163,NA,154,153,169,155,163,158,148,160,168,NA,160,163,176,171,155,165,158,170,165,160,152,NA,160,NA,NA,165,160,160,158,171,155,168,165,155,NA,NA,NA,160,160,168,166,155,165,158,161) > x <- c(161,161,157,166,161,168,163,166,168,175,170,171,166,169,166,157,166,164,169,166,164,163,160,161,174,162,165,170,173,162,165,164,158,175,165,163,166,171,160,160,165,169,167,170,165,163,162,161,165,169,159,155,164,163,163,175,164,152,167,166,166,174,167,168,178,165,169,153,157,171,157,166,160,148,162,172,167,163,165,176,171,160,165,157,173,168,162,150,162,163,170,169,167,163,161,162,172,159,170,166,158,163,174,154,165,162,172,169,158,164,156,164) > par2 = 'two.sided' > par1 = 'pearson' > ylab = 'specmemmean' > xlab = 'compmemomean' > 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/www/rcomp/tmp/15esx1338491453.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.9892, p-value = 0.5141 > (sw2<-shapiro.test(y)) Shapiro-Wilk normality test data: y W = 0.9816, p-value = 0.1713 > (cxy<-cor.test(x, y, method=par1)) Pearson's product-moment correlation data: x and y t = 27.5727, df = 99, p-value < 2.2e-16 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.9130394 0.9596503 sample estimates: cor 0.9406293 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/2zhn71338491453.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/www/rcomp/tmp/3fjbb1338491453.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/www/rcomp/tmp/4qp5b1338491453.tab") > > try(system("convert tmp/15esx1338491453.ps tmp/15esx1338491453.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.450 0.240 0.657