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(5,5,5,4,5,4,4,5,4,4,5,4,4,4,5,4,4,5,5,4,5,5,5,4,5,4,4,4,4,5,4,5,5,4,4,4,5,5,4,5,5,5,4,5,4,5,4,4,4,5,5,5,5,4,5,5,3,5,4,5,3,5,5,5,4,5,4,5,4,5,4,5,4,4,4,5,4,5,5,5,5,5,5,4,5,4,5,4,5,5,5,5,5,5,5,4,5,5,5,5,5,5,5,5,4,5,5,5,4,5,5,5,4,5,4,4,5,4,5,5,5,5,5,5,5,4,4,5,5,5,5,5,5,5,4,5,5,4,4,5,3,4,4,5,4,4,4,5,5,5,4,5,4,4,5,5,5,5,4,5,5,4,5,5,5,4,4,4,5,4,4,4,4,4,4,4,5,5,5,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,5,5,5,5,5,5,5,4,5,5,4,4,4,5,5,4,4,4,4,5,5,4,4,5,4,4,4,5,5,5,5,5,5,5,4,4,5,5,5,5,4,4,5,4,5,4,5,5,5,4,5,5,4,4,4,5,4,5,5,5,4,4,5,5,4,5,5,4,5,5,5,5,5,5,4,5,3,5,4,4,5,5,5,4,4,3,5,4,5,4,5,5,5,4,4,4,5,4,5,5,5,5,5,4,5,5,4,5,4,5,5,5,5,5,4,4,5,5,4,4,4,4,4,4,5,5) > x <- c(3,5,5,7,1,8,4,1,4,2,3,6,5,4,4,4,5,3,3,4,4,2,2,4,2,3,3,5,4,2,9,5,4,2,3,4,2,6,3,6,4,4,7,1,2,7,4,3,3,4,3,8,7,2,1,4,6,4,0,2,6,2,6,2,5,6,2,2,3,2,4,5,5,2,3,1,6,5,5,4,4,3,3,2,5,9,6,6,3,4,10,4,3,4,1,1,4,6,6,3,3,3,2,4,3,5,2,6,2,4,1,2,2,4,2,5,2,5,4,4,9,5,4,5,2,8,8,2,3,3,3,7,1,3,0,6,6,3,3,3,4,3,4,3,4,3,3,4,4,3,3,2,3,3,5,3,6,1,2,6,6,8,2,4,4,2,5,5,7,4,2,2,5,3,3,6,2,8,4,2,6,6,5,4,4,8,5,1,4,5,4,6,6,3,6,4,2,5,5,5,6,6,2,0,6,3,1,6,1,4,1,5,3,5,5,3,4,2,4,5,1,3,5,5,4,1,3,0,3,3,6,1,3,5,3,5,2,6,4,4,5,4,5,6,0,4,3,3,3,6,2,5,5,4,4,6,6,4,5,0,5,4,3,4,4,4,6,5,4,7,1,7,3,4,5,3,6,4,9,6,6,3,6,4,5,3,6,3,5,6,6,5,7,6,4,2,4,3,4,6,4,3,4,4,4,5,4,8,4,7,3,4,1,8,3,3,6,7,5,4,5,5,7,5) > ylab = 'y' > xlab = 'x' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Spearman Rank Correlation (v1.0.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_spearman.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > k <- cor.test(x,y,method='spearman') Warning message: In cor.test.default(x, y, method = "spearman") : Cannot compute exact p-value with ties > postscript(file="/var/wessaorg/rcomp/tmp/1dxjd1413584608.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/22k391413584608.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/3g0ej1413584608.tab") > > try(system("convert tmp/1dxjd1413584608.ps tmp/1dxjd1413584608.png",intern=TRUE)) character(0) > try(system("convert tmp/22k391413584608.ps tmp/22k391413584608.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.872 0.126 1.006