R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(45.3,49.9,53.8,55.1,52.9,53.5,53.8,52,48.2,45.5,45.7,52.5,52.3,54.8,54.7,54.9,54.9,64.2,66.4,69.1,68.3,77.3,89.6,93,96.1,131.3,125.3,126,138.3,163,182.5,164.6,148.8,109.3,93.5,80.2,84,75.5,62.4,64.2,64.7,71,73.7,72.6,68.1,72.3,78.5,81.9,97.8,93.1,94.2,101.1,101,99.7,97.1,91.7,95,98.9,109,121.9,131.5,128.5,128.4,126.4,123.1,123,123.3,123.6,124.9,120.4,114.9,113.4) > par1 = '12' > par1 <- as.numeric(par1) > (n <- length(x)) [1] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 45.3 52.3 96.1 84.0 97.8 131.5 NA [2,] 49.9 54.8 131.3 75.5 93.1 128.5 NA [3,] 53.8 54.7 125.3 62.4 94.2 128.4 NA [4,] 55.1 54.9 126.0 64.2 101.1 126.4 NA [5,] 52.9 54.9 138.3 64.7 101.0 123.1 NA [6,] 53.5 64.2 163.0 71.0 99.7 123.0 NA [7,] 53.8 66.4 182.5 73.7 97.1 123.3 NA [8,] 52.0 69.1 164.6 72.6 91.7 123.6 NA [9,] 48.2 68.3 148.8 68.1 95.0 124.9 NA [10,] 45.5 77.3 109.3 72.3 98.9 120.4 NA [11,] 45.7 89.6 93.5 78.5 109.0 114.9 NA [12,] 52.5 93.0 80.2 81.9 121.9 113.4 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4.6 2.5 35.2 -8.5 -4.7 -3.0 NA [2,] 3.9 -0.1 -6.0 -13.1 1.1 -0.1 NA [3,] 1.3 0.2 0.7 1.8 6.9 -2.0 NA [4,] -2.2 0.0 12.3 0.5 -0.1 -3.3 NA [5,] 0.6 9.3 24.7 6.3 -1.3 -0.1 NA [6,] 0.3 2.2 19.5 2.7 -2.6 0.3 NA [7,] -1.8 2.7 -17.9 -1.1 -5.4 0.3 NA [8,] -3.8 -0.8 -15.8 -4.5 3.3 1.3 NA [9,] -2.7 9.0 -39.5 4.2 3.9 -4.5 NA [10,] 0.2 12.3 -15.8 6.2 10.1 -5.5 NA [11,] 6.8 3.4 -13.3 3.4 12.9 -1.5 NA [12,] -0.2 3.1 3.8 15.9 9.6 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/1vsn81356876889.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/2g39v1356876889.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/3f2n71356876889.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/4c1nm1356876889.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] [,11] [1,] 45.30 49.9 53.8 54.90 52.90 53.50 53.8 52.00 48.20 45.5 45.70 [2,] 52.30 54.8 54.7 55.10 54.90 64.20 66.4 69.10 68.10 72.3 78.50 [3,] 90.05 84.3 78.3 82.65 82.85 85.35 85.4 82.15 81.65 88.1 91.55 [4,] 97.80 128.5 125.3 126.00 123.10 123.00 123.3 123.60 124.90 109.3 109.00 [5,] 131.50 131.3 128.4 126.40 138.30 163.00 182.5 164.60 148.80 120.4 114.90 [,12] [1,] 52.50 [2,] 80.20 [3,] 87.45 [4,] 113.40 [5,] 121.90 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 60.70103 36.76112 32.76072 36.91721 38.8588 47.4221 48.69766 [2,] 119.39897 131.83888 123.83928 128.38279 126.8412 123.2779 122.10234 [,8] [,9] [,10] [,11] [,12] [1,] 46.99574 45.01217 64.2338 71.87651 66.03493 [2,] 117.30426 118.28783 111.9662 111.22349 108.86507 $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(45.3, 52.3, 90.05, 97.8, 131.5, 49.9, 54.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vysg1356876889.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,] -8.50 -13.1 -2.0 -3.30 -1.30 -2.60 -5.40 -4.5 -4.5 -15.8 -13.3 -0.2 [2,] -4.70 -6.0 0.2 -2.20 -0.10 0.30 -5.40 -4.5 -4.5 -5.5 -1.5 3.1 [3,] -0.25 -0.1 1.0 -0.05 3.45 1.25 -1.45 -2.3 0.6 3.2 3.4 3.8 [4,] 4.60 1.1 1.8 0.50 9.30 2.70 0.30 1.3 4.2 10.1 6.8 9.6 [5,] 4.60 3.9 1.8 0.50 9.30 2.70 2.70 3.3 9.0 12.3 12.9 15.9 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -6.2488 -4.679729 -0.03205168 -1.791587 -2.613304 -0.2980775 -5.126684 [2,] 5.7488 4.479729 2.03205168 1.691587 9.513304 2.7980775 2.226684 [,8] [,9] [,10] [,11] [,12] [1,] -6.041187 -5.011781 -6.862504 -1.953768 -0.7928836 [2,] 1.441187 6.211781 13.262504 8.753768 8.3928836 $out [1] 35.2 6.9 12.3 24.7 19.5 -17.9 -15.8 -39.5 $group [1] 1 3 4 5 6 7 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-8.5, -4.7, -0.25, 4.6, 4.6, -13.1, -6.00000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ibo81356876889.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] [1,] 45.30 52.30 80.20 62.40 91.70 113.40 NA [2,] 46.95 54.85 102.70 66.40 94.60 121.70 NA [3,] 52.25 65.30 128.65 72.45 98.35 123.45 NA [4,] 53.65 73.20 155.90 77.00 101.05 127.40 NA [5,] 55.10 93.00 182.50 84.00 109.00 131.50 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 49.19409 56.93044 104.3851 67.61527 95.40811 120.8502 NA [2,] 55.30591 73.66956 152.9149 77.28473 101.29189 126.0498 NA $out [1] 121.9 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(45.3, 46.95, 52.25, 53.65, 55.1, 52.3, 54.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7e3601356876889.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,] 84.50000 78.300 87.07500 [2,] 87.61667 82.400 88.01875 [3,] 89.00000 84.825 90.83125 [4,] 93.90833 87.775 92.79375 [5,] 99.46667 91.550 94.46250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 86.13033 82.37343 88.65334 [2,] 91.86967 87.27657 93.00916 $out [1] 78.8 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(84.5, 87.6166666666667, 89, 93.9083333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vsn81356876889.ps tmp/1vsn81356876889.png",intern=TRUE)) character(0) > try(system("convert tmp/2g39v1356876889.ps tmp/2g39v1356876889.png",intern=TRUE)) character(0) > try(system("convert tmp/3f2n71356876889.ps tmp/3f2n71356876889.png",intern=TRUE)) character(0) > try(system("convert tmp/4c1nm1356876889.ps tmp/4c1nm1356876889.png",intern=TRUE)) character(0) > try(system("convert tmp/5vysg1356876889.ps tmp/5vysg1356876889.png",intern=TRUE)) character(0) > try(system("convert tmp/6ibo81356876889.ps tmp/6ibo81356876889.png",intern=TRUE)) character(0) > try(system("convert tmp/7e3601356876889.ps tmp/7e3601356876889.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.462 0.563 4.050