R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 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(17887,17118,15945,15085,14027,15158,23783,25166,21839,18522,16850,16679,17806,17542,16380,15434,14478,15506,22357,27204,24182,20760,18731,18377,18775,18943,17974,17192,1604,17101,25972,28139,26131,22600,20320,19662,20440,19694,18260,16832,15539,16676,25216,26994,24865,21793,19505,18696,19221,18742,17633,16379,15007,15762,24146,25720,23731,20542,18807,18459) > 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] 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,] 17887 17806 18775 20440 19221 NA [2,] 17118 17542 18943 19694 18742 NA [3,] 15945 16380 17974 18260 17633 NA [4,] 15085 15434 17192 16832 16379 NA [5,] 14027 14478 1604 15539 15007 NA [6,] 15158 15506 17101 16676 15762 NA [7,] 23783 22357 25972 25216 24146 NA [8,] 25166 27204 28139 26994 25720 NA [9,] 21839 24182 26131 24865 23731 NA [10,] 18522 20760 22600 21793 20542 NA [11,] 16850 18731 20320 19505 18807 NA [12,] 16679 18377 19662 18696 18459 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -769 -264 168 -746 -479 NA [2,] -1173 -1162 -969 -1434 -1109 NA [3,] -860 -946 -782 -1428 -1254 NA [4,] -1058 -956 -15588 -1293 -1372 NA [5,] 1131 1028 15497 1137 755 NA [6,] 8625 6851 8871 8540 8384 NA [7,] 1383 4847 2167 1778 1574 NA [8,] -3327 -3022 -2008 -2129 -1989 NA [9,] -3317 -3422 -3531 -3072 -3189 NA [10,] -1672 -2029 -2280 -2288 -1735 NA [11,] -171 -354 -658 -809 -348 NA [12,] 1127 398 778 525 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/1twll1457200454.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/2vj3z1457200454.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/385ai1457200454.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/44bw81457200454.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,] 17806 17118 15945 15085 14027 15158 22357 25166 23731 20542 18731 18377 [2,] 17887 17542 16380 15434 14027 15506 23783 25720 23731 20542 18731 18377 [3,] 18775 18742 17633 16379 14478 15762 24146 26994 24182 20760 18807 18459 [4,] 19221 18943 17974 16832 15007 16676 25216 27204 24865 21793 19505 18696 [5,] 20440 19694 18260 17192 15539 17101 25972 28139 26131 22600 20320 18696 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 17832.4 17752.06 16506.68 15391.18 13785.53 14935.28 23133.45 25945.41 [2,] 19717.6 19731.94 18759.32 17366.82 15170.47 16588.72 25158.55 28042.59 [,9] [,10] [,11] [,12] [1,] 23380.72 19876.05 18260.09 18233.6 [2,] 24983.28 21643.95 19353.91 18684.4 $out [1] 1604 21839 18522 16850 16679 19662 $group [1] 5 9 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(17806, 17887, 18775, 19221, 20440, 17118, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5030q1457200454.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,] -769 -1173 -1428 -1372 1028 8384 1383 -3327 -3531 -2288 -809 398.0 [2,] -746 -1173 -1254 -1372 1028 8384 1574 -3022 -3422 -2280 -658 461.5 [3,] -479 -1162 -946 -1293 1131 8540 1778 -2129 -3317 -2029 -354 651.5 [4,] -264 -1109 -860 -1058 1137 8625 2167 -2008 -3189 -1735 -348 952.5 [5,] 168 -1109 -782 -956 1137 8871 2167 -1989 -3072 -1672 -171 1127.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -819.58 -1207.222 -1224.3994 -1514.872 1053.981 8369.71 1358.988 -2845.49 [2,] -138.42 -1116.778 -667.6006 -1071.128 1208.019 8710.29 2197.012 -1412.51 [,9] [,10] [,11] [,12] [1,] -3481.637 -2414.096 -573.0452 263.61 [2,] -3152.363 -1643.904 -134.9548 1039.39 $out [1] -969 -1434 -15588 15497 755 6851 4847 $group [1] 2 2 4 5 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-769, -746, -479, -264, 168, -1173, -1173, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6sa1u1457200454.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,] 14027.0 14478.0 17101.0 15539.0 15007.0 NA [2,] 15551.5 15943.0 17583.0 17546.0 17006.0 NA [3,] 16984.0 18091.5 19302.5 19599.5 18774.5 NA [4,] 20180.5 21558.5 24286.0 23329.0 22136.5 NA [5,] 25166.0 27204.0 28139.0 26994.0 25720.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 14872.68 15530.23 16245.22 16961.83 16434.44 NA [2,] 19095.32 20652.77 22359.78 22237.17 21114.56 NA $out [1] 1604 $group [1] 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(14027, 15551.5, 16984, 20180.5, 25166, 14478, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79icc1457200454.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,] 12131.0 14478.0 14517.00 [2,] 16711.4 17006.0 16655.00 [3,] 18616.8 18758.5 18545.25 [4,] 22496.5 22453.0 22732.75 [5,] 26644.6 26994.0 26462.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 15978.18 16274.09 15773.15 [2,] 21255.42 21242.91 21317.35 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(12131, 16711.4, 18616.8, 22496.5, 26644.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1twll1457200454.ps tmp/1twll1457200454.png",intern=TRUE)) character(0) > try(system("convert tmp/2vj3z1457200454.ps tmp/2vj3z1457200454.png",intern=TRUE)) character(0) > try(system("convert tmp/385ai1457200454.ps tmp/385ai1457200454.png",intern=TRUE)) character(0) > try(system("convert tmp/44bw81457200454.ps tmp/44bw81457200454.png",intern=TRUE)) character(0) > try(system("convert tmp/5030q1457200454.ps tmp/5030q1457200454.png",intern=TRUE)) character(0) > try(system("convert tmp/6sa1u1457200454.ps tmp/6sa1u1457200454.png",intern=TRUE)) character(0) > try(system("convert tmp/79icc1457200454.ps tmp/79icc1457200454.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.395 0.412 2.827