R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(58552,54955,65540,51570,51145,46641,35704,33253,35193,41668,34865,21210,56126,49231,59723,48103,47472,50497,40059,34149,36860,46356,36577,23872,57276,56389,57657,62300,48929,51168,39636,33213,38127,43291,30600,21956,48033,46148,50736,48114,38390,44112,36287,30333,35908,40005,35263,26591,49709,47840,64781,57802,48154,54353,39737,37732,37163,43782,40649,29412,53597,53588,64172,53955,55509,48908,35331,38073,41776,42717,40736,49020,45099,44114,60487,48760,41281,48346,37025,31514,33977,42060,36036,22012,51048,45834,53712,53577,45022,43740,34898,30103,35137,39752,32348,25198) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 58552 56126 57276 48033 49709 53597 45099 51048 NA [2,] 54955 49231 56389 46148 47840 53588 44114 45834 NA [3,] 65540 59723 57657 50736 64781 64172 60487 53712 NA [4,] 51570 48103 62300 48114 57802 53955 48760 53577 NA [5,] 51145 47472 48929 38390 48154 55509 41281 45022 NA [6,] 46641 50497 51168 44112 54353 48908 48346 43740 NA [7,] 35704 40059 39636 36287 39737 35331 37025 34898 NA [8,] 33253 34149 33213 30333 37732 38073 31514 30103 NA [9,] 35193 36860 38127 35908 37163 41776 33977 35137 NA [10,] 41668 46356 43291 40005 43782 42717 42060 39752 NA [11,] 34865 36577 30600 35263 40649 40736 36036 32348 NA [12,] 21210 23872 21956 26591 29412 49020 22012 25198 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -3597 -6895 -887 -1885 -1869 -9 -985 -5214 NA [2,] 10585 10492 1268 4588 16941 10584 16373 7878 NA [3,] -13970 -11620 4643 -2622 -6979 -10217 -11727 -135 NA [4,] -425 -631 -13371 -9724 -9648 1554 -7479 -8555 NA [5,] -4504 3025 2239 5722 6199 -6601 7065 -1282 NA [6,] -10937 -10438 -11532 -7825 -14616 -13577 -11321 -8842 NA [7,] -2451 -5910 -6423 -5954 -2005 2742 -5511 -4795 NA [8,] 1940 2711 4914 5575 -569 3703 2463 5034 NA [9,] 6475 9496 5164 4097 6619 941 8083 4615 NA [10,] -6803 -9779 -12691 -4742 -3133 -1981 -6024 -7404 NA [11,] -13655 -12705 -8644 -8672 -11237 8284 -14024 -7150 NA [12,] 34916 33404 26077 23118 24185 -3921 29036 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/1zbd91424966027.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/2vzw71424966027.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/3rj7f1424966027.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/410ah1424966027.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,] 45099.0 44114.0 50736.0 48103.0 38390.0 43740.0 34898.0 30103.0 33977 [2,] 48871.0 45991.0 55684.5 48437.0 43151.5 45376.5 35517.5 30923.5 35165 [3,] 52322.5 48535.5 60105.0 52573.5 47813.0 48627.0 36656.0 33233.0 36384 [4,] 56701.0 54271.5 64476.5 55878.5 50037.0 50832.5 39686.5 35940.5 37645 [5,] 58552.0 56389.0 65540.0 62300.0 55509.0 54353.0 40059.0 38073.0 38127 [,10] [,11] [,12] [1,] 39752.0 30600.0 21210.0 [2,] 40836.5 33606.5 21984.0 [3,] 42388.5 35649.5 24535.0 [4,] 43536.5 38613.0 28001.5 [5,] 46356.0 40736.0 29412.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 47948.55 43909.89 55193.66 48416.57 43966.66 45579.2 34327.14 30430.43 [2,] 56696.45 53161.11 65016.34 56730.43 51659.34 51674.8 38984.86 36035.57 [,9] [,10] [,11] [,12] [1,] 34998.64 40880.24 32852.8 21173.54 [2,] 37769.36 43896.76 38446.2 27896.46 $out [1] 41776 49020 $group [1] 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(45099, 48871, 52322.5, 56701, 58552, 44114, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51ltw1424966027.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] [1,] -6895.0 1268 -13970.0 -13371 -6601.0 -14616.0 -6423 -569.0 941.0 [2,] -4405.5 6233 -11673.5 -9686 -2893.0 -12554.5 -5932 2201.5 4356.0 [3,] -1877.0 10538 -8598.0 -8017 2632.0 -11129.0 -5153 3207.0 5819.5 [4,] -936.0 13479 -1378.5 -528 5960.5 -9640.0 -2228 4974.0 7351.0 [5,] -9.0 16941 4643.0 1554 7065.0 -7825.0 2742 5575.0 9496.0 [,10] [,11] [,12] [1,] -12691.0 -14024.0 23118.0 [2,] -8591.5 -13180.0 23651.5 [3,] -6413.5 -9954.5 26077.0 [4,] -3937.5 -7897.0 31220.0 [5,] -1981.0 -7150.0 34916.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3815.11251 6490.28 -14348.935 -13132.79 -2313.692 -12757.082 -7222.108 [2,] 61.11251 14585.72 -2847.065 -2901.21 7577.692 -9500.918 -3083.892 [,8] [,9] [,10] [,11] [,12] [1,] 1658.242 4146.45 -9013.291 -12905.66 21557.21 [2,] 4755.758 7492.55 -3813.709 -7003.34 30596.79 $out [1] 8284 -3921 $group [1] 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-6895, -4405.5, -1877, -936, -9, 1268, 6233, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xdyx1424966027.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] [1,] 21210.0 23872.0 21956.0 26591.0 29412.0 35331 22012.0 25198 NA [2,] 35029.0 36718.5 35670.0 35585.5 38734.5 41256 35006.5 33623 NA [3,] 44154.5 46914.0 46110.0 39197.5 45811.0 48964 41670.5 41746 NA [4,] 53262.5 49864.0 56832.5 47090.5 52031.0 53776 46722.5 48441 NA [5,] 65540.0 59723.0 62300.0 50736.0 64781.0 64172 60487.0 53712 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 35838.08 40918.25 36457.64 33949.99 39746.38 43253.54 36326.75 34987.41 [2,] 52470.92 52909.75 55762.36 44445.01 51875.62 54674.46 47014.25 48504.59 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(21210, 35029, 44154.5, 53262.5, 65540, 23872, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/70b9l1424966027.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,] 27408.88 24535.00 24647.12 [2,] 36325.94 36016.75 36103.44 [3,] 44720.81 45100.75 44558.94 [4,] 51096.19 50474.75 50878.62 [5,] 59601.00 60105.00 60497.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 37984.00 38506.36 37819.88 [2,] 51457.62 51695.14 51298.00 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(27408.875, 36325.9375, 44720.8125, 51096.1875, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zbd91424966027.ps tmp/1zbd91424966027.png",intern=TRUE)) character(0) > try(system("convert tmp/2vzw71424966027.ps tmp/2vzw71424966027.png",intern=TRUE)) character(0) > try(system("convert tmp/3rj7f1424966027.ps tmp/3rj7f1424966027.png",intern=TRUE)) character(0) > try(system("convert tmp/410ah1424966027.ps tmp/410ah1424966027.png",intern=TRUE)) character(0) > try(system("convert tmp/51ltw1424966027.ps tmp/51ltw1424966027.png",intern=TRUE)) character(0) > try(system("convert tmp/6xdyx1424966027.ps tmp/6xdyx1424966027.png",intern=TRUE)) character(0) > try(system("convert tmp/70b9l1424966027.ps tmp/70b9l1424966027.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.656 0.412 3.097