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(180,159,158,175,155,165,165,180,175,170,174,163,158,165,160,165,185,165,200,171,178,170,173,170,168,165,168,160,153,180,165,175,173,161,170,175,165,171,175,188,160,178,159,180,175,158,173,158,183,163,170,185,172,180,169,170,165,170,175,169,185,160,163,161,155,175,171,175,163,159,161,150,158,180,183,163,170,175,163,170,183,175,165,160,160,170,161,183,180,185,160,182,165,153,163,175,160,160,173,160,150,164,165,163,183,171,171,179,165,163,181,183,165,178,175,165,175,163,153,169,155,163,185,158,148,175,160,168,185,188,175,160,163,176,171,155,165,158,170,183,165,160,152,160,165,174,165,160,160,158,171,161,155,168,165,188,155,165,170,168,178,165,175,173,175,160,173,160,168,166,180,155,188,173,165,158,161,175,180,178,178) > x <- c(182,161,161,177,157,170,167,186,178,171,175,57,161,168,163,166,187,168,197,175,180,170,175,173,171,166,169,166,157,183,166,178,173,164,169,176,166,174,178,187,164,178,163,183,179,160,174,162,182,165,169,185,176,183,172,173,165,177,180,173,189,162,165,164,158,178,175,173,165,163,166,160,160,182,183,165,168,169,167,170,182,178,165,163,162,173,161,184,180,189,165,185,169,159,164,178,163,163,175,164,152,167,166,166,183,179,174,179,167,168,184,184,169,178,178,167,178,165,157,171,157,166,185,160,148,177,162,172,188,191,175,163,165,176,171,160,165,157,173,184,168,162,150,163,169,172,167,163,161,162,172,163,159,170,166,191,158,169,170,168,178,170,178,174,176,165,173,162,172,169,183,158,185,173,164,156,164,175,180,181,177) > par2 = 'two.sided' > par1 = 'pearson' > ylab = 'Height' > xlab = 'Repht' > 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/1njel1337338285.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.7304, p-value < 2.2e-16 > (sw2<-shapiro.test(y)) Shapiro-Wilk normality test data: y W = 0.9784, p-value = 0.0066 > (cxy<-cor.test(x, y, method=par1)) Pearson's product-moment correlation data: x and y t = 14.683, df = 179, p-value < 2.2e-16 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.6650046 0.7988928 sample estimates: cor 0.7391662 > > #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/2cbzy1337338285.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/3v7su1337338285.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/4k3bc1337338285.tab") > > try(system("convert tmp/1njel1337338285.ps tmp/1njel1337338285.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.400 0.310 0.675