R version 2.12.0 (2010-10-15) Copyright (C) 2010 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. > x <- array(list(921365 + ,18919 + ,48873 + ,137852 + ,987921 + ,19147 + ,52118 + ,145224 + ,1132614 + ,21518 + ,60530 + ,163575 + ,1332224 + ,20941 + ,55644 + ,190761 + ,1418133 + ,22401 + ,57121 + ,196562 + ,1411549 + ,22181 + ,55697 + ,204493 + ,1695920 + ,22494 + ,56483 + ,259479 + ,1636173 + ,21479 + ,51541 + ,259479 + ,1539653 + ,22322 + ,56328 + ,223164 + ,1395314 + ,21829 + ,54349 + ,194886 + ,1127575 + ,20370 + ,59885 + ,160407 + ,1036076 + ,18467 + ,55806 + ,151747 + ,989236 + ,18780 + ,54559 + ,152448 + ,1008380 + ,18815 + ,55590 + ,148388 + ,1207763 + ,20881 + ,63442 + ,168510 + ,1368839 + ,21443 + ,61258 + ,188041 + ,1469798 + ,22333 + ,55829 + ,192020 + ,1498721 + ,22944 + ,58023 + ,205250 + ,1761769 + ,22536 + ,58887 + ,261642 + ,1653214 + ,21658 + ,51510 + ,251614 + ,1599104 + ,23035 + ,60006 + ,222726 + ,1421179 + ,21969 + ,60831 + ,179039 + ,1163995 + ,20297 + ,61559 + ,151462 + ,1037735 + ,18564 + ,61325 + ,143653 + ,1015407 + ,18844 + ,55222 + ,143762 + ,1039210 + ,18762 + ,56370 + ,134580 + ,1258049 + ,21757 + ,66063 + ,165273 + ,1469445 + ,20501 + ,60864 + ,181016 + ,1552346 + ,23181 + ,57596 + ,189079 + ,1549144 + ,23015 + ,57650 + ,199266 + ,1785895 + ,22828 + ,55324 + ,248742 + ,1662335 + ,21597 + ,54203 + ,244139 + ,1629440 + ,23005 + ,61155 + ,219777 + ,1467430 + ,22243 + ,63908 + ,180679 + ,1202209 + ,20729 + ,67466 + ,156369 + ,1076982 + ,18310 + ,63739 + ,149176 + ,1039367 + ,19427 + ,56602 + ,147247 + ,1063449 + ,18849 + ,57640 + ,142026 + ,1335135 + ,21817 + ,70025 + ,174119 + ,1491602 + ,21101 + ,61068 + ,190271 + ,1591972 + ,23546 + ,60467 + ,202998 + ,1641248 + ,23456 + ,65297 + ,219097 + ,1898849 + ,23649 + ,64505 + ,266542 + ,1798580 + ,22432 + ,62517 + ,257522 + ,1762444 + ,23745 + ,67403 + ,226187 + ,1622044 + ,23874 + ,70508 + ,196827 + ,1368955 + ,22327 + ,75601 + ,174065 + ,1262973 + ,20143 + ,72094 + ,165891 + ,1195650 + ,21252 + ,66527 + ,153950 + ,1269530 + ,21094 + ,69324 + ,154796 + ,1479279 + ,21800 + ,75423 + ,179944 + ,1607819 + ,22480 + ,57761 + ,195820 + ,1712466 + ,23055 + ,55801 + ,203015 + ,1721766 + ,23352 + ,52949 + ,214055 + ,1949843 + ,23171 + ,45719 + ,256871 + ,1821326 + ,20691 + ,46610 + ,235046 + ,1757802 + ,23183 + ,48713 + ,214295 + ,1590367 + ,22412 + ,50018 + ,191605 + ,1260647 + ,18958 + ,49123 + ,159512 + ,1149235 + ,17347 + ,43157 + ,149715 + ,1016367 + ,17353 + ,36613 + ,131871 + ,1027885 + ,17153 + ,38355 + ,130864 + ,1262159 + ,20141 + ,42107 + ,154383 + ,1520854 + ,19699 + ,36495 + ,178030 + ,1544144 + ,20780 + ,35589 + ,183488 + ,1564709 + ,21101 + ,36864 + ,204119 + ,1821776 + ,20871 + ,36068 + ,237511 + ,1741365 + ,19574 + ,25131 + ,228871 + ,1623386 + ,21002 + ,35198 + ,196125 + ,1498658 + ,20105 + ,38749 + ,177142 + ,1241822 + ,17772 + ,39385 + ,151338 + ,1136029 + ,16117 + ,38579 + ,144732) + ,dim=c(4 + ,72) + ,dimnames=list(c('passagiers' + ,'bewegingen' + ,'cargo' + ,'auto') + ,1:72)) > y <- array(NA,dim=c(4,72),dimnames=list(c('passagiers','bewegingen','cargo','auto'),1:72)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par1 = 'pearson' > main = 'Correlation Matrix' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #Technical 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=par1) + 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/rcomp/tmp/17l2j1293457237.ps",horizontal=F,onefile=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) > dev.off() null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > n <- length(y[,1]) > n [1] 4 > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,paste('Correlations for all pairs of data series (method=',par1,')',sep=''),n+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,' ',header=TRUE) > for (i in 1:n) { + a<-table.element(a,dimnames(t(x))[[2]][i],header=TRUE) + } > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,dimnames(t(x))[[2]][i],header=TRUE) + for (j in 1:n) { + r <- cor.test(y[i,],y[j,],method=par1) + a<-table.element(a,round(r$estimate,3)) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/23v091293457237.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Correlations for all pairs of data series with p-values',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'pair',1,TRUE) > a<-table.element(a,'Pearson r',1,TRUE) > a<-table.element(a,'Spearman rho',1,TRUE) > a<-table.element(a,'Kendall tau',1,TRUE) > a<-table.row.end(a) > cor.test(y[1,],y[2,],method=par1) Pearson's product-moment correlation data: y[1, ] and y[2, ] t = 9.6886, df = 70, p-value = 1.465e-14 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.6368533 0.8410544 sample estimates: cor 0.7568562 > for (i in 1:(n-1)) + { + for (j in (i+1):n) + { + a<-table.row.start(a) + dum <- paste(dimnames(t(x))[[2]][i],';',dimnames(t(x))[[2]][j],sep='') + a<-table.element(a,dum,header=TRUE) + rp <- cor.test(y[i,],y[j,],method='pearson') + a<-table.element(a,round(rp$estimate,4)) + rs <- cor.test(y[i,],y[j,],method='spearman') + a<-table.element(a,round(rs$estimate,4)) + rk <- cor.test(y[i,],y[j,],method='kendall') + a<-table.element(a,round(rk$estimate,4)) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-value',header=T) + a<-table.element(a,paste('(',round(rp$p.value,4),')',sep='')) + a<-table.element(a,paste('(',round(rs$p.value,4),')',sep='')) + a<-table.element(a,paste('(',round(rk$p.value,4),')',sep='')) + a<-table.row.end(a) + } + } Warning messages: 1: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 2: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 3: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 4: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 5: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/3z5gi1293457237.tab") > > try(system("convert tmp/17l2j1293457237.ps tmp/17l2j1293457237.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.520 0.310 0.809