R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(24300 + ,362 + ,1.439 + ,24.90 + ,24375 + ,361 + ,1.444 + ,25.06 + ,24375 + ,361 + ,1.435 + ,25.10 + ,24550 + ,356 + ,1.430 + ,24.92 + ,24725 + ,364 + ,1.427 + ,25.46 + ,24825 + ,375 + ,1.453 + ,25.89 + ,25100 + ,391 + ,1.448 + ,25.39 + ,24950 + ,379 + ,1.456 + ,25.38 + ,25325 + ,389 + ,1.449 + ,25.25 + ,25325 + ,387 + ,1.437 + ,24.88 + ,24800 + ,379 + ,1.437 + ,25.00 + ,24975 + ,385 + ,1.428 + ,25.00 + ,25125 + ,399 + ,1.413 + ,24.07 + ,25125 + ,388 + ,1.406 + ,23.60 + ,25125 + ,392 + ,1.414 + ,23.18 + ,25400 + ,395 + ,1.415 + ,23.25 + ,25175 + ,395 + ,1.409 + ,23.04 + ,24650 + ,370 + ,1.407 + ,22.77 + ,24775 + ,376 + ,1.400 + ,22.25 + ,24675 + ,367 + ,1.397 + ,22.41 + ,24825 + ,356 + ,1.391 + ,22.50 + ,24775 + ,362 + ,1.394 + ,22.91 + ,24675 + ,346 + ,1.398 + ,22.88 + ,24750 + ,347 + ,1.385 + ,21.69 + ,24875 + ,350 + ,1.369 + ,21.19 + ,25400 + ,361 + ,1.368 + ,21.56 + ,25400 + ,358 + ,1.376 + ,22.00 + ,24750 + ,334 + ,1.374 + ,22.13 + ,24900 + ,331 + ,1.372 + ,22.27 + ,24825 + ,337 + ,1.357 + ,22.30 + ,24875 + ,337 + ,1.361 + ,21.94 + ,24975 + ,341 + ,1.365 + ,22.40 + ,25375 + ,344 + ,1.373 + ,22.77 + ,25600 + ,342 + ,1.357 + ,22.90 + ,26000 + ,353 + ,1.352 + ,23.03 + ,25900 + ,355 + ,1.363 + ,23.05 + ,25850 + ,354 + ,1.358 + ,22.41 + ,26075 + ,353 + ,1.355 + ,22.26 + ,26275 + ,365 + ,1.349 + ,21.90 + ,26050 + ,366 + ,1.357 + ,22.01 + ,26000 + ,354 + ,1.353 + ,22.62 + ,25825 + ,353 + ,1.355 + ,22.76 + ,26075 + ,363 + ,1.364 + ,23.40 + ,26150 + ,368 + ,1.367 + ,23.63 + ,26275 + ,366 + ,1.358 + ,24.05 + ,26475 + ,376 + ,1.366 + ,23.82 + ,26500 + ,383 + ,1.356 + ,23.71 + ,26575 + ,382 + ,1.361 + ,23.95 + ,26425 + ,386 + ,1.366 + ,23.61 + ,26275 + ,389 + ,1.377 + ,23.98 + ,26375 + ,388 + ,1.371 + ,23.56 + ,25900 + ,382 + ,1.372 + ,23.99 + ,25850 + ,379 + ,1.376 + ,24.33 + ,25625 + ,374 + ,1.366 + ,24.48 + ,25900 + ,380 + ,1.355 + ,24.31 + ,26050 + ,383 + ,1.347 + ,24.38 + ,26150 + ,384 + ,1.352 + ,24.63 + ,26275 + ,385 + ,1.334 + ,25.54 + ,26100 + ,378 + ,1.336 + ,25.75 + ,25975 + ,378 + ,1.335 + ,25.73 + ,25975 + ,378 + ,1.347 + ,25.85 + ,26125 + ,383 + ,1.348 + ,25.78 + ,26175 + ,381 + ,1.348 + ,25.86 + ,26225 + ,382 + ,1.347 + ,26.86 + ,26225 + ,382 + ,1.340 + ,27.36 + ,26200 + ,390 + ,1.334 + ,27.38 + ,26275 + ,401 + ,1.330 + ,26.58 + ,26275 + ,392 + ,1.338 + ,27.65 + ,26275 + ,401 + ,1.359 + ,27.73 + ,26750 + ,406 + ,1.358 + ,27.18 + ,27075 + ,408 + ,1.362 + ,27.32 + ,27475 + ,421 + ,1.354 + ,27.30 + ,27525 + ,412 + ,1.354 + ,26.90 + ,27125 + ,407 + ,1.343 + ,26.70 + ,27000 + ,411 + ,1.349 + ,26.75 + ,26950 + ,405 + ,1.337 + ,26.41 + ,27075 + ,416 + ,1.334 + ,26.29 + ,27150 + ,410 + ,1.331 + ,27.51 + ,26875 + ,397 + ,1.332 + ,27.91 + ,26925 + ,409 + ,1.329 + ,27.70 + ,27150 + ,406 + ,1.325 + ,27.28 + ,27150 + ,406 + ,1.326 + ,28.25 + ,27425 + ,412 + ,1.332 + ,27.62 + ,27625 + ,426 + ,1.324 + ,27.30 + ,27475 + ,423 + ,1.309 + ,25.94 + ,28075 + ,425 + ,1.292 + ,24.99 + ,28075 + ,425 + ,1.273 + ,25.50 + ,28175 + ,423 + ,1.275 + ,24.42 + ,28350 + ,434 + ,1.297 + ,26.58 + ,28350 + ,434 + ,1.270 + ,25.84 + ,28500 + ,440 + ,1.267 + ,26.76 + ,29350 + ,422 + ,1.259 + ,26.74 + ,30225 + ,431 + ,1.249 + ,26.68 + ,29575 + ,442 + ,1.235 + ,25.55 + ,30125 + ,448 + ,1.243 + ,26.40 + ,30125 + ,448 + ,1.227 + ,25.19 + ,31150 + ,475 + ,1.233 + ,23.94 + ,31350 + ,481 + ,1.250 + ,24.20 + ,32175 + ,488 + ,1.236 + ,24.20 + ,31725 + ,476 + ,1.222 + ,23.07 + ,31600 + ,474 + ,1.231 + ,24.07 + ,30800 + ,455 + ,1.226 + ,25.02 + ,30800 + ,455 + ,1.238 + ,24.65 + ,29700 + ,434 + ,1.231 + ,24.68 + ,30875 + ,447 + ,1.216 + ,24.63 + ,31275 + ,455 + ,1.222 + ,24.49 + ,31500 + ,459 + ,1.227 + ,25.05 + ,31375 + ,465 + ,1.206 + ,24.31 + ,31400 + ,464 + ,1.196 + ,23.90 + ,31650 + ,468 + ,1.194 + ,23.68 + ,31975 + ,467 + ,1.201 + ,24.50 + ,31650 + ,468 + ,1.205 + ,25.22 + ,31975 + ,467 + ,1.213 + ,25.48 + ,32575 + ,454 + ,1.225 + ,26.00 + ,32025 + ,470 + ,1.226 + ,26.07 + ,33050 + ,477 + ,1.228 + ,26.06 + ,32300 + ,462 + ,1.236 + ,26.22 + ,32100 + ,467 + ,1.237 + ,26.70 + ,32250 + ,469 + ,1.239 + ,27.20 + ,32050 + ,467 + ,1.226 + ,26.77 + ,31975 + ,469 + ,1.227 + ,26.11 + ,32100 + ,466 + ,1.226 + ,25.43 + ,32025 + ,469 + ,1.229 + ,24.99 + ,32275 + ,482 + ,1.234 + ,25.51 + ,32100 + ,474 + ,1.220 + ,24.00 + ,32275 + ,477 + ,1.227 + ,23.86 + ,31975 + ,468 + ,1.233 + ,22.96 + ,32175 + ,469 + ,1.255 + ,23.41 + ,32375 + ,480 + ,1.253 + ,23.17 + ,32300 + ,474 + ,1.258 + ,24.12 + ,32450 + ,474 + ,1.257 + ,23.87 + ,32425 + ,471 + ,1.266 + ,24.27 + ,30800 + ,443 + ,1.264 + ,24.40 + ,30850 + ,441 + ,1.257 + ,24.16 + ,30750 + ,440 + ,1.257 + ,25.15 + ,30175 + ,436 + ,1.270 + ,25.09 + ,30350 + ,442 + ,1.283 + ,24.60 + ,30125 + ,437 + ,1.300 + ,24.33 + ,30625 + ,444 + ,1.296 + ,24.14 + ,30375 + ,440 + ,1.284 + ,24.36 + ,30425 + ,444 + ,1.282 + ,25.40 + ,30325 + ,440 + ,1.285 + ,26.15 + ,29825 + ,438 + ,1.290 + ,26.77 + ,29450 + ,427 + ,1.293 + ,26.94 + ,29100 + ,421 + ,1.303 + ,26.33 + ,29450 + ,424 + ,1.299 + ,26.24 + ,29550 + ,422 + ,1.307 + ,26.23 + ,29575 + ,436 + ,1.303 + ,25.88 + ,29425 + ,435 + ,1.307 + ,27.00 + ,29050 + ,433 + ,1.322 + ,26.91 + ,28525 + ,420 + ,1.321 + ,27.15 + ,28575 + ,417 + ,1.318 + ,27.78 + ,28500 + ,411 + ,1.318 + ,28.73 + ,28875 + ,430 + ,1.325 + ,28.83 + ,28625 + ,428 + ,1.313 + ,28.68 + ,28625 + ,428 + ,1.302 + ,27.56 + ,28925 + ,426 + ,1.279 + ,27.15 + ,28925 + ,432 + ,1.280 + ,27.41 + ,28950 + ,426 + ,1.282 + ,27.47 + ,28950 + ,426 + ,1.286 + ,28.76 + ,29100 + ,424 + ,1.288 + ,28.47 + ,29700 + ,424 + ,1.284 + ,27.94 + ,30000 + ,431 + ,1.271 + ,27.23 + ,30400 + ,441 + ,1.270 + ,27.01 + ,30375 + ,444 + ,1.261 + ,26.15 + ,30425 + ,447 + ,1.261 + ,26.11 + ,30625 + ,440 + ,1.269 + ,27.20 + ,30700 + ,442 + ,1.271 + ,27.36 + ,30825 + ,439 + ,1.270 + ,27.33 + ,30800 + ,439 + ,1.268 + ,27.43 + ,31100 + ,453 + ,1.280 + ,28.92 + ,31175 + ,459 + ,1.282 + ,29.45 + ,31025 + ,462 + ,1.283 + ,29.01 + ,30975 + ,466 + ,1.287 + ,29.25 + ,31025 + ,464 + ,1.274 + ,29.14 + ,31350 + ,473 + ,1.270 + ,29.64 + ,31075 + ,469 + ,1.272 + ,30.40 + ,31125 + ,474 + ,1.273 + ,30.62 + ,30900 + ,480 + ,1.280 + ,31.25 + ,31150 + ,482 + ,1.285 + ,31.75 + ,31575 + ,486 + ,1.299 + ,31.30 + ,31575 + ,486 + ,1.308 + ,30.70 + ,31375 + ,484 + ,1.306 + ,31.03 + ,31100 + ,484 + ,1.307 + ,31.46 + ,30975 + ,487 + ,1.312 + ,31.28 + ,31200 + ,490 + ,1.336 + ,31.03 + ,31125 + ,491 + ,1.332 + ,30.95 + ,31075 + ,495 + ,1.341 + ,31.17 + ,31275 + ,497 + ,1.348 + ,31.29 + ,31175 + ,496 + ,1.346 + ,31.91 + ,30950 + ,489 + ,1.361 + ,32.10 + ,30725 + ,485 + ,1.365 + ,31.71 + ,30900 + ,490 + ,1.373 + ,31.90 + ,30700 + ,493 + ,1.371 + ,32.02 + ,30625 + ,487 + ,1.378 + ,32.65 + ,30700 + ,495 + ,1.386 + ,33.77 + ,30650 + ,506 + ,1.397 + ,33.51 + ,30525 + ,492 + ,1.387 + ,34.26 + ,30850 + ,500 + ,1.394 + ,34.21 + ,30725 + ,499 + ,1.383 + ,34.13 + ,31025 + ,518 + ,1.396 + ,34.73 + ,30975 + ,517 + ,1.410 + ,34.73 + ,30550 + ,505 + ,1.409 + ,34.57 + ,30900 + ,522 + ,1.390 + ,34.80 + ,31000 + ,519 + ,1.386 + ,33.98 + ,31000 + ,519 + ,1.386 + ,34.40 + ,31000 + ,522 + ,1.402 + ,34.21 + ,31000 + ,519 + ,1.393 + ,34.61 + ,31325 + ,543 + ,1.403 + ,35.25 + ,31000 + ,537 + ,1.391 + ,35.23 + ,31000 + ,537 + ,1.380 + ,35.00 + ,30300 + ,520 + ,1.386 + ,34.52 + ,30575 + ,523 + ,1.386 + ,33.82 + ,30575 + ,526 + ,1.393 + ,34.35 + ,30775 + ,537 + ,1.402 + ,34.81 + ,30550 + ,534 + ,1.401 + ,34.96 + ,30750 + ,536 + ,1.424 + ,36.69 + ,31025 + ,557 + ,1.408 + ,36.42 + ,31000 + ,554 + ,1.392 + ,36.44 + ,30850 + ,550 + ,1.395 + ,37.41 + ,30600 + ,549 + ,1.377 + ,36.40 + ,31150 + ,575 + ,1.370 + ,36.15 + ,31800 + ,595 + ,1.371 + ,35.78 + ,32500 + ,636 + ,1.363 + ,36.95 + ,32325 + ,628 + ,1.361 + ,36.14 + ,31800 + ,594 + ,1.348 + ,36.36 + ,31850 + ,590 + ,1.365 + ,37.31 + ,31625 + ,590 + ,1.367 + ,37.58 + ,31750 + ,605 + ,1.365 + ,38.00 + ,31650 + ,618 + ,1.350 + ,37.23 + ,31525 + ,630 + ,1.334 + ,37.00 + ,32075 + ,638 + ,1.332 + ,37.87 + ,32725 + ,645 + ,1.323 + ,37.70 + ,32900 + ,640 + ,1.315 + ,36.17 + ,32775 + ,640 + ,1.300 + ,36.56 + ,32825 + ,634 + ,1.312 + ,37.70 + ,33200 + ,647 + ,1.316 + ,38.77 + ,34100 + ,682 + ,1.325 + ,39.02 + ,33800 + ,679 + ,1.328 + ,39.88 + ,33525 + ,677 + ,1.336 + ,39.56 + ,33775 + ,697 + ,1.320 + ,38.52 + ,34000 + ,702 + ,1.321 + ,37.20 + ,33425 + ,679 + ,1.324 + ,38.58 + ,33550 + ,685 + ,1.327 + ,39.41 + ,33400 + ,695 + ,1.344 + ,39.08 + ,33300 + ,685 + ,1.336 + ,38.81 + ,33400 + ,688 + ,1.324 + ,38.73 + ,33000 + ,685 + ,1.326 + ,38.70 + ,33500 + ,694 + ,1.315 + ,39.23 + ,33550 + ,694 + ,1.316 + ,39.82 + ,33725 + ,697 + ,1.311 + ,39.97 + ,33700 + ,700 + ,1.306 + ,40.37 + ,33600 + ,695 + ,1.310 + ,39.54 + ,33550 + ,693 + ,1.314 + ,39.21 + ,33500 + ,693 + ,1.320 + ,39.07 + ,34200 + ,722 + ,1.314 + ,39.78 + ,34000 + ,725 + ,1.328 + ,39.40 + ,33600 + ,715 + ,1.336 + ,38.90) + ,dim=c(4 + ,258) + ,dimnames=list(c('Goud' + ,'Zilver' + ,'Eur-Dol' + ,'Umi') + ,1:258)) > y <- array(NA,dim=c(4,258),dimnames=list(c('Goud','Zilver','Eur-Dol','Umi'),1:258)) > 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/wessaorg/rcomp/tmp/1odlx1324630438.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/26m0z1324630438.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 = 18.0168, p-value < 2.2e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.7561124 > 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 > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3phlf1324630438.tab") > > try(system("convert tmp/1odlx1324630438.ps tmp/1odlx1324630438.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.229 0.159 1.411