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(0.0564,0.0274,0.4130,0.1031,0.2860,0.0742,0.3978,0.0263,0.2621,0.1088,0.3051,0.3796,0.4402,0.2942,0.0000,0.0011,0.1380,0.1755,0.2694,0.3914,0.1225,0.2612,0.2311,0.2661,0.3485,0.2698,0.3319,0.1028,0.3162,0.2215,0.0031,0.2630,0.4582,0.0096,0.4845,0.0992,0.0757,0.2557,0.0687,0.2193,0.0000,0.0544,0.1158,0.3096,0.2023,0.4311,0.0922,0.3443,0.3538,0.1107,0.1832,0.5946,0.2275,0.1512,0.5991,0.3899,0.3003,0.7112,0.4009,0.2438,0.2384,0.2065,0.1014,0.2043,0.2265,0.3351,0.4590,0.4022,0.3703,0.4950,0.5458,0.5500,0.5628,0.4536,0.2610,0.4790,0.5787,0.2887,0.4442,0.4737,0.4049,0.6244,0.3432,0.5858,0.5807,0.1104,0.4380) > x <- c(0.310345,0.333333,0.464286,0.538462,0.666667,0.714286,0.724138,0.750000,0.758621,0.777778,0.793103,0.814815,0.827586,0.857143,0.960000,1.068966,1.222222,1.250000,1.250000,1.310345,1.366667,1.413793,1.428571,1.482759,1.517241,1.518519,1.518519,1.518519,1.555556,1.620690,1.689655,1.703704,1.703704,1.807692,1.925926,2.038462,2.142857,2.142857,2.166667,2.185185,2.259259,2.320000,2.379310,2.448276,2.482759,2.642857,2.655172,2.720000,2.892857,2.931034,3.037037,3.038462,3.320000,3.333333,3.366667,3.700000,3.724138,3.785714,3.793103,3.827586,3.851852,3.862069,3.896552,4.000000,4.111111,4.200000,4.250000,4.400000,4.400000,4.400000,4.466667,4.571429,4.586207,4.600000,4.655172,4.666667,4.666667,4.666667,4.700000,4.733333,4.800000,4.821429,4.827586,4.866667,4.900000,4.931034,4.965517) > 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-values with ties > postscript(file="/var/wessaorg/rcomp/tmp/1qmr91341364807.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/2wu5v1341364807.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/3jdgf1341364807.tab") > > try(system("convert tmp/1qmr91341364807.ps tmp/1qmr91341364807.png",intern=TRUE)) character(0) > try(system("convert tmp/2wu5v1341364807.ps tmp/2wu5v1341364807.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.540 0.324 1.851