R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(5.3 + ,190.7 + ,2.97 + ,17885.8 + ,2609.3 + ,5.4 + ,191.8 + ,3.01 + ,16937.6 + ,3058.1 + ,5.2 + ,193.3 + ,3.15 + ,16184.9 + ,3336.4 + ,5.2 + ,194.6 + ,3.51 + ,18148.5 + ,3263.7 + ,5.1 + ,194.4 + ,2.80 + ,19053.2 + ,3222.9 + ,5.0 + ,194.5 + ,2.53 + ,20976.7 + ,3370.7 + ,5.0 + ,195.4 + ,3.17 + ,21272.7 + ,3560.0 + ,4.9 + ,196.4 + ,3.64 + ,22421.3 + ,3728.7 + ,5.0 + ,198.8 + ,4.69 + ,23294.5 + ,3165.8 + ,5.0 + ,199.2 + ,4.35 + ,24382.9 + ,3899.2 + ,5.0 + ,197.6 + ,3.46 + ,22426.1 + ,3807.5 + ,4.9 + ,196.8 + ,3.42 + ,20486.0 + ,4169.8 + ,4.7 + ,198.3 + ,3.99 + ,21382.5 + ,3396.9 + ,4.8 + ,198.7 + ,3.60 + ,17905.4 + ,4072.2 + ,4.7 + ,199.8 + ,3.36 + ,20531.3 + ,4867.1 + ,4.7 + ,201.5 + ,3.55 + ,21459.1 + ,4232.4 + ,4.6 + ,202.5 + ,4.17 + ,22317.6 + ,4434.1 + ,4.6 + ,202.9 + ,4.32 + ,23989.7 + ,4302.9 + ,4.7 + ,203.5 + ,4.15 + ,24632.0 + ,4806.3 + ,4.7 + ,203.9 + ,3.82 + ,26713.3 + ,4603.3 + ,4.5 + ,202.9 + ,2.06 + ,27570.6 + ,4461.0 + ,4.4 + ,201.8 + ,1.31 + ,29388.6 + ,4885.3 + ,4.5 + ,201.5 + ,1.97 + ,27775.1 + ,4595.8 + ,4.4 + ,201.8 + ,2.54 + ,24109. + ,5015.8 + ,4.6 + ,202.416 + ,2.08 + ,25640.6 + ,4389.5 + ,4.5 + ,203.499 + ,2.42 + ,23038.9 + ,4532.9 + ,4.4 + ,205.352 + ,2.78 + ,22723.0 + ,5425.4 + ,4.5 + ,206.686 + ,2.57 + ,24241.5 + ,4704.0 + ,4.4 + ,207.949 + ,2.69 + ,25290.6 + ,5129.4 + ,4.6 + ,208.352 + ,2.69 + ,27071.0 + ,5561.8 + ,4.6 + ,208.299 + ,2.36 + ,28601.2 + ,4665.9 + ,4.6 + ,207.917 + ,1.97 + ,28424.5 + ,5552.8 + ,4.7 + ,208.49 + ,2.76 + ,29419.0 + ,5311.9 + ,4.7 + ,208.936 + ,3.54 + ,31555.4 + ,5532.9 + ,4.7 + ,210.177 + ,4.31 + ,29780.7 + ,5581.5 + ,5.0 + ,210.036 + ,4.08 + ,25656.6 + ,6548.9 + ,5.0 + ,211.08 + ,4.28 + ,26193.0 + ,5556.7 + ,4.8 + ,211.693 + ,4.03 + ,24095.9 + ,5698.1 + ,5.1 + ,213.528 + ,3.98 + ,22440.2 + ,6294.4 + ,5.0 + ,214.823 + ,3.94 + ,25951.7 + ,5651.2 + ,5.4 + ,216.632 + ,4.18 + ,27634.5 + ,6275.7 + ,5.5 + ,218.815 + ,5.02 + ,27930.6 + ,6188.2 + ,5.8 + ,219.964 + ,5.60 + ,31247.3 + ,6234.6 + ,6.1 + ,219.086 + ,5.37 + ,31823.7 + ,6201.3 + ,6.2 + ,218.783 + ,4.94 + ,33078.7 + ,5257.6 + ,6.6 + ,216.573 + ,3.66 + ,34032.4 + ,6083.4 + ,6.9 + ,212.425 + ,1.07 + ,28265.0 + ,5181.0 + ,7.4 + ,210.228 + ,0.09 + ,25079.5 + ,5110.7 + ,7.7 + ,211.143 + ,0.03 + ,24743.5 + ,4159.6 + ,8.2 + ,212.193 + ,0.24 + ,18845.5 + ,4661.7 + ,8.6 + ,212.709 + ,-0.38 + ,21224.7 + ,5579.3 + ,8.9 + ,213.24 + ,-0.74 + ,21920.6 + ,5161.4 + ,9.4 + ,213.856 + ,-1.28 + ,22734.1 + ,5256.0 + ,9.5 + ,215.693 + ,-1.43 + ,23972.8 + ,5548.6 + ,9.4 + ,215.351 + ,-2.10 + ,25671.1 + ,5269.3 + ,9.7 + ,215.834 + ,-1.48 + ,25798.1 + ,5518.0 + ,9.8 + ,215.969 + ,-1.29 + ,27893.9 + ,5764.3 + ,10.1 + ,216.177 + ,-0.18 + ,29557.8 + ,6879.3 + ,10.0 + ,216.33 + ,1.84 + ,27541.7 + ,7374.2 + ,10.0 + ,215.949 + ,2.72 + ,26470.1 + ,8325.0 + ,9.7 + ,216.687 + ,2.63 + ,25185.1 + ,6888.8 + ,9.7 + ,216.741 + ,2.14 + ,23363.8 + ,6855.1 + ,9.7 + ,217.631 + ,2.31 + ,24300.2 + ,7403.6 + ,9.9 + ,218.009 + ,2.24 + ,25905.7 + ,6591.2 + ,9.7 + ,218.178 + ,2.02 + ,29036.8 + ,6752.7 + ,9.5 + ,217.965 + ,1.05 + ,32866.5 + ,6715.0 + ,9.5 + ,218.011 + ,1.24 + ,33260.0 + ,7344.7 + ,9.6 + ,218.312 + ,1.15 + ,35288.5 + ,7253.5 + ,9.6 + ,218.439 + ,1.14 + ,34999.2 + ,7168.2 + ,9.6 + ,218.711 + ,1.17 + ,34820.2 + ,9303.4) + ,dim=c(5 + ,70) + ,dimnames=list(c('Unemployment' + ,'CPI' + ,'Inflation' + ,'Import' + ,'Export') + ,1:70)) > y <- array(NA,dim=c(5,70),dimnames=list(c('Unemployment','CPI','Inflation','Import','Export'),1:70)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par1 = 'kendall' > 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/html/rcomp/tmp/1v6oe1293197622.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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > n <- length(y[,1]) > n [1] 5 > 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/html/rcomp/tmp/2y7521293197622.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) Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 4.9055, p-value = 9.32e-07 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.408909 > 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 6: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 7: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 8: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 9: 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/html/rcomp/tmp/3uh2s1293197622.tab") > > try(system("convert tmp/1v6oe1293197622.ps tmp/1v6oe1293197622.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.649 0.261 1.787