R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(28100,27900,28078,28479,28156,29219,28782,27078,30031,29579,26532,23995,22067,21818,23787,21551,21309,22395,22906,21430,23492,24144,24438,24689,24569,23754,28473,27051,27081,29635,27715,26373,28009,29472,30005,29777,28886,28549,33348,29017,30924,30435,29431,30290,31286,30622,31742,30391,30740,32086,33947,31312,33239,32362,32170,32665,31412,34891,33919,30706,32846,31368,33130,31665,33139,32201,32230,30287,31918,33853,32232,31484,31902,30260,32823,32018,32100,31952,33274,29491,32751,33643,31226,30976) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (n <- length(x)) [1] 84 > (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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 28100 22067 24569 28886 30740 32846 31902 NA [2,] 27900 21818 23754 28549 32086 31368 30260 NA [3,] 28078 23787 28473 33348 33947 33130 32823 NA [4,] 28479 21551 27051 29017 31312 31665 32018 NA [5,] 28156 21309 27081 30924 33239 33139 32100 NA [6,] 29219 22395 29635 30435 32362 32201 31952 NA [7,] 28782 22906 27715 29431 32170 32230 33274 NA [8,] 27078 21430 26373 30290 32665 30287 29491 NA [9,] 30031 23492 28009 31286 31412 31918 32751 NA [10,] 29579 24144 29472 30622 34891 33853 33643 NA [11,] 26532 24438 30005 31742 33919 32232 31226 NA [12,] 23995 24689 29777 30391 30706 31484 30976 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -200 -249 -815 -337 1346 -1478 -1642 NA [2,] 178 1969 4719 4799 1861 1762 2563 NA [3,] 401 -2236 -1422 -4331 -2635 -1465 -805 NA [4,] -323 -242 30 1907 1927 1474 82 NA [5,] 1063 1086 2554 -489 -877 -938 -148 NA [6,] -437 511 -1920 -1004 -192 29 1322 NA [7,] -1704 -1476 -1342 859 495 -1943 -3783 NA [8,] 2953 2062 1636 996 -1253 1631 3260 NA [9,] -452 652 1463 -664 3479 1935 892 NA [10,] -3047 294 533 1120 -972 -1621 -2417 NA [11,] -2537 251 -228 -1351 -3213 -748 -250 NA [12,] -1928 -120 -891 349 2140 418 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/1izws1445003784.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/28pal1445003784.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/3edmn1445003784.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/4iekk1445003784.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] [1,] 22067.0 21818 23787.0 27051.0 21309.0 29219.0 22906.0 21430.0 28009 [2,] 26334.5 25827 28275.5 27765.0 27618.5 29427.0 28248.5 26725.5 29020 [3,] 28886.0 28549 32823.0 29017.0 30924.0 30435.0 29431.0 29491.0 31286 [4,] 31321.0 30814 33239.0 31488.5 32619.5 32076.5 32200.0 30288.5 31665 [5,] 32846.0 32086 33947.0 32018.0 33239.0 32362.0 33274.0 32665.0 32751 [,10] [,11] [,12] [1,] 24144.0 24438.0 23995 [2,] 29525.5 28268.5 27233 [3,] 30622.0 31226.0 30391 [4,] 33748.0 31987.0 30841 [5,] 34891.0 33919.0 31484 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 25908.14 25570.84 29858.88 26793.39 27937.48 28852.76 27071.23 27363.23 [2,] 31863.86 31527.16 35787.12 31240.61 33910.52 32017.24 31790.77 31618.77 [,9] [,10] [,11] [,12] [1,] 29706.45 28100.39 29005.37 28236.36 [2,] 32865.55 33143.61 33446.63 32545.64 $out [1] 21551 22395 23492 $group [1] 4 6 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(22067, 26334.5, 28886, 31321, 32846, 21818, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59n6r1445003784.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] [1,] -1642.0 178.0 -4331.0 -323.0 -938.0 -1920.0 -3783.0 996.0 -664 -3047.0 [2,] -1146.5 1811.5 -2435.5 -106.0 -683.0 -720.5 -1823.5 1313.5 100 -2019.0 [3,] -337.0 1969.0 -1465.0 82.0 -148.0 -192.0 -1476.0 1636.0 892 -972.0 [4,] -224.5 3641.0 -1113.5 1690.5 1074.5 270.0 -423.5 2507.5 1699 413.5 [5,] -200.0 4799.0 401.0 1927.0 2554.0 1322.0 859.0 3260.0 3479 1120.0 [,11] [,12] [1,] -3213 -1928.0 [2,] -1944 -891.0 [3,] -748 114.5 [4,] -239 418.0 [5,] 251 2140.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -887.6035 876.4521 -2254.4771 -990.8408 -1197.5506 -783.5106 -2312.0574 [2,] 213.6035 3061.5479 -675.5229 1154.8408 901.5506 399.5106 -639.9426 [,8] [,9] [,10] [,11] [,12] [1,] 922.9625 -62.897 -2424.6498 -1766.1985 -729.8473 [2,] 2349.0375 1846.897 480.6498 270.1985 958.8473 $out [1] 1346 -1253 $group [1] 1 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1642, -1146.5, -337, -224.5, -200, 178, 1811.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rftm1445003784.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,] 26532.0 21309.0 23754.0 28549 30706 30287.0 29491 NA [2,] 27489.0 21684.5 26712.0 29224 31362 31574.5 31101 NA [3,] 28128.0 22650.5 27862.0 30413 32266 32215.5 31985 NA [4,] 29000.5 23965.5 29553.5 31105 33579 32988.0 32787 NA [5,] 30031.0 24689.0 30005.0 33348 34891 33853.0 33643 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 27438.59 21610.12 26565.97 29555.06 31254.81 31570.79 31216 NA [2,] 28817.41 23690.88 29158.03 31270.94 33277.19 32860.21 32754 NA $out [1] 23995 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(26532, 27489, 28128, 29000.5, 30031, 21309, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7pme71445003784.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,] 27962.14 28549 28320.50 [2,] 28585.93 29224 28932.38 [3,] 29461.14 30413 30123.38 [4,] 29928.07 31075 30547.12 [5,] 30886.29 32823 31636.75 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 28848.98 29568.75 29386.88 [2,] 30073.30 31257.25 30859.87 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(27962.1428571429, 28585.9285714286, 29461.1428571429, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1izws1445003784.ps tmp/1izws1445003784.png",intern=TRUE)) character(0) > try(system("convert tmp/28pal1445003784.ps tmp/28pal1445003784.png",intern=TRUE)) character(0) > try(system("convert tmp/3edmn1445003784.ps tmp/3edmn1445003784.png",intern=TRUE)) character(0) > try(system("convert tmp/4iekk1445003784.ps tmp/4iekk1445003784.png",intern=TRUE)) character(0) > try(system("convert tmp/59n6r1445003784.ps tmp/59n6r1445003784.png",intern=TRUE)) character(0) > try(system("convert tmp/6rftm1445003784.ps tmp/6rftm1445003784.png",intern=TRUE)) character(0) > try(system("convert tmp/7pme71445003784.ps tmp/7pme71445003784.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.522 0.466 3.013