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(16489042,16495231,16501683,16506782,16513615,16520661,16528400,16538542,16554596,16562317,16568499,16574989,16578604,16585167,16588947,16593973,16599333,16606135,16611675,16624215,16638805,16648268,16654119,16655799,16661142,16669012,16673931,16676905,16681513,16686550,16690580,16703472,16719078,16725328,16729674,16730348,16731280,16735690,16737631,16739764,16742830,16744696,16746558,16758167,16772610,16778726,16781377,16779575,16781367,16783870,16784986,16785783,16788992,16792122,16795289,16805879,16820076,16825762,16829252,16829289,16833919,16840299,16844980,16849473,16853737,16857811,16859859,16870851,16887455,16895020,16900158,16900726,16903174,16907715,16910467,16913766,16917152,16922460,16924725,16937725,16957605,16967706,16976281,16980049,16980049) > 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] 85 > (np <- floor(n / par1)) [1] 7 > 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] 8 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16489042 16578604 16661142 16731280 16781367 16833919 16903174 16980049 [2,] 16495231 16585167 16669012 16735690 16783870 16840299 16907715 NA [3,] 16501683 16588947 16673931 16737631 16784986 16844980 16910467 NA [4,] 16506782 16593973 16676905 16739764 16785783 16849473 16913766 NA [5,] 16513615 16599333 16681513 16742830 16788992 16853737 16917152 NA [6,] 16520661 16606135 16686550 16744696 16792122 16857811 16922460 NA [7,] 16528400 16611675 16690580 16746558 16795289 16859859 16924725 NA [8,] 16538542 16624215 16703472 16758167 16805879 16870851 16937725 NA [9,] 16554596 16638805 16719078 16772610 16820076 16887455 16957605 NA [10,] 16562317 16648268 16725328 16778726 16825762 16895020 16967706 NA [11,] 16568499 16654119 16729674 16781377 16829252 16900158 16976281 NA [12,] 16574989 16655799 16730348 16779575 16829289 16900726 16980049 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6189 6563 7870 4410 2503 6380 4541 NA [2,] 6452 3780 4919 1941 1116 4681 2752 NA [3,] 5099 5026 2974 2133 797 4493 3299 NA [4,] 6833 5360 4608 3066 3209 4264 3386 NA [5,] 7046 6802 5037 1866 3130 4074 5308 NA [6,] 7739 5540 4030 1862 3167 2048 2265 NA [7,] 10142 12540 12892 11609 10590 10992 13000 NA [8,] 16054 14590 15606 14443 14197 16604 19880 NA [9,] 7721 9463 6250 6116 5686 7565 10101 NA [10,] 6182 5851 4346 2651 3490 5138 8575 NA [11,] 6490 1680 674 -1802 37 568 3768 NA [12,] 3615 5343 932 1792 4630 2448 0 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/1anqe1457198338.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/2lbzt1457198338.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/348vd1457198338.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/4wqmj1457198338.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,] 16489042 16495231 16501683 16506782 16513615 16520661 16528400 16538542 [2,] 16619873 16627090 16631439 16635439 16640423 16646342 16651128 16663844 [3,] 16756324 16735690 16737631 16739764 16742830 16744696 16746558 16758167 [4,] 16868546 16812084 16814983 16817628 16821364 16824966 16827574 16838365 [5,] 16980049 16907715 16910467 16913766 16917152 16922460 16924725 16937725 [,9] [,10] [,11] [,12] [1,] 16554596 16562317 16568499 16574989 [2,] 16678942 16686798 16691896 16693074 [3,] 16772610 16778726 16781377 16779575 [4,] 16853766 16860391 16864705 16865008 [5,] 16957605 16967706 16976281 16980049 $n [1] 8 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16617411 16625214 16628021 16630964 16634775 16638025 16641187 16653946 [2,] 16895236 16846166 16847241 16848564 16850885 16851367 16851929 16862388 [,9] [,10] [,11] [,12] [1,] 16668208 16675059 16678179 16676899 [2,] 16877012 16882393 16884575 16882251 $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(16489042, 16619873, 16756323.5, 16868546.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55gph1457198338.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] [1,] 2503.0 1116.0 797.0 3066.0 1866 1862.0 10142 14197.0 5686 2651.0 -1802.0 [2,] 4475.5 2346.5 2553.5 3297.5 3602 2156.5 10791 14516.5 6183 3918.0 302.5 [3,] 6189.0 3780.0 3299.0 4264.0 5037 3167.0 11609 15606.0 7565 5138.0 674.0 [4,] 6471.5 4800.0 4759.5 4984.0 6055 4785.0 12716 16329.0 8592 6016.5 2724.0 [5,] 7870.0 6452.0 5099.0 6833.0 7046 7739.0 13000 16604.0 10101 8575.0 3768.0 [,12] [1,] 0.0 [2,] 1362.0 [3,] 2448.0 [4,] 4122.5 [5,] 5343.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 4997.021 2314.809 1981.612 3256.849 3572.108 1597.302 10459.42 14523.6 [2,] 7380.979 5245.191 4616.388 5271.151 6501.892 4736.698 12758.58 16688.4 [,9] [,10] [,11] [,12] [1,] 6126.384 3884.81 -772.0807 799.4739 [2,] 9003.616 6391.19 2120.0807 4096.5261 $out [1] 19880 6490 $group [1] 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2503, 4475.5, 6189, 6471.5, 7870, 1116, 2346.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ii5v1457198338.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,] 16489042 16578604 16661142 16731280 16781367 16833919 16903174 16980049 [2,] 16504232 16591460 16675418 16738698 16785384 16847226 16912116 16980049 [3,] 16524530 16608905 16688565 16745627 16793706 16858835 16923592 16980049 [4,] 16558456 16643536 16722203 16775668 16822919 16891238 16962656 16980049 [5,] 16574989 16655799 16730348 16781377 16829289 16900726 16980049 16980049 $n [1] 12 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16499799 16585153 16667226 16728765 16776586 16838761 16900541 16980049 [2,] 16549262 16632657 16709904 16762489 16810825 16878909 16946644 16980049 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(16489042, 16504232.5, 16524530.5, 16558456.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/76bh51457198338.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,] 16716712 16735690 16719587 [2,] 16725973 16741297 16728714 [3,] 16740774 16751441 16742610 [4,] 16768097 16775668 16769974 [5,] 16778682 16781377 16779040 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 16721561 16735764 16723791 [2,] 16759987 16767118 16761430 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16716712, 16725972.7142857, 16740774.3482143, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1anqe1457198338.ps tmp/1anqe1457198338.png",intern=TRUE)) character(0) > try(system("convert tmp/2lbzt1457198338.ps tmp/2lbzt1457198338.png",intern=TRUE)) character(0) > try(system("convert tmp/348vd1457198338.ps tmp/348vd1457198338.png",intern=TRUE)) character(0) > try(system("convert tmp/4wqmj1457198338.ps tmp/4wqmj1457198338.png",intern=TRUE)) character(0) > try(system("convert tmp/55gph1457198338.ps tmp/55gph1457198338.png",intern=TRUE)) character(0) > try(system("convert tmp/6ii5v1457198338.ps tmp/6ii5v1457198338.png",intern=TRUE)) character(0) > try(system("convert tmp/76bh51457198338.ps tmp/76bh51457198338.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.569 0.375 2.976