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(1.3866 + ,126.64 + ,1.3582 + ,126.81 + ,1.3332 + ,125.84 + ,1.3595 + ,126.77 + ,1.3617 + ,124.34 + ,1.3684 + ,124.4 + ,1.3394 + ,120.48 + ,1.3262 + ,118.54 + ,1.3173 + ,117.66 + ,1.3085 + ,116.97 + ,1.327 + ,120.11 + ,1.3182 + ,119.16 + ,1.293 + ,116.9 + ,1.291 + ,116.11 + ,1.2984 + ,114.98 + ,1.2795 + ,113.65 + ,1.299 + ,115.82 + ,1.3174 + ,117.59 + ,1.326 + ,118.57 + ,1.3111 + ,118.07 + ,1.2816 + ,114.98 + ,1.276 + ,114.04 + ,1.2849 + ,115.02 + ,1.2818 + ,114.28 + ,1.2829 + ,115.04 + ,1.2796 + ,116.7 + ,1.3008 + ,119.21 + ,1.2967 + ,118.39 + ,1.2938 + ,116.5 + ,1.2833 + ,115.46 + ,1.2823 + ,117.59 + ,1.2765 + ,117.33 + ,1.2634 + ,116.2 + ,1.2596 + ,116.83 + ,1.2705 + ,118.99 + ,1.2591 + ,118.62 + ,1.2798 + ,121.09 + ,1.2763 + ,122.4 + ,1.2795 + ,123.76 + ,1.2782 + ,125.33 + ,1.2644 + ,123.23 + ,1.2596 + ,122.52 + ,1.2615 + ,123.64 + ,1.2555 + ,124.67 + ,1.2555 + ,124.71 + ,1.2658 + ,122.53 + ,1.2565 + ,124.4 + ,1.2783 + ,125.45 + ,1.2786 + ,125.35 + ,1.2782 + ,124.3 + ,1.2905 + ,127.03 + ,1.3042 + ,128.51 + ,1.2942 + ,128.1 + ,1.313 + ,128.94 + ,1.3671 + ,129.67 + ,1.3549 + ,129.87 + ,1.3558 + ,131.12 + ,1.3507 + ,132.68 + ,1.3494 + ,132.24 + ,1.3607 + ,133.63 + ,1.3295 + ,129.91 + ,1.3193 + ,127.93 + ,1.3308 + ,131.17 + ,1.3246 + ,130.86 + ,1.3392 + ,133.48 + ,1.3425 + ,134.08 + ,1.3496 + ,136.02 + ,1.3255 + ,132.8 + ,1.3231 + ,132.37 + ,1.3273 + ,133.05 + ,1.3276 + ,132.57 + ,1.3173 + ,130.7 + ,1.3196 + ,130.5 + ,1.3058 + ,129.67 + ,1.2966 + ,127.8 + ,1.2932 + ,126.82 + ,1.2947 + ,126.85 + ,1.305 + ,128.28 + ,1.3232 + ,128.3 + ,1.3125 + ,126.82 + ,1.2992 + ,125.08 + ,1.3266 + ,128.53 + ,1.3275 + ,130.34 + ,1.3223 + ,131.52 + ,1.3403 + ,132.59 + ,1.3322 + ,131.17 + ,1.3363 + ,132.72 + ,1.3425 + ,133.36 + ,1.3574 + ,132.82 + ,1.3683 + ,132.9 + ,1.3623 + ,130.9 + ,1.3563 + ,129.41 + ,1.3518 + ,128.67 + ,1.3494 + ,129.28 + ,1.3612 + ,130.91 + ,1.369 + ,131.06 + ,1.3771 + ,130.84 + ,1.3972 + ,131.41 + ,1.401 + ,133.22 + ,1.3908 + ,132.06 + ,1.3901 + ,132.48 + ,1.3856 + ,134.38 + ,1.4098 + ,135.22 + ,1.422 + ,134.89 + ,1.4238 + ,136.09 + ,1.4207 + ,136.33 + ,1.4095 + ,136.32 + ,1.4177 + ,137.48 + ,1.3866 + ,136.53 + ,1.3959 + ,136.8 + ,1.4102 + ,138.03 + ,1.3969 + ,137.39 + ,1.4004 + ,137.55 + ,1.385 + ,136.08 + ,1.389 + ,134.78 + ,1.384 + ,133.28 + ,1.392 + ,133.57 + ,1.3932 + ,134.84 + ,1.3858 + ,133.02 + ,1.3978 + ,133.49 + ,1.4029 + ,133.77 + ,1.394 + ,134.34 + ,1.4096 + ,134.5 + ,1.4058 + ,134.03 + ,1.4134 + ,135.51 + ,1.4096 + ,136.53 + ,1.4049 + ,135.95 + ,1.4009 + ,134.32 + ,1.3897 + ,132.44 + ,1.4019 + ,133.61 + ,1.3901 + ,131.02 + ,1.399 + ,130.05 + ,1.3901 + ,128.21 + ,1.3975 + ,129.03 + ,1.3991 + ,130.34 + ,1.4089 + ,131.57 + ,1.413 + ,132.63 + ,1.409 + ,132.06 + ,1.4217 + ,134.44 + ,1.4223 + ,134.1 + ,1.4191 + ,132.49 + ,1.4229 + ,134.23 + ,1.4227 + ,134.92 + ,1.4269 + ,135.61 + ,1.4229 + ,134.53 + ,1.4104 + ,133.86 + ,1.4053 + ,133.89 + ,1.4138 + ,135.33 + ,1.4303 + ,135.86 + ,1.4384 + ,136.22 + ,1.441 + ,137.38 + ,1.437 + ,137.31 + ,1.4357 + ,136.89 + ,1.4202 + ,138.01 + ,1.4166 + ,136.72 + ,1.417 + ,135.77 + ,1.4293 + ,137.52 + ,1.4294 + ,135.61 + ,1.4072 + ,132.94 + ,1.4101 + ,134.12 + ,1.4112 + ,132.55 + ,1.4243 + ,134.11 + ,1.433 + ,134.19 + ,1.4323 + ,135.57 + ,1.4324 + ,135.05 + ,1.427 + ,134.32 + ,1.4268 + ,133.61 + ,1.4364 + ,134.75 + ,1.4272 + ,133.1 + ,1.4314 + ,133.26 + ,1.422 + ,131.63 + ,1.4335 + ,132.47 + ,1.4262 + ,132.45 + ,1.433 + ,133.33 + ,1.4473 + ,133.57 + ,1.4522 + ,134.13 + ,1.4545 + ,133.92 + ,1.4594 + ,132.62 + ,1.4561 + ,132.3 + ,1.4611 + ,133.26 + ,1.4671 + ,132.6 + ,1.4712 + ,134.38 + ,1.4705 + ,134.17 + ,1.4658 + ,135.46 + ,1.478 + ,135.09 + ,1.4783 + ,134.96 + ,1.4768 + ,133.85 + ,1.467 + ,132.59 + ,1.465 + ,131.15 + ,1.4549 + ,130.91 + ,1.4643 + ,131.07 + ,1.4539 + ,130.78 + ,1.4537 + ,129.95 + ,1.4616 + ,131.41 + ,1.4722 + ,131.21 + ,1.4694 + ,130.68 + ,1.4763 + ,130.46 + ,1.475 + ,131.12 + ,1.4765 + ,132.99 + ,1.4864 + ,133.02 + ,1.4881 + ,133.39 + ,1.4864 + ,134.07 + ,1.4869 + ,135.6 + ,1.4918 + ,135.66 + ,1.4971 + ,135.53 + ,1.4921 + ,135.82 + ,1.5 + ,136.9 + ,1.502 + ,137.97 + ,1.5019 + ,138.09 + ,1.4874 + ,136.91 + ,1.4785 + ,134.76 + ,1.4788 + ,135.13 + ,1.48 + ,134.66 + ,1.4772 + ,132.95 + ,1.4658 + ,132.25 + ,1.4761 + ,134.3 + ,1.4867 + ,134.3 + ,1.4862 + ,134.76 + ,1.4984 + ,134.81 + ,1.4966 + ,134.51 + ,1.5037 + ,135.11 + ,1.4922 + ,134.32 + ,1.4868 + ,133.51 + ,1.4965 + ,134.02 + ,1.4875 + ,132.76 + ,1.4957 + ,133.39 + ,1.4863 + ,132.05 + ,1.4815 + ,131.87 + ,1.4968 + ,133.03 + ,1.4969 + ,132.57 + ,1.5083 + ,132.1 + ,1.5071 + ,130.7 + ,1.4918 + ,129.2 + ,1.5023 + ,129.77 + ,1.5074 + ,131.02 + ,1.509 + ,131.55 + ,1.512 + ,133.17 + ,1.5068 + ,133.08 + ,1.4787 + ,133.24 + ,1.4774 + ,130.74 + ,1.4768 + ,129.91 + ,1.473 + ,130.03 + ,1.4757 + ,131.13 + ,1.4647 + ,129.55 + ,1.4541 + ,130.22 + ,1.456 + ,130.61 + ,1.4343 + ,129.27 + ,1.4337 + ,129.68 + ,1.4368 + ,130.1 + ,1.4279 + ,130.83 + ,1.4276 + ,130.95 + ,1.4398 + ,131.73 + ,1.4405 + ,131.86 + ,1.4433 + ,132.44 + ,1.4338 + ,132.35 + ,1.4406 + ,133.16 + ,1.4389 + ,133.62 + ,1.4442 + ,132.54 + ,1.435 + ,132.69 + ,1.4304 + ,133.5 + ,1.4273 + ,133.36 + ,1.4528 + ,134.23 + ,1.4481 + ,132.41 + ,1.4563 + ,133.02 + ,1.4486 + ,132.88 + ,1.4374 + ,130.76 + ,1.4369 + ,130.33 + ,1.4279 + ,129.79 + ,1.4132 + ,128.65 + ,1.4064 + ,129.14 + ,1.4135 + ,127.35 + ,1.4151 + ,127.74 + ,1.4085 + ,126.31 + ,1.4072 + ,125.95 + ,1.3999 + ,126.36 + ,1.3966 + ,126.15 + ,1.3913 + ,125.6 + ,1.3937 + ,126.2 + ,1.3984 + ,126.73 + ,1.3847 + ,125.68 + ,1.3691 + ,122.49 + ,1.3675 + ,122.07 + ,1.376 + ,123.4 + ,1.374 + ,123.01 + ,1.3718 + ,123.03 + ,1.3572 + ,122.33 + ,1.3607 + ,122.42 + ,1.3649 + ,122.68 + ,1.3726 + ,124.69 + ,1.3567 + ,123.3 + ,1.3519 + ,124.17 + ,1.3626 + ,124.38 + ,1.3577 + ,123.19 + ,1.3547 + ,122.16 + ,1.3489 + ,120.66 + ,1.357 + ,120.92 + ,1.3525 + ,120.67 + ,1.3548 + ,120.68 + ,1.3641 + ,121.1 + ,1.3668 + ,120.86 + ,1.3582 + ,121.48 + ,1.3662 + ,123.48 + ,1.3557 + ,121.72 + ,1.361 + ,123.16 + ,1.3657 + ,123.84 + ,1.3765 + ,124.57 + ,1.3705 + ,124.3 + ,1.3723 + ,124.22 + ,1.3756 + ,124.43 + ,1.366 + ,123.33 + ,1.3548 + ,122.86 + ,1.3471 + ,121.25 + ,1.3519 + ,122.16 + ,1.3338 + ,122.62 + ,1.3356 + ,123.44 + ,1.3353 + ,124 + ,1.3471 + ,124.75 + ,1.3482 + ,124.8 + ,1.3479 + ,125.93 + ,1.3468 + ,126.28 + ,1.3396 + ,126.04 + ,1.334 + ,125.04 + ,1.3296 + ,123.76 + ,1.3384 + ,125.34 + ,1.3585 + ,126.99 + ,1.3583 + ,126.34 + ,1.3615 + ,127.42 + ,1.3544 + ,126.18 + ,1.3535 + ,125.3 + ,1.3432 + ,123.5 + ,1.3486 + ,125.32 + ,1.3373 + ,124.65 + ,1.3339 + ,124.03 + ,1.3311 + ,125.11 + ,1.3321 + ,125.46 + ,1.329 + ,124.7 + ,1.3245 + ,124.48 + ,1.3256 + ,124.76 + ,1.3315 + ,125.81 + ,1.3238 + ,124.95 + ,1.3089 + ,123.66 + ,1.2924 + ,122.66 + ,1.2727 + ,119.34 + ,1.2746 + ,117.84 + ,1.2969 + ,120.97 + ,1.2698 + ,117.38 + ,1.2686 + ,118.06 + ,1.2587 + ,116.99 + ,1.2492 + ,115.55 + ,1.2349 + ,114.17 + ,1.2428 + ,115.32 + ,1.227 + ,112.49 + ,1.2334 + ,111.93 + ,1.2497 + ,112.08 + ,1.236 + ,111.63 + ,1.2223 + ,109.53 + ,1.2309 + ,111.35 + ,1.2255 + ,110.79 + ,1.2384 + ,113.06 + ,1.2307 + ,112.62 + ,1.2155 + ,110.65 + ,1.2218 + ,112.36 + ,1.2268 + ,113.74 + ,1.206 + ,111.73 + ,1.1959 + ,109.86 + ,1.1942 + ,109.32 + ,1.201 + ,109.99 + ,1.2045 + ,109.84 + ,1.2127 + ,111.13 + ,1.2249 + ,112.43 + ,1.2258 + ,111.77 + ,1.2277 + ,112.15 + ,1.2363 + ,112.89 + ,1.2372 + ,112.12 + ,1.2391 + ,113.1 + ,1.2258 + ,111.09 + ,1.2271 + ,110.76 + ,1.2262 + ,109.59 + ,1.2294 + ,109.99 + ,1.2339 + ,110.25 + ,1.2198 + ,108.31 + ,1.2271 + ,108.79 + ,1.2328 + ,108.14 + ,1.2548 + ,109.88 + ,1.2531 + ,109.93 + ,1.2579 + ,110.46 + ,1.2567 + ,109.56 + ,1.266 + ,111.49 + ,1.2637 + ,111.85 + ,1.2572 + ,111.35 + ,1.2569 + ,110.95 + ,1.2703 + ,112.49 + ,1.2828 + ,113.11 + ,1.3 + ,112.54 + ,1.2957 + ,112.84 + ,1.2844 + ,111.5 + ,1.2817 + ,111.52 + ,1.285 + ,111.57 + ,1.2897 + ,112.48 + ,1.2931 + ,112.31 + ,1.3033 + ,113.79 + ,1.2992 + ,114.01 + ,1.3069 + ,113.64 + ,1.3028 + ,112.62 + ,1.3073 + ,113.27 + ,1.3221 + ,113.51 + ,1.3206 + ,112.92 + ,1.3184 + ,113.66 + ,1.3176 + ,113.14 + ,1.3253 + ,113.48 + ,1.3133 + ,113.23 + ,1.3016 + ,110.56 + ,1.279 + ,109.5 + ,1.2799 + ,109.78 + ,1.282 + ,109.49 + ,1.286 + ,109.66 + ,1.288 + ,109.93 + ,1.2836 + ,109.82 + ,1.2711 + ,108.54 + ,1.2704 + ,108.23 + ,1.2611 + ,106.19 + ,1.2613 + ,106.49 + ,1.2693 + ,107.15 + ,1.2713 + ,107.74 + ,1.27 + ,107.54 + ,1.268 + ,107.07 + ,1.28 + ,107.54 + ,1.2818 + ,107.81 + ,1.2834 + ,108.38 + ,1.2874 + ,108.42 + ,1.2744 + ,106.86 + ,1.2697 + ,106.41 + ,1.2715 + ,106.46 + ,1.2725 + ,106.84 + ,1.2801 + ,107.69 + ,1.285 + ,107.04 + ,1.2989 + ,111.04 + ,1.3078 + ,111.93 + ,1.306 + ,111.98 + ,1.3074 + ,112.07 + ,1.312 + ,112.05 + ,1.3364 + ,113.14 + ,1.3323 + ,112.49 + ,1.3412 + ,113.2 + ,1.3477 + ,113.52 + ,1.346 + ,113.22 + ,1.3611 + ,113.85 + ,1.3648 + ,113.68 + ,1.3726 + ,114.26 + ,1.3705 + ,114.1 + ,1.378 + ,114.8 + ,1.3856 + ,114.98 + ,1.397 + ,115.1 + ,1.3874 + ,114.21 + ,1.3936 + ,114.24 + ,1.3833 + ,113.35 + ,1.3958 + ,114.23 + ,1.4101 + ,114.43 + ,1.4089 + ,114.28 + ,1.3896 + ,113 + ,1.3859 + ,113.16 + ,1.3861 + ,112.59 + ,1.4016 + ,113.65 + ,1.3934 + ,113.18 + ,1.4031 + ,113.21 + ,1.3912 + ,113.11 + ,1.3803 + ,112.78 + ,1.3857 + ,112.57 + ,1.3857 + ,111.87 + ,1.3926 + ,111.94 + ,1.4018 + ,113.18 + ,1.4014 + ,113.67 + ,1.4244 + ,115.15 + ,1.4084 + ,114.41 + ,1.3917 + ,112.88 + ,1.3945 + ,112.44 + ,1.377 + ,113.48 + ,1.37 + ,112.78 + ,1.3711 + ,112.59 + ,1.3626 + ,113.31 + ,1.3612 + ,113.21 + ,1.3481 + ,112.5 + ,1.3647 + ,113.72 + ,1.3674 + ,114.09 + ,1.3647 + ,113.97 + ,1.3496 + ,112.5 + ,1.3339 + ,111.28 + ,1.3321 + ,111.35 + ,1.3225 + ,110.92 + ,1.3146 + ,110.73 + ,1.2998 + ,109) + ,dim=c(2 + ,491) + ,dimnames=list(c('Dollar' + ,'Yen') + ,1:491)) > y <- array(NA,dim=c(2,491),dimnames=list(c('Dollar','Yen'),1:491)) > 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: Patrick Wessa > #To cite this work: Patrick Wessa, (2010), Multivariate Correlation Matrix (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Patrick.Wessa/rwasp_pairs.wasp#output/ > #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/1qt861292939472.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) > 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] 2 > 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/2cc6c1292939472.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 = 24.5472, df = 489, p-value < 2.2e-16 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.7005479 0.7801769 sample estimates: cor 0.7429801 > 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 message: 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/3fcn01292939472.tab") > > try(system("convert tmp/1qt861292939472.ps tmp/1qt861292939472.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.707 0.245 5.847