R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(5.5,5.9,7.7,0.1,0.1,0.5,38.5,17.2,16.7,26.7,8.7,2.7,0.4,0.8,0.5,2.7,2.7,1.5,2.7,13.6,2.7,0.2,14.6,8.6,31.6,10.2,2.9,21.4,26.8,0.9,2.4,40.6,38.6,0.4,85.7,128.6,1.7,29.1,0.7,0.6,15.8,72.6,34.7,28.5,10.2,0,11.7,12.4,0.4,0.3,3.3,18.9,105.8,72.1,48.3,3.1,3.5,16.1,11.7,7.1,5.4,13.5,10,84.8,28.3,0.9,0.2,0,33.2,117.5,57.5,13.6,1.7,48,47.9,51,2.2,0.6,0.7,0,0,0.1,8.8,1.2,2.4,17.4,5.9,2.8,74.9,26.3,1.3,0.5,4.2,0.7,11.8,8.5,10.9,11.1,1.6,8.4,10.5,30.2,0.2,2.4,82.6,9.6,0.6,4.2,1.3,12.7,172,2.1,4.4,5.6,4.1,3.9) > x <- c(0.137,0.149,0.234,0.097,0.504,0.132,0.348,0.391,0.38,17.15,1.63,0.331,0.149,0.158,0.965,0.151,0.206,0.153,0.355,0.729,0.154,0.251,1.11,1.02,1.38,0.631,0.369,0.577,1.07,0.154,0.146,0.961,0.864,0.425,100,66.91,8.28,82.18,0.866,0.056,6.55,9.77,4.98,0.488,0.257,0.142,2.16,2.4,0.185,0.174,0.24,70.87,100,100,24.83,0.331,0.258,0.853,0.806,0.303,0.253,0.248,0.186,1.61,1.26,0.906,0.415,0.39,41.24,100,68.16,3.81,0.596,0.275,0.284,0.32,0.204,0.125,0.242,0.583,0.549,0.596,0.727,0.21,0.347,0.213,0.945,0.475,26.97,14.75,0.197,7.06,4.92,0.083,0.131,0.119,0.12,0.204,0.089,2.4,0.161,0.25,0.08,1.66,15.11,1.81,0.113,10.09,5.32,3.24,100,1.38,0.095,2.77,1.24,2.62) > 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/13yz21478029130.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/2h0241478029130.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/32ch31478029130.tab") > > try(system("convert tmp/13yz21478029130.ps tmp/13yz21478029130.png",intern=TRUE)) character(0) > try(system("convert tmp/2h0241478029130.ps tmp/2h0241478029130.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.952 0.082 1.044