R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-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. > x <- c(330123,334728,338414,338582,339904,341396,343496,344591,346099,347258,348503,348628,349913,352797,354539,353032,355576,355603,357889,359310,361253,364253,364872,364201,368830,368755,370117,372895,374215,375539,380550,382839,386678,389265,393978,397923,394691,394410,398981,399827,403635,402425,406939,404544,406309,407884,407151,414154,408459,407609,408503,409068,412860,415113,418053,415780,413562,414521,413948,413106) > par1 = '12' > par1 <- as.numeric(par1) > (n <- length(x)) [1] 60 > (np <- floor(n / par1)) [1] 5 > arr <- array(NA,dim=c(par1,np+1)) > darr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > dx <- diff(x) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + darr[j,ari[j]] <- dx[i] + if (j == par1) j = 0 + } > ari [1] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 330123 349913 368830 394691 408459 NA [2,] 334728 352797 368755 394410 407609 NA [3,] 338414 354539 370117 398981 408503 NA [4,] 338582 353032 372895 399827 409068 NA [5,] 339904 355576 374215 403635 412860 NA [6,] 341396 355603 375539 402425 415113 NA [7,] 343496 357889 380550 406939 418053 NA [8,] 344591 359310 382839 404544 415780 NA [9,] 346099 361253 386678 406309 413562 NA [10,] 347258 364253 389265 407884 414521 NA [11,] 348503 364872 393978 407151 413948 NA [12,] 348628 364201 397923 414154 413106 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 4605 2884 -75 -281 -850 NA [2,] 3686 1742 1362 4571 894 NA [3,] 168 -1507 2778 846 565 NA [4,] 1322 2544 1320 3808 3792 NA [5,] 1492 27 1324 -1210 2253 NA [6,] 2100 2286 5011 4514 2940 NA [7,] 1095 1421 2289 -2395 -2273 NA [8,] 1508 1943 3839 1765 -2218 NA [9,] 1159 3000 2587 1575 959 NA [10,] 1245 619 4713 -733 -573 NA [11,] 125 -671 3945 7003 -842 NA [12,] 1285 4629 -3232 -5695 NA NA > arr.mean <- array(NA,dim=par1) > arr.median <- array(NA,dim=par1) > arr.midrange <- array(NA,dim=par1) > for (j in 1:par1) + { + arr.mean[j] <- mean(arr[j,],na.rm=TRUE) + arr.median[j] <- median(arr[j,],na.rm=TRUE) + arr.midrange[j] <- (quantile(arr[j,],0.75,na.rm=TRUE) + quantile(arr[j,],0.25,na.rm=TRUE)) / 2 + } > overall.mean <- mean(x) > overall.median <- median(x) > overall.midrange <- (quantile(x,0.75) + quantile(x,0.25)) / 2 > postscript(file="/var/wessaorg/rcomp/tmp/1gkk11321391281.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,type='b',ylab='mean',main='Mean Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.mean,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2em2i1321391281.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.median,type='b',ylab='median',main='Median Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.median,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3nk0o1321391281.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.midrange,type='b',ylab='midrange',main='Midrange Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.midrange,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/42wy01321391281.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(arr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 330123 334728 338414 338582 339904 341396 343496 344591 346099 347258 [2,] 349913 352797 354539 353032 355576 355603 357889 359310 361253 364253 [3,] 368830 368755 370117 372895 374215 375539 380550 382839 386678 389265 [4,] 394691 394410 398981 399827 403635 402425 406939 404544 406309 407884 [5,] 408459 407609 408503 409068 412860 415113 418053 415780 413562 414521 [,11] [,12] [1,] 348503 348628 [2,] 364872 364201 [3,] 393978 397923 [4,] 407151 413106 [5,] 413948 414154 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 337190 339351.4 338714.4 339829.8 340256.6 342454.7 345891.4 350876.8 [2,] 400470 398158.6 401519.6 405960.2 408173.4 408623.3 415208.6 414801.2 [,9] [,10] [,11] [,12] [1,] 354841.5 358435.4 364103.8 363366.9 [2,] 418514.5 420094.6 423852.2 432479.1 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(330123, 349913, 368830, 394691, 408459, 334728, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51pma1321391281.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(darr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Differenced Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -850 894 168 1320 -1210 2100 -2395 1508 959 -733 -842 -5695.0 [2,] -281 1362 168 1322 27 2286 -2273 1508 1159 -573 -671 -4463.5 [3,] -75 1742 565 2544 1324 2940 1095 1765 1575 619 125 -973.5 [4,] 2884 3686 846 3792 1492 4514 1421 1943 2587 1245 3945 2957.0 [5,] 4605 4571 846 3808 2253 5011 2289 1943 3000 1245 7003 4629.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2311.381 99.86745 85.92691 798.7042 288.8347 1365.701 -1515.171 [2,] 2161.381 3384.13255 1044.07309 4289.2958 2359.1653 4514.299 3705.171 [,8] [,9] [,10] [,11] [,12] [1,] 1457.63 565.9788 -665.5942 -3136.654 -6835.695 [2,] 2072.37 2584.0212 1903.5942 3386.654 4888.695 $out [1] -1507 2778 3839 -2218 4713 $group [1] 3 3 8 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-850, -281, -75, 2884, 4605, 894, 1362, 1742, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tiif1321391281.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(arr) > names(z) <- c(1:np) > (boxplot(z,notch=TRUE,col='grey',xlab='Block Index',ylab='Value',main='Notched Box Plots - Sequential Blocks')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [1,] 330123.0 349913.0 368755.0 394410.0 407609.0 NA [2,] 338498.0 353785.5 371506.0 399404.0 408785.5 NA [3,] 342446.0 356746.0 378044.5 404089.5 413334.0 NA [4,] 346678.5 362727.0 387971.5 407045.0 414817.0 NA [5,] 348628.0 364872.0 397923.0 414154.0 418053.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 338714.8 352667.7 370534.5 400604.4 410583 NA [2,] 346177.2 360824.3 385554.5 407574.6 416085 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(330123, 338498, 342446, 346678.5, 348628, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74g8j1321391281.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(cbind(arr.mean,arr.median,arr.midrange)) > names(z) <- list('mean','median','midrange') > (boxplot(z,notch=TRUE,col='grey',ylab='Overall Central Tendency',main='Notched Box Plots')) $stats [,1] [,2] [,3] [1,] 370403.2 368755.0 372302.0 [2,] 374395.8 371506.0 376594.8 [3,] 379700.3 378044.5 380766.2 [4,] 383708.2 387971.5 384896.2 [5,] 387602.4 397923.0 388653.5 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 375452.9 370534.5 376979.9 [2,] 383947.7 385554.5 384552.6 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(370403.2, 374395.8, 379700.3, 383708.2, 387602.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1gkk11321391281.ps tmp/1gkk11321391281.png",intern=TRUE)) character(0) > try(system("convert tmp/2em2i1321391281.ps tmp/2em2i1321391281.png",intern=TRUE)) character(0) > try(system("convert tmp/3nk0o1321391281.ps tmp/3nk0o1321391281.png",intern=TRUE)) character(0) > try(system("convert tmp/42wy01321391281.ps tmp/42wy01321391281.png",intern=TRUE)) character(0) > try(system("convert tmp/51pma1321391281.ps tmp/51pma1321391281.png",intern=TRUE)) character(0) > try(system("convert tmp/6tiif1321391281.ps tmp/6tiif1321391281.png",intern=TRUE)) character(0) > try(system("convert tmp/74g8j1321391281.ps tmp/74g8j1321391281.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.529 0.413 1.974