R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(97,102,28,76,132,64,110,29,126,114,21,69,112,64,54,116,97,33,53,69,118,78,117,60,127,57,42,122,79,153,74,119,63,142,98,75,113,83,119,100,66,42,68,77,32,93,64,22,99,138,141,15,70,127,71,79,55,129,132,104,80,100,109,45,160,31,31,114,116,68,28,31,41,99,121,80,44,123,50,34,119) > x <- c(50,64,15,42,82,31,70,21,77,69,12,21,66,41,30,70,56,11,37,38,78,55,74,38,87,20,26,43,33,98,50,82,36,85,69,42,74,51,67,56,43,15,35,40,16,50,29,20,64,91,84,9,33,69,44,44,26,77,84,69,62,53,66,28,95,16,23,65,67,42,19,21,22,54,79,57,28,76,35,16,77) > 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/1eeex1488097734.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/2232d1488097734.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/3rxmx1488097734.tab") > > try(system("convert tmp/1eeex1488097734.ps tmp/1eeex1488097734.png",intern=TRUE)) character(0) > try(system("convert tmp/2232d1488097734.ps tmp/2232d1488097734.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.845 0.065 0.925