y <- c(50556,43901,48572,43899,37532,40357,35489,29027,34485,42598,30306,26451,47460,50104,61465,53726,39477,43895,31481,29896,33842,39120,33702,25094,51442,45594,52518,48564,41745,49585,32747,33379,35645,37034,35681,20972,58552,54955,65540,51570,51145,46641,35704,33253,35193,41668,34865,21210,56126,49231,59723,48103,47472,50497,40059,34149,36860,46356,36577,23872,57276,56389,57657,62300,48929,51168,39636,33213,38127,43291,30600,21956,48033,46148,50736,48114,38390,44112,36287,30333,35908,40005,35263,26591)
x <- c(31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572,11509,25447,24090,27786,26195,20516,22759,19028,16971,20036,22485,18730,14538)
ylab = 'Inschrijvingen met transit'
xlab = 'Inschrijvingen zonder transit'
#'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
#Author: Prof. Dr. P. Wessa
#To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
#Source of accompanying publication: Office for Research, Development, and Education
#Technical description: Write here your technical program description (don't use hard returns!)
library('Kendall')
k <- Kendall(x,y)
postscript(file="/var/www/rcomp/tmp/1zrw51292682827.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()
postscript(file="/var/www/rcomp/tmp/2zrw51292682827.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()

#Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
load(file="/var/www/rcomp/createtable")

a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Kendall tau Rank Correlation',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Kendall tau',header=TRUE)
a<-table.element(a,k$tau)
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$sl)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Score',header=TRUE)
a<-table.element(a,k$S)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Var(Score)',header=TRUE)
a<-table.element(a,k$varS)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Denominator',header=TRUE)
a<-table.element(a,k$D)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file="/var/www/rcomp/tmp/3djce1292682827.tab") 

try(system("convert tmp/1zrw51292682827.ps tmp/1zrw51292682827.png",intern=TRUE))
try(system("convert tmp/2zrw51292682827.ps tmp/2zrw51292682827.png",intern=TRUE))

