R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(231,323,113,208,162,117,159,169,55,77,103,147,230,78,525,121,248,233,260,224,472,220,383,301,262,354,142,286,341,201,158,243,156,184,115,202,206,360,84,331,302,60,110,131,364,180,134,401,155,338) > x <- c(9,7,8,5,4,4,6,9,6,3,4,6,6,3,9,7,5,8,4,7,12,8,6,9,7,11,7,9,10,5,11,6,6,7,4,6,5,6,3,9,7,2,2,5,4,7,6,15,4,8) > ylab = 'Y' > xlab = 'X' > k <- cor.test(x,y,method='spearman') Warning message: In cor.test.default(x, y, method = "spearman") : Cannot compute exact p-values with ties > postscript(file="/var/wessaorg/rcomp/tmp/18agm1324238941.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,y,main='Scatterplot',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/234dn1324238941.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(rank(x),rank(y),main='Scatterplot of Ranks',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > > #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,'Spearman Rank Correlation',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'rho',header=TRUE) > a<-table.element(a,k$estimate) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'2-sided p-value',header=TRUE) > a<-table.element(a,k$p.value) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'S',header=TRUE) > a<-table.element(a,k$statistic) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3w5f71324238941.tab") > > try(system("convert tmp/18agm1324238941.ps tmp/18agm1324238941.png",intern=TRUE)) character(0) > try(system("convert tmp/234dn1324238941.ps tmp/234dn1324238941.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.648 0.167 0.885