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(7263.63 + ,7135.88 + ,7008.00 + ,6752.38 + ,9339.00 + ,9211.13 + ,7263.63 + ,5970.38 + ,6098.13 + ,6098.13 + ,6226.00 + ,6495.50 + ,5714.75 + ,4932.75 + ,4292.38 + ,4292.38 + ,6752.38 + ,7008.00 + ,5060.50 + ,2857.38 + ,4022.88 + ,4022.88 + ,4932.75 + ,5457.88 + ,5330.00 + ,4022.88 + ,4677.13 + ,4420.25 + ,6623.38 + ,6098.13 + ,4022.88 + ,2472.75 + ,3895.00 + ,4292.38 + ,4677.13 + ,5188.38 + ,4150.63 + ,3254.75 + ,3639.50 + ,3767.25 + ,7135.88 + ,7135.88 + ,5188.38 + ,4932.75 + ,5714.75 + ,5330.00 + ,6367.75 + ,7661.00 + ,7917.88 + ,6098.13 + ,5585.63 + ,5060.50 + ,8570.88 + ,8827.75 + ,8173.50 + ,8827.75 + ,8698.63 + ,7661.00 + ,8827.75 + ,10121.00 + ,10646.13 + ,9083.38 + ,8045.63 + ,8827.75 + ,12196.25 + ,13234.00 + ,12978.38 + ,13489.50 + ,13361.75 + ,12068.50 + ,14271.63 + ,14796.75 + ,15564.88 + ,13234.00 + ,12324.13 + ,13361.75 + ,15834.38 + ,18037.50 + ,17512.38 + ,17512.38 + ,17769.25 + ,16872.00 + ,19204.25 + ,19204.25 + ,18806.88 + ,16602.50 + ,16999.88 + ,17256.75 + ,18947.38 + ,21150.50 + ,19587.63 + ,20369.75 + ,19715.50 + ,19332.00 + ,22317.25 + ,21663.00 + ,20753.13 + ,19459.88 + ,20753.13 + ,21407.38 + ,22188.13 + ,23225.75 + ,22188.13 + ,22828.50 + ,22047.63 + ,21919.88 + ,25160.63 + ,25430.13 + ,24392.50 + ,22572.88 + ,24123.00 + ,24776.00 + ,25558.00 + ,26723.50 + ,25558.00 + ,26467.88 + ,26070.50 + ,24648.13 + ,27633.25 + ,27633.25) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_meanplot.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > x <- na.omit(x) > (n <- length(x)) [1] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7263.63 5714.75 5330.00 4150.63 7917.88 10646.13 15564.88 18806.88 [2,] 7135.88 4932.75 4022.88 3254.75 6098.13 9083.38 13234.00 16602.50 [3,] 7008.00 4292.38 4677.13 3639.50 5585.63 8045.63 12324.13 16999.88 [4,] 6752.38 4292.38 4420.25 3767.25 5060.50 8827.75 13361.75 17256.75 [5,] 9339.00 6752.38 6623.38 7135.88 8570.88 12196.25 15834.38 18947.38 [6,] 9211.13 7008.00 6098.13 7135.88 8827.75 13234.00 18037.50 21150.50 [7,] 7263.63 5060.50 4022.88 5188.38 8173.50 12978.38 17512.38 19587.63 [8,] 5970.38 2857.38 2472.75 4932.75 8827.75 13489.50 17512.38 20369.75 [9,] 6098.13 4022.88 3895.00 5714.75 8698.63 13361.75 17769.25 19715.50 [10,] 6098.13 4022.88 4292.38 5330.00 7661.00 12068.50 16872.00 19332.00 [11,] 6226.00 4932.75 4677.13 6367.75 8827.75 14271.63 19204.25 22317.25 [12,] 6495.50 5457.88 5188.38 7661.00 10121.00 14796.75 19204.25 21663.00 [,9] [,10] [,11] [1,] 20753.13 24392.50 NA [2,] 19459.88 22572.88 NA [3,] 20753.13 24123.00 NA [4,] 21407.38 24776.00 NA [5,] 22188.13 25558.00 NA [6,] 23225.75 26723.50 NA [7,] 22188.13 25558.00 NA [8,] 22828.50 26467.88 NA [9,] 22047.63 26070.50 NA [10,] 21919.88 24648.13 NA [11,] 25160.63 27633.25 NA [12,] 25430.13 27633.25 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -127.75 -782.00 -1307.12 -895.88 -1819.75 -1562.75 -2330.88 -2204.38 [2,] -127.88 -640.37 654.25 384.75 -512.50 -1037.75 -909.87 397.38 [3,] -255.62 0.00 -256.88 127.75 -525.13 782.12 1037.62 256.87 [4,] 2586.62 2460.00 2203.13 3368.63 3510.38 3368.50 2472.63 1690.63 [5,] -127.87 255.62 -525.25 0.00 256.87 1037.75 2203.12 2203.12 [6,] -1947.50 -1947.50 -2075.25 -1947.50 -654.25 -255.62 -525.12 -1562.87 [7,] -1293.25 -2203.12 -1550.13 -255.63 654.25 511.12 0.00 782.12 [8,] 127.75 1165.50 1422.25 782.00 -129.12 -127.75 256.87 -654.25 [9,] 0.00 0.00 397.38 -384.75 -1037.63 -1293.25 -897.25 -383.50 [10,] 127.87 909.87 384.75 1037.75 1166.75 2203.13 2332.25 2985.25 [11,] 269.50 525.13 511.25 1293.25 1293.25 525.12 0.00 -654.25 [12,] -780.75 -127.88 -1037.75 256.88 525.13 768.13 -397.37 -909.87 [,9] [,10] [,11] [1,] -1293.25 -1819.62 NA [2,] 1293.25 1550.12 NA [3,] 654.25 653.00 NA [4,] 780.75 782.00 NA [5,] 1037.62 1165.50 NA [6,] -1037.62 -1165.50 NA [7,] 640.37 909.88 NA [8,] -780.87 -397.38 NA [9,] -127.75 -1422.37 NA [10,] 3240.75 2985.12 NA [11,] 269.50 0.00 NA [12,] -1037.63 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/1k1k01470745308.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/21n211470745308.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/3qvbw1470745308.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/40a6a1470745308.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] [1,] 4150.630 3254.75 3639.500 3767.250 6623.38 6098.13 4022.88 2472.75 [2,] 5714.750 4932.75 4677.130 4420.250 7135.88 7135.88 5188.38 4932.75 [3,] 9282.005 8109.63 7526.815 7790.065 10767.62 11222.56 10575.94 11158.62 [4,] 18806.880 16602.50 16999.880 17256.750 18947.38 21150.50 19587.63 20369.75 [5,] 24392.500 22572.88 24123.000 24776.000 25558.00 26723.50 25558.00 26467.88 [,9] [,10] [,11] [,12] [1,] 3895.00 4022.88 4677.13 5188.38 [2,] 5714.75 5330.00 6226.00 6495.50 [3,] 11030.19 9864.75 11549.69 12458.88 [4,] 19715.50 19332.00 22317.25 21663.00 [5,] 26070.50 24648.13 27633.25 27633.25 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2740.655 2278.958 1369.878 1376.438 4866.129 4220.302 3381.501 [2,] 15823.355 13940.302 13683.752 14203.692 16669.121 18224.828 17770.379 [,8] [,9] [,10] [,11] [,12] [1,] 3445.684 4034.857 2868.793 3509.86 4880.587 [2,] 18871.566 18025.523 16860.707 19589.52 20037.163 $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(4150.63, 5714.75, 9282.005, 18806.88, 24392.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5n7vt1470745308.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] [1,] -2330.880 -1037.750 -525.13 780.750 -525.250 -2075.250 -2203.12 -780.87 [2,] -1819.750 -640.370 -255.62 1690.630 0.000 -1947.500 -1293.25 -397.38 [3,] -1434.935 128.435 192.31 2466.315 647.245 -1364.185 255.56 0.00 [4,] -895.880 654.250 654.25 3368.500 1165.500 -654.250 654.25 782.00 [5,] -127.750 1550.120 1037.62 3510.380 2203.120 -255.620 909.88 1422.25 [,9] [,10] [,11] [,12] [1,] -1422.370 127.87 -654.250 -1037.75 [2,] -1037.630 909.87 0.000 -909.87 [3,] -384.125 1684.94 390.375 -397.37 [4,] 0.000 2985.12 525.130 256.88 [5,] 397.380 3240.75 1293.250 768.13 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1896.5373 -518.4088 -262.2973 1627.984 64.91473 -2010.3443 -717.4886 [2,] -973.3327 775.2788 646.9173 3304.646 1229.57527 -718.0257 1228.6086 [,8] [,9] [,10] [,11] [,12] [1,] -589.2653 -902.5663 648.0624 127.9991 -1011.8583 [2,] 589.2653 134.3163 2721.8176 652.7509 217.1183 $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(-2330.88, -1819.75, -1434.935, -895.88, -127.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69u6u1470745308.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] [1,] 5970.380 2857.380 2472.75 3254.750 5060.500 8045.630 12324.13 16602.50 [2,] 6162.065 4157.630 4022.88 3958.940 6879.565 9864.755 14463.31 18031.82 [3,] 6880.190 4932.750 4548.69 5259.190 8372.190 12587.315 17192.19 19459.82 [4,] 7263.630 5586.315 5259.19 6751.815 8827.750 13425.625 17903.38 20760.12 [5,] 7263.630 7008.000 6623.38 7661.000 10121.000 14796.750 19204.25 22317.25 [,9] [,10] [,11] [1,] 19459.88 22572.88 NA [2,] 21080.26 24520.32 NA [3,] 22117.88 25558.00 NA [4,] 23027.12 26595.69 NA [5,] 25430.13 27633.25 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6377.759 4281.117 3984.801 3985.341 7483.61 10963.18 15623.16 18215.41 [2,] 7382.621 5584.383 5112.579 6533.039 9260.77 14211.45 18761.22 20704.22 [,9] [,10] [,11] [1,] 21229.90 24611.41 NA [2,] 23005.86 26504.59 NA $out [1] 9339.00 9211.13 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(5970.38, 6162.065, 6880.19, 7263.63, 7263.63, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/76ym61470745308.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,] 10639.70 7526.815 10367.60 [2,] 11523.14 8695.817 11270.71 [3,] 12656.15 10671.782 12405.89 [4,] 13638.20 11190.595 13366.05 [5,] 14365.11 12458.875 13965.55 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 11691.46 9533.898 11450.19 [2,] 13620.85 11809.667 13361.59 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(10639.703, 11523.14, 12656.152, 13638.2025, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1k1k01470745308.ps tmp/1k1k01470745308.png",intern=TRUE)) character(0) > try(system("convert tmp/21n211470745308.ps tmp/21n211470745308.png",intern=TRUE)) character(0) > try(system("convert tmp/3qvbw1470745308.ps tmp/3qvbw1470745308.png",intern=TRUE)) character(0) > try(system("convert tmp/40a6a1470745308.ps tmp/40a6a1470745308.png",intern=TRUE)) character(0) > try(system("convert tmp/5n7vt1470745308.ps tmp/5n7vt1470745308.png",intern=TRUE)) character(0) > try(system("convert tmp/69u6u1470745308.ps tmp/69u6u1470745308.png",intern=TRUE)) character(0) > try(system("convert tmp/76ym61470745308.ps tmp/76ym61470745308.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.512 0.215 2.771