R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(76035,74427,73354,73081,75309,75463,75910,76151,76882,78632,80137,82490,79896,81303,79344,81355,82328,79669,77249,75101,72520,72438,72653,71429,69189,66451,63354,61379,61880,62274,62429,63905,63917,64295,61930,60440,59353,58695,60569,60386,60938,61795,63304,64270,63492,61333,59341,58412,58725,59277,58562,57858,58790,58243,57044,57339,59429,60575,61950,61712) > par1 = '3' > par1 <- as.numeric(par1) > (n <- length(x)) [1] 60 > (np <- floor(n / par1)) [1] 20 > 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] 20 20 20 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 76035 73081 75910 78632 79896 81355 77249 72438 69189 61379 62429 64295 [2,] 74427 75309 76151 80137 81303 82328 75101 72653 66451 61880 63905 61930 [3,] 73354 75463 76882 82490 79344 79669 72520 71429 63354 62274 63917 60440 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 59353 60386 63304 61333 58725 57858 57044 60575 NA [2,] 58695 60938 64270 59341 59277 58790 57339 61950 NA [3,] 60569 61795 63492 58412 58562 58243 59429 61712 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -1608 2228 241 1505 1407 973 -2148 215 -2738 501 1476 -2365 [2,] -1073 154 731 2353 -1959 -2659 -2581 -1224 -3097 394 12 -1490 [3,] -273 447 1750 -2594 2011 -2420 -82 -2240 -1975 155 378 -1087 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] -658 552 966 -1992 552 932 295 1375 NA [2,] 1874 857 -778 -929 -715 -547 2090 -238 NA [3,] -183 1509 -2159 313 -704 -1199 1146 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/www/rcomp/tmp/1uxva1321387835.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/www/rcomp/tmp/2b41v1321387835.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/www/rcomp/tmp/36f7t1321387835.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/www/rcomp/tmp/41imf1321387835.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] [1,] 57044.0 57339.0 58243.0 [2,] 60480.5 60139.5 60504.5 [3,] 63799.5 64087.5 63423.0 [4,] 75972.5 75205.0 74408.5 [5,] 81355.0 82328.0 82490.0 $n [1] 20 20 20 $conf [,1] [,2] [,3] [1,] 58326.2 58764.88 58510.73 [2,] 69272.8 69410.12 68335.27 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" Warning message: In bxp(list(stats = c(57044, 60480.5, 63799.5, 75972.5, 81355, 57339, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/5anea1321387835.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] [1,] -2738.0 -3097.0 -2594.0 [2,] -1133.0 -1357.0 -1587.0 [3,] 526.5 -631.0 -183.0 [4,] 1174.0 562.5 412.5 [5,] 2228.0 2353.0 2011.0 $n [1] 20 20 19 $conf [,1] [,2] [,3] [1,] -288.5602 -1309.15693 -907.7725 [2,] 1341.5602 47.15693 541.7725 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" Warning message: In bxp(list(stats = c(-2738, -1133, 526.5, 1174, 2228, -3097, -1357, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/6p9xw1321387835.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] [,7] [,8] [,9] [1,] 73354.0 73081 75910.0 78632.0 79344.0 79669.0 72520.0 71429.0 63354.0 [2,] 73890.5 74195 76030.5 79384.5 79620.0 80512.0 73810.5 71933.5 64902.5 [3,] 74427.0 75309 76151.0 80137.0 79896.0 81355.0 75101.0 72438.0 66451.0 [4,] 75231.0 75386 76516.5 81313.5 80599.5 81841.5 76175.0 72545.5 67820.0 [5,] 76035.0 75463 76882.0 82490.0 81303.0 82328.0 77249.0 72653.0 69189.0 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 61379.0 62429 60440.0 58695 60386.0 63304 58412.0 58562.0 57858.0 57044.0 [2,] 61629.5 63167 61185.0 59024 60662.0 63398 58876.5 58643.5 58050.5 57191.5 [3,] 61880.0 63905 61930.0 59353 60938.0 63492 59341.0 58725.0 58243.0 57339.0 [4,] 62077.0 63911 63112.5 59961 61366.5 63881 60337.0 59001.0 58516.5 58384.0 [5,] 62274.0 63917 64295.0 60569 61795.0 64270 61333.0 59277.0 58790.0 59429.0 [,20] [,21] [1,] 60575.0 NA [2,] 61143.5 NA [3,] 61712.0 NA [4,] 61831.0 NA [5,] 61950.0 NA $n [1] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73204.18 74222.55 75707.66 78377.34 79002.49 80142.21 72944.07 71879.73 [2,] 75649.82 76395.45 76594.34 81896.66 80789.51 82567.79 77257.93 72996.27 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 63789.62 61471.78 63226.31 60171.71 58498.26 60295.35 63051.4 58008.71 [2,] 69112.38 62288.22 64583.69 63688.29 60207.74 61580.65 63932.6 60673.29 [,17] [,18] [,19] [,20] [,21] [1,] 58398.88 57817.91 56251.19 61084.85 NA [2,] 59051.12 58668.09 58426.81 62339.15 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" NA Warning message: In bxp(list(stats = c(73354, 73890.5, 74427, 75231, 76035, 73081, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/792ug1321387835.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,] 67167.50 63423.00 67209.00 [2,] 67345.40 63611.25 67527.44 [3,] 67523.30 63799.50 67845.88 [4,] 67566.02 63943.50 68040.19 [5,] 67608.75 64087.50 68234.50 $n [1] 3 3 3 $conf [,1] [,2] [,3] [1,] 67322.04 63496.42 67378.14 [2,] 67724.56 64102.58 68313.61 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(67167.5, 67345.4, 67523.3, 67566.025, 67608.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1uxva1321387835.ps tmp/1uxva1321387835.png",intern=TRUE)) character(0) > try(system("convert tmp/2b41v1321387835.ps tmp/2b41v1321387835.png",intern=TRUE)) character(0) > try(system("convert tmp/36f7t1321387835.ps tmp/36f7t1321387835.png",intern=TRUE)) character(0) > try(system("convert tmp/41imf1321387835.ps tmp/41imf1321387835.png",intern=TRUE)) character(0) > try(system("convert tmp/5anea1321387835.ps tmp/5anea1321387835.png",intern=TRUE)) character(0) > try(system("convert tmp/6p9xw1321387835.ps tmp/6p9xw1321387835.png",intern=TRUE)) character(0) > try(system("convert tmp/792ug1321387835.ps tmp/792ug1321387835.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.490 0.280 2.763