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(7361 + ,493 + ,797 + ,48 + ,1.5 + ,105.0 + ,508643 + ,7391 + ,514 + ,840 + ,49 + ,1.6 + ,104.0 + ,527568 + ,7420 + ,522 + ,988 + ,59 + ,1.8 + ,109.8 + ,520008 + ,7406 + ,490 + ,819 + ,56 + ,1.5 + ,98.6 + ,498484 + ,7439 + ,484 + ,831 + ,47 + ,1.3 + ,93.5 + ,523917 + ,7512 + ,506 + ,904 + ,56 + ,1.6 + ,98.2 + ,553522 + ,7579 + ,501 + ,814 + ,50 + ,1.6 + ,88.0 + ,558901 + ,7520 + ,462 + ,798 + ,54 + ,1.8 + ,85.3 + ,548933 + ,7453 + ,465 + ,828 + ,79 + ,1.8 + ,96.8 + ,567013 + ,7462 + ,454 + ,789 + ,50 + ,1.6 + ,98.8 + ,551085 + ,7472 + ,464 + ,930 + ,54 + ,1.8 + ,110.3 + ,588245 + ,7443 + ,427 + ,744 + ,56 + ,2 + ,111.6 + ,605010 + ,7439 + ,460 + ,832 + ,50 + ,1.3 + ,111.2 + ,631572 + ,7460 + ,473 + ,826 + ,46 + ,1.1 + ,106.9 + ,639180 + ,7482 + ,465 + ,907 + ,47 + ,1 + ,117.6 + ,653847 + ,7442 + ,422 + ,776 + ,43 + ,1.2 + ,97.0 + ,657073 + ,7454 + ,415 + ,835 + ,52 + ,1.2 + ,97.3 + ,626291 + ,7536 + ,413 + ,715 + ,48 + ,1.3 + ,98.4 + ,625616 + ,7616 + ,420 + ,729 + ,36 + ,1.3 + ,87.6 + ,633352 + ,7548 + ,363 + ,733 + ,41 + ,1.4 + ,87.4 + ,672820 + ,7507 + ,376 + ,736 + ,34 + ,1.1 + ,94.7 + ,691369 + ,7515 + ,380 + ,712 + ,37 + ,0.9 + ,101.5 + ,702595 + ,7549 + ,384 + ,711 + ,37 + ,1 + ,110.4 + ,692241 + ,7540 + ,346 + ,667 + ,34 + ,1.1 + ,108.4 + ,718722 + ,7525 + ,389 + ,799 + ,55 + ,1.4 + ,109.7 + ,732297 + ,7575 + ,407 + ,661 + ,37 + ,1.5 + ,105.2 + ,721798 + ,7621 + ,393 + ,692 + ,27 + ,1.8 + ,111.1 + ,766192 + ,7589 + ,346 + ,649 + ,38 + ,1.8 + ,96.2 + ,788456 + ,7606 + ,348 + ,729 + ,43 + ,1.8 + ,97.3 + ,806132 + ,7722 + ,353 + ,622 + ,26 + ,1.7 + ,98.9 + ,813944 + ,7788 + ,364 + ,671 + ,32 + ,1.5 + ,91.7 + ,788025 + ,7735 + ,305 + ,635 + ,29 + ,1.1 + ,90.9 + ,765985 + ,7654 + ,307 + ,648 + ,41 + ,1.3 + ,98.8 + ,702684 + ,7678 + ,312 + ,745 + ,55 + ,1.6 + ,111.5 + ,730159 + ,7688 + ,312 + ,624 + ,50 + ,1.9 + ,119.0 + ,678942 + ,7653 + ,286 + ,477 + ,30 + ,1.9 + ,115.3 + ,672527 + ,7688 + ,324 + ,710 + ,35 + ,2 + ,116.3 + ,594783 + ,7734 + ,336 + ,515 + ,29 + ,2.2 + ,113.6 + ,594575 + ,7754 + ,327 + ,461 + ,22 + ,2.2 + ,115.1 + ,576299 + ,7760 + ,302 + ,590 + ,39 + ,2 + ,109.7 + ,530770 + ,7770 + ,299 + ,415 + ,24 + ,2.3 + ,97.6 + ,524491 + ,7867 + ,311 + ,554 + ,38 + ,2.6 + ,100.8 + ,456590 + ,7938 + ,315 + ,585 + ,30 + ,3.2 + ,94.0 + ,428448 + ,7860 + ,264 + ,513 + ,31 + ,3.2 + ,87.2 + ,444937 + ,7793 + ,278 + ,591 + ,39 + ,3.1 + ,102.9 + ,372206 + ,7829 + ,278 + ,561 + ,33 + ,2.8 + ,111.3 + ,317272 + ,7828 + ,287 + ,684 + ,57 + ,2.3 + ,106.6 + ,297604 + ,7789 + ,279 + ,668 + ,49 + ,1.9 + ,108.9 + ,288561 + ,7820 + ,324 + ,795 + ,74 + ,1.9 + ,108.2 + ,289287 + ,7850 + ,354 + ,776 + ,74 + ,2 + ,100.2 + ,258923 + ,7860 + ,354 + ,1043 + ,115 + ,2 + ,104.0 + ,255493 + ,7836 + ,360 + ,964 + ,67 + ,1.8 + ,90.0 + ,277992 + ,7844 + ,363 + ,762 + ,51 + ,1.6 + ,87.4 + ,295474 + ,7915 + ,385 + ,1030 + ,114 + ,1.4 + ,91.9 + ,291680 + ,7971 + ,412 + ,939 + ,70 + ,0.2 + ,89.3 + ,318736 + ,7890 + ,370 + ,779 + ,73 + ,0.3 + ,81.3 + ,338463 + ,7807 + ,389 + ,918 + ,77 + ,0.4 + ,94.9 + ,351963 + ,7797 + ,395 + ,839 + ,67 + ,0.7 + ,102.6 + ,347240 + ,7788 + ,417 + ,874 + ,60 + ,1 + ,107.2 + ,347081 + ,7779 + ,404 + ,840 + ,73 + ,1.1 + ,114.0 + ,383486) + ,dim=c(7 + ,60) + ,dimnames=list(c('Beroepsbevolking' + ,'Werkloosheid' + ,'Faillissementen' + ,'Faillissementennijverheid' + ,'Inflatie' + ,'Nijverheid' + ,'Beurswaarde ') + ,1:60)) > y <- array(NA,dim=c(7,60),dimnames=list(c('Beroepsbevolking','Werkloosheid','Faillissementen','Faillissementennijverheid','Inflatie','Nijverheid','Beurswaarde '),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par1 = 'spearman' > 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/1o2ql1293376994.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) There were 24 warnings (use warnings() to see them) > 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] 7 > 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) + } There were 48 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/2s3691293376994.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) Spearman's rank correlation rho data: y[1, ] and y[2, ] S = 60210.54, p-value = 3.854e-09 alternative hypothesis: true rho is not equal to 0 sample estimates: rho -0.6729797 Warning message: In cor.test.default(y[1, ], y[2, ], method = par1) : Cannot compute exact p-values with ties > 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) + } + } There were 21 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/3oumi1293376994.tab") > > try(system("convert tmp/1o2ql1293376994.ps tmp/1o2ql1293376994.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.890 0.150 1.009