R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(5400,5200,5500,4400,5700,5600,6000,6200,6900,6000,5700,7100,6000,4500,5300,4000,5600,4600,6100,5500,5800,6500,6400,7600,5500,4600,5100,3700,5300,4100,5800,5500,4900,7000,6300,7200,5400,5000,4500,3700,4900,4400,6000,5800,5000,6700,6200,8000,6400,3900,3900,3900,4600,4600,6200,5700,5100,6400,5900,8500,6700,3900,4100,3400,4700,5400,6800,6700,5400,6300,5600,8000,6100,4900,4400,3300,4900,5900,6900,6500,4800,6900,5400,8300,6900,5000,4600,3100,4900,4700,7100,7100,5400,7000,5200,8100,6900,5100,3900,2700,5300,5100,6700,7700,5700,6400,4800,8300) > par1 = '12' > par1 <- as.numeric(par1) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 5400 6000 5500 5400 6400 6700 6100 6900 6900 NA [2,] 5200 4500 4600 5000 3900 3900 4900 5000 5100 NA [3,] 5500 5300 5100 4500 3900 4100 4400 4600 3900 NA [4,] 4400 4000 3700 3700 3900 3400 3300 3100 2700 NA [5,] 5700 5600 5300 4900 4600 4700 4900 4900 5300 NA [6,] 5600 4600 4100 4400 4600 5400 5900 4700 5100 NA [7,] 6000 6100 5800 6000 6200 6800 6900 7100 6700 NA [8,] 6200 5500 5500 5800 5700 6700 6500 7100 7700 NA [9,] 6900 5800 4900 5000 5100 5400 4800 5400 5700 NA [10,] 6000 6500 7000 6700 6400 6300 6900 7000 6400 NA [11,] 5700 6400 6300 6200 5900 5600 5400 5200 4800 NA [12,] 7100 7600 7200 8000 8500 8000 8300 8100 8300 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -200 -1500 -900 -400 -2500 -2800 -1200 -1900 -1800 NA [2,] 300 800 500 -500 0 200 -500 -400 -1200 NA [3,] -1100 -1300 -1400 -800 0 -700 -1100 -1500 -1200 NA [4,] 1300 1600 1600 1200 700 1300 1600 1800 2600 NA [5,] -100 -1000 -1200 -500 0 700 1000 -200 -200 NA [6,] 400 1500 1700 1600 1600 1400 1000 2400 1600 NA [7,] 200 -600 -300 -200 -500 -100 -400 0 1000 NA [8,] 700 300 -600 -800 -600 -1300 -1700 -1700 -2000 NA [9,] -900 700 2100 1700 1300 900 2100 1600 700 NA [10,] -300 -100 -700 -500 -500 -700 -1500 -1800 -1600 NA [11,] 1400 1200 900 1800 2600 2400 2900 2900 3500 NA [12,] -1100 -2100 -1800 -1600 -1800 -1900 -1400 -1200 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/1dz3g1470657741.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/2cxti1470657741.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/3i94s1470657741.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/4q3i81470657741.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] [,12] [1,] 5400 3900 3900 2700 4600 4100 5800 5500 4800 6000 4800 7100 [2,] 5500 4500 4100 3300 4900 4600 6000 5700 5000 6400 5400 7600 [3,] 6100 4900 4500 3700 4900 4700 6200 6200 5400 6500 5700 8000 [4,] 6700 5000 5100 3900 5300 5400 6800 6700 5700 6900 6200 8300 [5,] 6900 5200 5500 4400 5700 5900 7100 7700 5800 7000 6400 8500 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 5468 4636.667 3973.333 3384 4689.333 4278.667 5778.667 5673.333 5031.333 [2,] 6732 5163.333 5026.667 4016 5110.667 5121.333 6621.333 6726.667 5768.667 [,10] [,11] [,12] [1,] 6236.667 5278.667 7631.333 [2,] 6763.333 6121.333 8368.667 $out [1] 6900 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(5400, 5500, 6100, 6700, 6900, 3900, 4500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51dnf1470657741.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,] -2800 -1200 -1500 1200 -1200 1400 -600 -2000 700 -1800 900 -2100 [2,] -1900 -500 -1300 1300 -500 1400 -400 -1700 700 -1500 1400 -1850 [3,] -1500 0 -1100 1600 -200 1600 -200 -800 1300 -700 2400 -1700 [4,] -900 300 -800 1600 0 1600 0 -600 1700 -500 2900 -1300 [5,] -200 800 -700 1800 700 1700 200 700 2100 -100 3500 -1100 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2026.6667 -421.3333 -1363.3333 1442 -463.33333 1494.667 -410.66667 [2,] -973.3333 421.3333 -836.6667 1758 63.33333 1705.333 10.66667 [,8] [,9] [,10] [,11] [,12] [1,] -1379.3333 773.3333 -1226.6667 1610 -2007.238 [2,] -220.6667 1826.6667 -173.3333 3190 -1392.762 $out [1] 0 700 2600 1000 400 1000 2400 1000 -900 $group [1] 3 4 4 5 6 6 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2800, -1900, -1500, -900, -200, -1200, -500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6blqe1470657741.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] [,10] [1,] 5200 4000 3700 3700 3900 3400 3300 3100 2700 NA [2,] 5450 4950 4750 4700 4250 4400 4850 4800 4950 NA [3,] 5700 5700 5400 5200 5400 5500 5650 5300 5500 NA [4,] 6100 6250 6050 6100 6300 6700 6700 7050 6800 NA [5,] 6900 7600 7200 8000 8500 8000 8300 8100 8300 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5403.531 5107.061 4807.061 4561.451 4464.981 4450.955 4806.203 4273.76 [2,] 5996.469 6292.939 5992.939 5838.549 6335.019 6549.045 6493.797 6326.24 [,9] [,10] [1,] 4656.203 NA [2,] 6343.797 NA $out [1] 4400 7100 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(5200, 5450, 5700, 6100, 6900, 4000, 4950, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lmm41470657741.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,] 3577.778 3700 3600 [2,] 4805.556 4800 4875 [3,] 5583.333 5550 5575 [4,] 6350.000 6200 6300 [5,] 7900.000 8000 7950 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4878.902 4911.451 4925.048 [2,] 6287.765 6188.549 6224.952 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1dz3g1470657741.ps tmp/1dz3g1470657741.png",intern=TRUE)) character(0) > try(system("convert tmp/2cxti1470657741.ps tmp/2cxti1470657741.png",intern=TRUE)) character(0) > try(system("convert tmp/3i94s1470657741.ps tmp/3i94s1470657741.png",intern=TRUE)) character(0) > try(system("convert tmp/4q3i81470657741.ps tmp/4q3i81470657741.png",intern=TRUE)) character(0) > try(system("convert tmp/51dnf1470657741.ps tmp/51dnf1470657741.png",intern=TRUE)) character(0) > try(system("convert tmp/6blqe1470657741.ps tmp/6blqe1470657741.png",intern=TRUE)) character(0) > try(system("convert tmp/7lmm41470657741.ps tmp/7lmm41470657741.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.425 0.166 2.631