Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
25 0 0 245 253 1 0 0 1 71 33 0 0 238 253 1 0 0 1 54 26 0 0 233 257 1 0 0 1 44 33 0 0 201 245 0 0 0 1 63 31 0 0 204 242 0 0 0 1 78 26 0 0 210 248 0 0 0 1 52 29 0 1 225 254 0 0 1 1 59 28 0 0 242 232 0 0 0 1 67 26 1 0 243 233 0 1 0 1 80 26 1 0 211 245 0 0 1 1 55 27 1 NA 249 249 0 0 0 1 93 27 1 0 250 265 1 0 0 1 44 25 0 0 209 247 0 0 0 1 92 26 0 0 208 252 0 0 0 1 74 31 0 0 238 253 0 0 0 1 82 32 0 0 235 NA 0 0 0 0 52 31 0 0 240 NA 0 0 0 0 63 26 0 0 224 249 0 1 0 1 85 30 1 0 209 242 0 0 0 1 82 27 1 0 244 254 1 0 0 1 59 28 1 0 232 243 0 0 0 1 50 26 0 0 245 254 0 0 0 1 48 30 0 0 199 243 0 0 0 1 48 27 0 0 231 243 0 0 0 1 75 26 1 0 242 253 0 1 0 1 93 27 1 0 218 244 0 0 0 1 56 25 1 0 265 264 1 1 0 1 47 27 0 0 216 238 0 0 0 0 74 28 1 0 253 256 1 0 0 1 48 26 1 0 213 250 0 0 0 1 67 32 1 0 257 256 0 0 0 1 89 24 0 0 258 266 1 0 0 1 44 26 0 0 245 NA 1 0 1 1 59 30 1 0 214 245 0 0 0 1 67 28 1 0 229 NA 0 0 0 0 43 29 0 1 227 240 1 0 0 1 54 27 0 0 236 240 0 0 0 1 70 26 0 0 213 229 0 0 0 0 44 27 0 0 233 NA 0 0 1 0 52 26 1 0 234 248 0 0 0 0 44 25 1 0 215 243 0 0 0 1 52 31 0 0 220 NA 0 1 0 0 67 25 0 0 212 222 0 0 0 0 44 35 1 1 244 256 1 1 0 1 67 25 0 0 216 245 0 0 1 1 52 34 1 1 219 256 1 1 1 1 70 38 0 1 209 253 0 0 0 1 93 30 1 NA 210 201 0 0 0 0 52 28 0 0 224 246 0 0 0 1 78 26 0 0 226 246 0 0 0 1 58 33 1 1 249 261 1 0 0 1 72 25 1 0 245 254 0 0 1 1 72 25 0 0 227 237 0 0 0 0 75 32 1 0 223 243 0 0 0 1 78 27 1 0 249 257 1 0 0 1 78 26 0 0 237 NA 0 0 0 0 47 27 0 0 216 248 0 0 0 1 67 27 0 0 241 241 0 0 0 1 58 27 1 0 218 240 0 0 1 1 61 25 1 1 229 232 0 0 0 0 61 26 1 0 254 259 0 0 0 1 69 27 1 0 225 NA 0 0 0 0 72 NA 1 1 247 260 1 0 0 1 56 28 1 0 212 NA 0 0 1 0 70 26 0 0 229 261 1 1 0 1 77 26 0 0 204 258 0 0 0 1 67 25 0 1 222 252 0 0 0 1 64 24 0 0 222 243 0 0 0 1 65 32 1 0 254 257 1 0 0 1 69 31 1 0 NA NA 0 0 0 0 52 28 1 0 226 219 0 0 0 0 47 28 1 1 240 248 0 0 0 1 74 27 1 0 221 241 0 0 0 1 58 25 1 0 219 242 0 0 0 1 50 29 1 0 236 229 0 0 0 0 56 26 1 0 221 238 0 0 0 0 55 25 0 0 237 260 1 0 0 1 61 26 0 0 231 229 0 0 0 0 86 25 0 0 233 249 0 1 0 1 55 25 0 0 230 250 0 0 0 1 69 28 0 0 212 243 0 0 0 1 81 26 0 0 228 246 0 0 0 1 55 26 0 0 218 244 0 0 0 1 80 26 1 0 245 NA 1 0 0 1 58 26 1 0 243 257 0 0 0 1 58 30 1 1 247 259 1 0 0 1 44 28 0 0 221 237 0 0 0 0 44 31 0 1 215 222 0 0 0 0 64 31 0 0 228 251 1 0 0 1 55 26 1 0 259 NA 0 0 1 1 72 26 1 0 234 248 0 0 0 1 61 25 1 0 251 259 0 0 0 1 73 26 0 0 216 252 0 0 0 1 63 30 0 0 229 248 0 1 1 1 78 26 0 0 216 259 1 0 0 1 69 33 0 0 217 229 0 1 0 0 72 27 0 0 238 244 1 0 0 1 61 32 1 1 239 262 0 0 0 1 58 29 1 0 215 223 0 0 0 0 64 26 1 0 214 243 0 0 0 1 72 27 0 0 213 231 0 0 0 0 69 27 0 0 237 241 0 0 0 1 78 29 1 0 245 234 0 0 0 1 61 27 1 0 242 NA 1 0 0 1 75 27 1 0 244 238 0 1 0 1 72 35 1 0 266 264 1 0 0 1 95 25 1 0 254 NA 1 0 0 1 75 28 0 1 207 246 0 1 0 1 69 28 1 1 217 246 0 0 1 1 53 27 0 1 210 221 0 1 0 0 89
Names of X columns:
age gender humanity step1 step2 quartile gold 25 uslmehigh avg
Type of Correlation
pearson
pearson
spearman
kendall
Chart options
Title:
R Code
par1 <- 'pearson' 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', ...) } bitmap(file='test1.png') pairs(t(y),diag.panel=panel.hist, upper.panel=panel.smooth, lower.panel=panel.tau, main=main) dev.off() load(file='createtable') n <- length(y[,1]) n 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='mytable.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) 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 } } } a<-table.end(a) table.save(a,file='mytable1.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='mytable2.tab')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation