R version 3.6.3 (2020-02-29) -- "Holding the Windsock" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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. > source('/home/pw/wessanet/cretab') > > > > myrfcuid = '' > > x <- array(list(21.7630,21.0000,22.5100,1.1270,1.0890,33.5000,21.7500,21.8000,22.5000,1.1000,1.0580,32.6000,21.7760,24.2000,22.5000,1.1200,1.0410,31.7000,21.9730,21.6000,22.4550,1.0720,1.0680,30.0000,21.8670,21.5000,22.4880,1.1190,1.0930,27.3000,21.9060,22.4000,22.5000,1.1010,1.1120,29.6000,22.0880,22.8000,22.5000,1.0960,1.0650,33.6000,21.7220,22.4000,22.5000,1.0850,1.0760,34.6000,21.7220,22.4000,22.5000,1.0850,1.0760,34.6000,21.9310,21.8000,22.5000,1.0950,1.1030,31.5000,21.7580,21.2000,22.5000,1.0870,1.0850,35.2000,21.7930,21.0000,22.5000,1.0760,1.0580,33.7000,21.9480,21.2000,22.4490,1.0890,1.0760,30.3000,21.7720,21.9000,22.4820,1.0950,1.0670,27.7000,22.0070,19.9000,22.5000,1.1080,1.1110,31.3000,21.9360,21.8000,22.5000,1.1080,1.0680,22.7000,21.7350,22.8000,22.5000,1.0990,1.0810,33.6000,21.7350,22.8000,22.5000,1.0990,1.0810,33.6000,21.8320,21.5000,22.5000,1.0840,1.1340,35.6000,21.7560,21.3000,22.5000,1.1060,1.1440,33.3000,21.7090,20.6000,22.5000,1.0500,1.1410,33.6000,21.9510,21.0000,22.4520,1.1310,1.0800,28.2000,21.7920,22.0000,22.4850,1.0950,1.0990,26.3000,22.0970,20.4000,22.5000,1.0940,1.0610,31.1000,21.8810,22.1000,22.5000,1.0640,1.1010,32.7000,21.8140,21.5000,22.4790,1.0860,1.0940,28.5000,21.9010,22.6000,22.4850,1.0990,1.0850,14.2000,21.8260,19.8000,22.5100,1.0770,1.0800,34.1000,21.7950,20.9000,22.5000,1.1200,1.0650,32.3000,21.7570,20.0000,22.5000,1.1000,1.0720,34.2000,21.9470,21.9000,22.4490,1.1290,1.0980,27.8000,21.9030,22.6000,22.4850,1.0970,1.0960,27.1000,22.0450,22.5000,22.5000,1.1080,1.0970,29.4000,22.0940,23.5000,22.5000,1.0940,1.0660,30.5000,21.7820,24.0000,22.4820,1.1150,1.0840,30.1000,21.8550,21.7000,22.5000,1.1390,1.0870,33.8000,21.7840,20.4000,22.5000,1.1030,1.0770,32.7000,21.8930,20.5000,22.4880,1.1100,1.1620,29.9000,22.0550,25.4000,22.5000,1.0780,1.0920,28.7000,21.7070,27.3000,22.4820,1.1290,0.0910,26.5000,21.8700,21.8000,22.5000,1.1030,1.0950,33.2000,21.9310,21.2000,22.5000,1.1230,1.0790,33.9000,21.7810,21.7000,22.5000,1.0520,1.0410,33.7000,21.9450,22.5000,22.4790,1.1120,1.0930,16.6000,22.4680,23.3000,22.5000,1.0790,1.0750,32.4000,21.9600,25.0000,22.5000,1.0750,1.,092,33.0000,21.8830,23.5000,22.5000,1.0960,1.1050,32.5000,21.8360,19.7000,22.5000,1.0990,1.1110,35.2000,21.8160,22.6000,22.5000,1.0800,1.1230,33.2000,21.8510,22.6000,22.5000,1.1340,1.1250,32.5000,21.8660,21.9000,22.5000,1.1050,1.1220,32.4000,21.7780,23.3000,22.5000,1.1380,1.1230,31.5000,21.8350,22.4000,22.5000,1.0790,1.1200,32.2000,21.8530,21.9000,22.5000,1.1300,1.1040,34.1000,21.7780,22.8000,22.5000,1.0630,1.1510,28.6000,21.7140,24.7000,22.5000,1.1010,1.0770,28.8000,21.7910,24.5000,22.5000,1.1000,1.1180,29.6000,21.7370,24.0000,22.5000,1.1420,1.0760,29.0000,21.7010,25.9000,22.5000,1.1070,1.1010,29.4000,21.8010,22.2000,22.5100,1.1240,1.1030,32.9000,21.6770,23.3000,22.5000,1.0780,1.0560,29.6000,21.5200,24.2000,22.5000,1.0780,1.1100,29.7000,21.5480,22.2000,22.5000,1.1030,1.0710,30.4000,21.5310,22.9000,22.5000,1.0690,1.1160,30.7000,21.5320,23.6000,22.5100,1.0890,1.1040,30.1000,21.5480,21.4000,22.5100,1.1140,1.0740,30.9000,22.3900,21.3000,22.4900,1.1130,1.1240,27.3000,22.3900,22.3000,22.4900,1.1350,1.1050,27.6000,22.4300,22.2000,22.4900,1.1340,1.0300,27.3000,22.1500,20.8000,22.4900,1.1300,1.1310,27.6000,22.3300,19.8000,22.4900,1.1230,1.1670,29.1000,22.3200,21.4000,22.4900,1.1500,1.1010,25.5000,22.1300,21.3000,22.4900,1.1140,1.1320,27.8000,22.4900,21.8000,22.4900,1.0950,1.1520,26.9000,21.8620,23.0000,22.4850,1.1360,1.1530,27.1000,21.9910,22.3000,22.5620,1.1410,1.0980,28.3000,21.9840,22.7000,22.3880,1.1190,1.1120,31.0000,21.8480,22.1000,22.5680,1.0880,1.0850,28.8000,21.9920,21.5000,22.5010,1.1060,1.0770,29.1000,21.8550,22.1000,22.5710,1.1050,1.0690,27.0000,22.0340,22.5000,22.4950,1.0920,1.1090,28.3000,21.8160,25.2000,22.5620,1.1310,1.0670,26.1000,21.9530,22.8000,22.4950,1.1000,1.1100,27.4000,21.8980,21.2000,22.5680,1.0730,1.0980,28.6000,22.0190,24.4000,22.4880,1.0970,1.0990,26.3000,21.8570,22.7000,22.5620,1.0860,1.0820,26.3000),dim=c(6,86),dimnames=list(c('SolenoidResistance','ArmingTiming','Volts','FiringCXT#1Resistance','FiringCXT#2Resistance','S+ afeTime '),1:86)) > y <- array(NA,dim=c(6,86),dimnames=list(c('SolenoidResistance','ArmingTiming','Volts','FiringCXT#1Resistance','FiringCXT#2Resistance','SafeTime '),1:86)) > 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 = 'Scatter Plots and p-values' > par1 <- 'pearson' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Thu, 22 Sep 2016 20:11:42 +0200) > #Author: root > #To cite this work: Patrick Wessa, (2016), Multivariate Correlation Matrix (v1.0.11) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Patrick.Wessa/rwasp_pairs.wasp/ > #Source of accompanying publication: > # > 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', ...) + } > x <- na.omit(x) > y <- t(na.omit(t(y))) > postscript(file="/home/pw/wessanet/rcomp/tmp/1xa8l1586835655.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 > > n <- length(y[,1]) > print(n) [1] 6 > 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="/home/pw/wessanet/rcomp/tmp/2hfbj1586835655.tab") > ncorrs <- (n*n -n)/2 > mycorrs <- array(0, dim=c(10,3)) > 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 = -0.689, df = 84, p-value = 0.4927 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0.2823550 0.1391206 sample estimates: cor -0.07496438 > 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) + for (iii in 1:10) { + iiid100 <- iii / 100 + if (rp$p.value < iiid100) mycorrs[iii, 1] = mycorrs[iii, 1] + 1 + if (rs$p.value < iiid100) mycorrs[iii, 2] = mycorrs[iii, 2] + 1 + if (rk$p.value < iiid100) mycorrs[iii, 3] = mycorrs[iii, 3] + 1 + } + } + } There were 15 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/home/pw/wessanet/rcomp/tmp/310e91586835655.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Meta Analysis of Correlation Tests',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Number of significant by total number of Correlations',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Type I error',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) > for (iii in 1:10) { + iiid100 <- iii / 100 + a<-table.row.start(a) + a<-table.element(a,round(iiid100,2),header=T) + a<-table.element(a,round(mycorrs[iii,1]/ncorrs,2)) + a<-table.element(a,round(mycorrs[iii,2]/ncorrs,2)) + a<-table.element(a,round(mycorrs[iii,3]/ncorrs,2)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/home/pw/wessanet/rcomp/tmp/46v7b1586835655.tab") > > try(system("convert /home/pw/wessanet/rcomp/tmp/1xa8l1586835655.ps /home/pw/wessanet/rcomp/tmp/1xa8l1586835655.png",intern=TRUE)) character(0) > > proc.time() user system elapsed 0.502 0.032 0.599