Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1966 1 41 1966 2 39 1966 3 50 1966 4 40 1966 5 43 1966 6 38 1966 7 44 1966 8 35 1966 9 39 1966 10 35 1966 11 29 1966 12 49 1967 1 50 1967 2 59 1967 3 63 1967 4 32 1967 5 39 1967 6 47 1967 7 53 1967 8 60 1967 9 57 1967 10 52 1967 11 70 1967 12 90 1968 1 74 1968 2 62 1968 3 55 1968 4 84 1968 5 94 1968 6 70 1968 7 108 1968 8 139 1968 9 120 1968 10 97 1968 11 126 1968 12 149 1969 1 158 1969 2 124 1969 3 140 1969 4 109 1969 5 114 1969 6 77 1969 7 120 1969 8 133 1969 9 110 1969 10 92 1969 11 97 1969 12 78 1970 1 99 1970 2 107 1970 3 112 1970 4 90 1970 5 98 1970 6 125 1970 7 155 1970 8 190 1970 9 236 1970 10 189 1970 11 174 1970 12 178 1971 1 136 1971 2 161 1971 3 171 1971 4 149 1971 5 184 1971 6 155 1971 7 276 1971 8 224 1971 9 213 1971 10 279 1971 11 268 1971 12 287 1972 1 238 1972 2 213 1972 3 257 1972 4 293 1972 5 212 1972 6 246 1972 7 353 1972 8 339 1972 9 308 1972 10 247 1972 11 257 1972 12 322 1973 1 298 1973 2 273 1973 3 312 1973 4 249 1973 5 286 1973 6 279 1973 7 309 1973 8 401 1973 9 309 1973 10 328 1973 11 353 1973 12 354 1974 1 327 1974 2 324 1974 3 285 1974 4 243 1974 5 241 1974 6 287 1974 7 355 1974 8 460 1974 9 364 1974 10 487 1974 11 452 1974 12 391 1975 1 500 1975 2 451 1975 3 375 1975 4 372 1975 5 302 1975 6 316 1975 7 398 1975 8 394 1975 9 431 1975 10 431
Names of X columns:
year month robberies
Type of Correlation
pearson
pearson
spearman
kendall
Chart options
Title:
R Code
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') 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) } } a<-table.end(a) table.save(a,file='mytable1.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