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(151.7 + ,105.2 + ,115.2 + ,126.8 + ,121.3 + ,105.2 + ,119.8 + ,128.5 + ,133.0 + ,105.6 + ,117.5 + ,126.8 + ,119.6 + ,105.6 + ,123.2 + ,128.5 + ,122.2 + ,106.2 + ,129.0 + ,130.2 + ,117.4 + ,106.3 + ,124.4 + ,131.8 + ,106.7 + ,106.4 + ,117.5 + ,130.2 + ,87.5 + ,106.9 + ,116.3 + ,126.8 + ,81.0 + ,107.2 + ,119.8 + ,130.2 + ,110.3 + ,107.3 + ,112.9 + ,126.8 + ,87.0 + ,107.3 + ,109.4 + ,123.5 + ,55.7 + ,107.4 + ,108.3 + ,121.8 + ,146.0 + ,107.55 + ,108.3 + ,120.2 + ,137.5 + ,107.87 + ,110.6 + ,118.5 + ,138.5 + ,108.37 + ,111.7 + ,121.8 + ,135.6 + ,108.38 + ,118.6 + ,125.2 + ,107.3 + ,107.92 + ,116.3 + ,125.2 + ,99.0 + ,108.03 + ,114.0 + ,120.2 + ,91.4 + ,108.14 + ,115.2 + ,120.2 + ,68.4 + ,108.3 + ,115.2 + ,120.2 + ,82.6 + ,108.64 + ,117.5 + ,123.5 + ,98.4 + ,108.66 + ,116.3 + ,130.2 + ,71.3 + ,109.04 + ,114.0 + ,123.5 + ,47.6 + ,109.03 + ,112.9 + ,123.5 + ,130.8 + ,109.03 + ,116.3 + ,125.2 + ,113.6 + ,109.54 + ,118.6 + ,130.2 + ,125.7 + ,109.75 + ,118.6 + ,135.2 + ,113.6 + ,109.83 + ,115.2 + ,125.2 + ,97.1 + ,109.65 + ,110.6 + ,116.8 + ,104.4 + ,109.82 + ,111.7 + ,118.5 + ,91.8 + ,109.95 + ,112.9 + ,118.5 + ,75.1 + ,110.12 + ,117.5 + ,121.8 + ,89.2 + ,110.15 + ,119.8 + ,123.5 + ,110.2 + ,110.2 + ,116.3 + ,123.5 + ,78.4 + ,109.99 + ,116.3 + ,125.2 + ,68.4 + ,110.14 + ,115.2 + ,123.5 + ,122.8 + ,110.14 + ,116.3 + ,123.5 + ,129.7 + ,110.81 + ,117.5 + ,121.8 + ,159.1 + ,110.97 + ,118.6 + ,126.8 + ,139.0 + ,110.99 + ,122.1 + ,133.5 + ,102.2 + ,109.73 + ,129.0 + ,138.5 + ,113.6 + ,109.81 + ,129.0 + ,135.2 + ,81.5 + ,110.02 + ,130.1 + ,138.5 + ,77.4 + ,110.18 + ,130.1 + ,146.9 + ,87.6 + ,110.21 + ,130.1 + ,148.5 + ,101.2 + ,110.25 + ,134.7 + ,155.2 + ,87.2 + ,110.36 + ,131.3 + ,151.9 + ,64.9 + ,110.51 + ,124.4 + ,150.2 + ,133.1 + ,110.64 + ,123.2 + ,143.5 + ,118.0 + ,110.95 + ,129.0 + ,146.9 + ,135.9 + ,111.18 + ,131.3 + ,155.2 + ,125.7 + ,111.19 + ,139.3 + ,163.6 + ,108.0 + ,111.69 + ,138.2 + ,161.9 + ,128.3 + ,111.7 + ,141.7 + ,171.9 + ,84.7 + ,111.83 + ,148.6 + ,176.9 + ,86.4 + ,111.77 + ,150.9 + ,176.9 + ,92.2 + ,111.73 + ,157.8 + ,180.3 + ,95.8 + ,112.01 + ,155.5 + ,181.9 + ,92.3 + ,111.86 + ,145.1 + ,173.6 + ,54.3 + ,112.04 + ,145.1 + ,166.9) + ,dim=c(4 + ,60) + ,dimnames=list(c('IPERS' + ,'PPERS' + ,'PB' + ,'PD') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('IPERS','PPERS','PB','PD'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > main = 'Kendall tau Correlation Plot' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > 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='kendall') + 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/1097u1257802903.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") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Kendall tau rank correlations for all pairs of data series',3,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'pair',1,TRUE) > a<-table.element(a,'tau',1,TRUE) > a<-table.element(a,'p-value',1,TRUE) > a<-table.row.end(a) > n <- length(y[,1]) > n [1] 4 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = -1.1483, p-value = 0.2509 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.101983 > for (i in 1:(n-1)) + { + for (j in (i+1):n) + { + a<-table.row.start(a) + dum <- paste('tau(',dimnames(t(x))[[2]][i]) + dum <- paste(dum,',') + dum <- paste(dum,dimnames(t(x))[[2]][j]) + dum <- paste(dum,')') + a<-table.element(a,dum,header=TRUE) + r <- cor.test(y[i,],y[j,],method='kendall') + a<-table.element(a,r$estimate) + a<-table.element(a,r$p.value) + a<-table.row.end(a) + } + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2c9dq1257802903.tab") > > system("convert tmp/1097u1257802903.ps tmp/1097u1257802903.png") > > > proc.time() user system elapsed 0.493 0.199 0.564