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(0 + ,6532 + ,151352 + ,1151176 + ,0 + ,7123 + ,288170 + ,790090 + ,0 + ,7146 + ,134028 + ,450033 + ,0 + ,8568 + ,32168 + ,783310 + ,1 + ,3369 + ,87161 + ,688779 + ,1 + ,6620 + ,80570 + ,696348 + ,1 + ,4519 + ,102129 + ,597793 + ,0 + ,2220 + ,301670 + ,821730 + ,1 + ,5336 + ,112477 + ,697458 + ,1 + ,2365 + ,191778 + ,700368 + ,0 + ,4069 + ,79804 + ,225986 + ,0 + ,7710 + ,128294 + ,348695 + ,0 + ,4525 + ,93811 + ,501709 + ,0 + ,6869 + ,117520 + ,413743 + ,0 + ,4628 + ,69159 + ,379825 + ,1 + ,3653 + ,101792 + ,336260 + ,1 + ,1265 + ,210568 + ,636765 + ,1 + ,7489 + ,136996 + ,481231 + ,0 + ,4901 + ,121920 + ,469107 + ,0 + ,2284 + ,76403 + ,211928 + ,1 + ,3160 + ,108094 + ,563925 + ,1 + ,4150 + ,134759 + ,511939 + ,1 + ,7285 + ,188873 + ,521016 + ,1 + ,1134 + ,146216 + ,543856 + ,1 + ,4658 + ,156608 + ,329304 + ,0 + ,2384 + ,61348 + ,423262 + ,0 + ,3748 + ,50350 + ,509665 + ,0 + ,5371 + ,87720 + ,455881 + ,0 + ,1285 + ,99489 + ,367772 + ,1 + ,9327 + ,87419 + ,406339 + ,1 + ,5565 + ,94355 + ,493408 + ,0 + ,1528 + ,60326 + ,232942 + ,1 + ,3122 + ,94670 + ,416002 + ,1 + ,7317 + ,82425 + ,337430 + ,0 + ,2675 + ,59017 + ,361517 + ,0 + ,880 + ,80791 + ,235561 + ,1 + ,2053 + ,100423 + ,408247 + ,0 + ,1424 + ,131116 + ,450296 + ,1 + ,4036 + ,100269 + ,418799 + ,1 + ,3045 + ,27330 + ,247405 + ,0 + ,5119 + ,39039 + ,378519 + ,0 + ,1431 + ,106885 + ,326638 + ,0 + ,554 + ,79285 + ,328233 + ,0 + ,1975 + ,118881 + ,386225 + ,1 + ,1286 + ,77623 + ,283662 + ,0 + ,1012 + ,114768 + ,370225 + ,0 + ,810 + ,74015 + ,269236 + ,0 + ,1280 + ,69465 + ,365732 + ,1 + ,666 + ,117869 + ,420383 + ,0 + ,1380 + ,60982 + ,345811 + ,1 + ,4608 + ,90131 + ,431809 + ,0 + ,876 + ,138971 + ,418876 + ,0 + ,814 + ,39625 + ,297476 + ,0 + ,514 + ,102725 + ,416776 + ,1 + ,5692 + ,64239 + ,357257 + ,0 + ,3642 + ,90262 + ,458343 + ,0 + ,540 + ,103960 + ,388386 + ,0 + ,2099 + ,106611 + ,358934 + ,0 + ,567 + ,103345 + ,407560 + ,0 + ,2001 + ,95551 + ,392558 + ,1 + ,2949 + ,82903 + ,373177 + ,0 + ,2253 + ,63593 + ,428370 + ,1 + ,6533 + ,126910 + ,369419 + ,0 + ,1889 + ,37527 + ,358649 + ,1 + ,3055 + ,60247 + ,376641 + ,0 + ,272 + ,112995 + ,467427 + ,1 + ,1414 + ,70184 + ,364885 + ,0 + ,2564 + ,130140 + ,436230 + ,1 + ,1383 + ,73221 + ,329118 + ,1 + ,1261 + ,76114 + ,317365 + ,0 + ,975 + ,90534 + ,286849 + ,0 + ,3366 + ,108479 + ,376685 + ,0 + ,576 + ,113761 + ,407198 + ,0 + ,1306 + ,68696 + ,377772 + ,0 + ,746 + ,71561 + ,271483 + ,1 + ,3192 + ,59831 + ,153661 + ,1 + ,2045 + ,97890 + ,513294 + ,0 + ,5477 + ,101481 + ,324881 + ,1 + ,1932 + ,72954 + ,264512 + ,0 + ,936 + ,67939 + ,420968 + ,1 + ,3437 + ,48022 + ,129302 + ,0 + ,5131 + ,86111 + ,191521 + ,1 + ,2397 + ,74020 + ,268673 + ,1 + ,1389 + ,57530 + ,353179 + ,0 + ,1503 + ,56364 + ,354624 + ,0 + ,402 + ,84990 + ,363713 + ,0 + ,2239 + ,88590 + ,456657 + ,1 + ,2234 + ,77200 + ,211742 + ,0 + ,837 + ,61262 + ,338381 + ,0 + ,875 + ,67000 + ,351483 + ,0 + ,1395 + ,93099 + ,372928 + ,1 + ,1659 + ,107577 + ,485538 + ,1 + ,2647 + ,62920 + ,279268 + ,1 + ,3294 + ,75832 + ,219060 + ,0 + ,94 + ,60793 + ,325314 + ,0 + ,422 + ,57935 + ,322046 + ,0 + ,34 + ,60630 + ,325599 + ,0 + ,1558 + ,55637 + ,377028 + ,0 + ,43 + ,60887 + ,323850 + ,0 + ,316 + ,60505 + ,331514) + ,dim=c(4 + ,100) + ,dimnames=list(c('Group' + ,'Costs' + ,'Dividends' + ,'Wealth ') + ,1:100)) > y <- array(NA,dim=c(4,100),dimnames=list(c('Group','Costs','Dividends','Wealth '),1:100)) > 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/1pdd91293206917.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) Warning messages: 1: In strwidth(labels, "user") : font width unknown for character 0xd 2: In text.default(x, y, txt, cex = cex, font = font) : font width unknown for character 0xd 3: In text.default(x, y, txt, cex = cex, font = font) : font metrics unknown for character 0xd > 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] 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/html/rcomp/tmp/2tete1293206917.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 = 3.1732, p-value = 0.001508 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.2616967 > 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 > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3759n1293206917.tab") > > try(system("convert tmp/1pdd91293206917.ps tmp/1pdd91293206917.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.623 0.256 1.274