R version 2.6.0 (2007-10-03) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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. > x <- array(list(21797 + ,36429 + ,3 + ,575 + ,58804 + ,22209 + ,32720 + ,6 + ,591 + ,55526 + ,28135 + ,34490 + ,4 + ,603 + ,63232 + ,29512 + ,34749 + ,15 + ,653 + ,64929 + ,26714 + ,30945 + ,3 + ,593 + ,58255 + ,30899 + ,34302 + ,2 + ,674 + ,65877 + ,27148 + ,30400 + ,5 + ,687 + ,58240 + ,24288 + ,25543 + ,0 + ,525 + ,50356 + ,26019 + ,32188 + ,3 + ,621 + ,58831 + ,24007 + ,34395 + ,9 + ,654 + ,59065 + ,18195 + ,27148 + ,5 + ,469 + ,45817 + ,17323 + ,26634 + ,2 + ,561 + ,44520 + ,19504 + ,34257 + ,4 + ,514 + ,54279 + ,23859 + ,34794 + ,10 + ,569 + ,59232 + ,28852 + ,38927 + ,2 + ,654 + ,68435 + ,30746 + ,38512 + ,5 + ,598 + ,69861 + ,26956 + ,33325 + ,2 + ,555 + ,60838 + ,31905 + ,40658 + ,5 + ,598 + ,73166 + ,25956 + ,32719 + ,8 + ,624 + ,59307 + ,24255 + ,29323 + ,4 + ,592 + ,54174 + ,25045 + ,34384 + ,9 + ,580 + ,60018 + ,22982 + ,35153 + ,6 + ,616 + ,58757 + ,19304 + ,30937 + ,4 + ,548 + ,50793 + ,18294 + ,28079 + ,0 + ,543 + ,46916 + ,20417 + ,39703 + ,6 + ,492 + ,60618 + ,21558 + ,35245 + ,6 + ,513 + ,57322 + ,27369 + ,41324 + ,15 + ,546 + ,69254 + ,28240 + ,40802 + ,7 + ,638 + ,69687 + ,27201 + ,37732 + ,3 + ,582 + ,65518 + ,31084 + ,41527 + ,14 + ,655 + ,73280 + ,25306 + ,33441 + ,7 + ,539 + ,59293 + ,24759 + ,32885 + ,12 + ,560 + ,58216 + ,24276 + ,36804 + ,8 + ,577 + ,61665 + ,20862 + ,35593 + ,11 + ,513 + ,56979 + ,19437 + ,34355 + ,23 + ,514 + ,54329 + ,15291 + ,27045 + ,5 + ,471 + ,42812 + ,22515 + ,45587 + ,11 + ,542 + ,68655 + ,22040 + ,40370 + ,6 + ,522 + ,62938 + ,28398 + ,48209 + ,22 + ,638 + ,77267 + ,26158 + ,40275 + ,9 + ,543 + ,66985 + ,25081 + ,36760 + ,11 + ,531 + ,62383 + ,28893 + ,42588 + ,17 + ,600 + ,72098 + ,26504 + ,35365 + ,19 + ,554 + ,62442 + ,22960 + ,33014 + ,12 + ,528 + ,56514 + ,23792 + ,36944 + ,3 + ,551 + ,61290 + ,20995 + ,35649 + ,6 + ,511 + ,57161 + ,19765 + ,34814 + ,17 + ,494 + ,55090 + ,14585 + ,26041 + ,5 + ,384 + ,41015 + ,20480 + ,45636 + ,3 + ,482 + ,66601 + ,21188 + ,40040 + ,7 + ,463 + ,61698 + ,27994 + ,47725 + ,7 + ,565 + ,76291 + ,27229 + ,40263 + ,4 + ,521 + ,68017 + ,28804 + ,43339 + ,19 + ,549 + ,72711 + ,29257 + ,47283 + ,17 + ,610 + ,77167 + ,26377 + ,40492 + ,10 + ,558 + ,67437 + ,24392 + ,35768 + ,10 + ,489 + ,60659 + ,16949 + ,28539 + ,9 + ,359 + ,45856 + ,22566 + ,42971 + ,9 + ,551 + ,66097 + ,18000 + ,36144 + ,3 + ,459 + ,54606 + ,16373 + ,26950 + ,3 + ,490 + ,43816) + ,dim=c(5 + ,60) + ,dimnames=list(c('Benzine' + ,'diesel' + ,'electriciteit' + ,'LPG' + ,'totaal ') + ,1:60)) > y <- array(NA,dim=c(5,60),dimnames=list(c('Benzine','diesel','electriciteit','LPG','totaal '),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > main = 'Kendall tau Correlation Plot' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Multivariate Correlation Matrix (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_pairs.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description > panel.tau <- function(x, y, digits=2, prefix='', cex.cor) + { + usr <- par('usr'); on.exit(par(usr)) + par(usr = c(0, 1, 0, 1)) + rr <- cor.test(x, y, method='kendall') + r <- round(rr$p.value,2) + txt <- format(c(r, 0.123456789), digits=digits)[1] + txt <- paste(prefix, txt, sep='') + if(missing(cex.cor)) cex <- 0.5/strwidth(txt) + text(0.5, 0.5, txt, cex = cex) + } > panel.hist <- function(x, ...) + { + usr <- par('usr'); on.exit(par(usr)) + par(usr = c(usr[1:2], 0, 1.5) ) + h <- hist(x, plot = FALSE) + breaks <- h$breaks; nB <- length(breaks) + y <- h$counts; y <- y/max(y) + rect(breaks[-nB], 0, breaks[-1], y, col='grey', ...) + } > postscript(file="/var/www/html/rcomp/tmp/1yfko1200497896.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pairs(t(y),diag.panel=panel.hist, upper.panel=panel.smooth, lower.panel=panel.tau, main=main) Warning messages: 1: In strwidth(labels, "user") : font width unknown for character 0xd 2: In text.default(x, y, txt, cex = cex, font = font) : font width unknown for character 0xd 3: In text.default(x, y, txt, cex = cex, font = font) : font metrics unknown for character 0xd 4: In text.default(x, y, txt, cex = cex, font = font) : font width unknown for character 0xd > dev.off() null device 1 > load(file='/var/www/html/rcomp/createtable') > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Kendall tau rank correlations for all pairs of data series',3,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'pair',1,TRUE) > a<-table.element(a,'tau',1,TRUE) > a<-table.element(a,'p-value',1,TRUE) > a<-table.row.end(a) > n <- length(y[,1]) > n [1] 5 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 3.814, p-value = 0.0001367 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.3378531 > for (i in 1:(n-1)) + { + for (j in (i+1):n) + { + a<-table.row.start(a) + dum <- paste('tau(',dimnames(t(x))[[2]][i]) + dum <- paste(dum,',') + dum <- paste(dum,dimnames(t(x))[[2]][j]) + dum <- paste(dum,')') + a<-table.element(a,dum,header=TRUE) + r <- cor.test(y[i,],y[j,],method='kendall') + a<-table.element(a,r$estimate) + a<-table.element(a,r$p.value) + a<-table.row.end(a) + } + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/26h8m1200497896.tab") > > system("convert tmp/1yfko1200497896.ps tmp/1yfko1200497896.png") > > > proc.time() user system elapsed 0.805 0.237 1.228