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(13671,15698,18150,16245,18479,18479,18819,18059,17004,16981,16578,21604,13419,14487,17349,15646,17419,17358,18221,19554,14386,16833,18067,19662,12192,15081,13698,18474,13871,15669,17597,15469,15374,16568,11619,16780,8700,8906,9612,10073,10275,9921,13237,9572,10425,11385,9970,15456,7708,8892,11145,11069,9893,10929,12240,10411,9747,9950,10079,14064,8368,9558,10432,10068,9915,9549,10433,10009,10327,9453,9494,13133,7082,7805,9064,8236,10182,16210,7451,8384,7143,8507,9833,17364,6260,7897,8933,6554,8333,7224,9659,9977,9289,9929,10576,15463) > 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,] 13671 13419 12192 8700 7708 8368 7082 6260 NA [2,] 15698 14487 15081 8906 8892 9558 7805 7897 NA [3,] 18150 17349 13698 9612 11145 10432 9064 8933 NA [4,] 16245 15646 18474 10073 11069 10068 8236 6554 NA [5,] 18479 17419 13871 10275 9893 9915 10182 8333 NA [6,] 18479 17358 15669 9921 10929 9549 16210 7224 NA [7,] 18819 18221 17597 13237 12240 10433 7451 9659 NA [8,] 18059 19554 15469 9572 10411 10009 8384 9977 NA [9,] 17004 14386 15374 10425 9747 10327 7143 9289 NA [10,] 16981 16833 16568 11385 9950 9453 8507 9929 NA [11,] 16578 18067 11619 9970 10079 9494 9833 10576 NA [12,] 21604 19662 16780 15456 14064 13133 17364 15463 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2027 1068 2889 206 1184 1190 723 1637 NA [2,] 2452 2862 -1383 706 2253 874 1259 1036 NA [3,] -1905 -1703 4776 461 -76 -364 -828 -2379 NA [4,] 2234 1773 -4603 202 -1176 -153 1946 1779 NA [5,] 0 -61 1798 -354 1036 -366 6028 -1109 NA [6,] 340 863 1928 3316 1311 884 -8759 2435 NA [7,] -760 1333 -2128 -3665 -1829 -424 933 318 NA [8,] -1055 -5168 -95 853 -664 318 -1241 -688 NA [9,] -23 2447 1194 960 203 -874 1364 640 NA [10,] -403 1234 -4949 -1415 129 41 1326 647 NA [11,] 5026 1595 5161 5486 3985 3639 7531 4887 NA [12,] -8185 -7470 -8080 -7748 -5696 -6051 -11104 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/1nriq1424710924.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/2ncgf1424710924.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/3yy0d1424710924.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/45x4s1424710924.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,] 6260.0 7805.0 8933.0 6554.0 8333.0 7224 7451.0 8384.0 7143 [2,] 7395.0 8394.5 9338.0 9152.0 9904.0 9735 10046.0 9774.5 9518 [3,] 8534.0 9232.0 10788.5 10571.0 10228.5 13299 12738.5 10210.0 10376 [4,] 12805.5 14784.0 15523.5 15945.5 15645.0 16784 17909.0 16764.0 14880 [5,] 13671.0 15698.0 18150.0 18474.0 18479.0 18479 18819.0 19554.0 17004 [,10] [,11] [,12] [1,] 8507.0 9494.0 13133.0 [2,] 9691.0 9901.5 14760.0 [3,] 10667.5 10327.5 16121.5 [4,] 16700.5 14098.5 18513.0 [5,] 16981.0 18067.0 21604.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 5511.617 5662.734 7333.191 6776.053 7021.495 9361.327 8346.115 [2,] 11556.383 12801.266 14243.809 14365.947 13435.505 17236.673 17130.885 [,8] [,9] [,10] [,11] [,12] [1,] 6305.565 7380.71 6751.893 7982.996 14025.02 [2,] 14114.435 13371.29 14583.107 12672.004 18217.98 $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(6260, 7395, 8534, 12805.5, 13671, 7805, 8394.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wxs81424710924.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,] 206.0 -1383.0 -2379.0 -1176.0 -1109.0 340.0 -3665.0 -1241.0 -874 -1415.0 [2,] 895.5 790.0 -1804.0 -664.5 -360.0 601.5 -1978.5 -1148.0 90 -909.0 [3,] 1187.0 1147.5 -596.0 987.5 -30.5 1097.5 -592.0 -676.0 800 85.0 [4,] 1832.0 2352.5 192.5 1862.5 1417.0 2181.5 625.5 111.5 1279 940.5 [5,] 2889.0 2862.0 461.0 2234.0 1798.0 3316.0 1333.0 853.0 2447 1326.0 [,11] [,12] [1,] 1595.0 -8185.0 [2,] 3812.0 -8132.5 [3,] 4956.5 -7748.0 [4,] 5323.5 -6760.5 [5,] 7531.0 -5696.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 663.8577 274.6651 -1711.2736 -424.1185 -1023.1577 214.8893 -2046.6318 [2,] 1710.1423 2020.3349 519.2736 2399.1185 962.1577 1980.1107 862.6318 [,8] [,9] [,10] [,11] [,12] [1,] -1379.57478 135.8075 -948.1573 4112.154 -8567.336 [2,] 27.57478 1464.1925 1118.1573 5800.846 -6928.664 $out [1] 4776 -4603 6028 -8759 -5168 -4949 -11104 $group [1] 3 4 5 6 8 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(206, 895.5, 1187, 1832, 2889, -1383, 790, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6yy1h1424710924.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,] 13671.0 13419.0 11619.0 8700.0 8892 8368.0 7082.0 6260.0 NA [2,] 16411.5 15066.5 13784.5 9592.0 9820 9521.5 7628.0 7560.5 NA [3,] 17531.5 17353.5 15421.5 10021.5 10245 9962.0 8445.5 9111.0 NA [4,] 18479.0 18144.0 16674.0 10905.0 11107 10379.5 10007.5 9953.0 NA [5,] 18819.0 19662.0 18474.0 11385.0 12240 10433.0 10182.0 10576.0 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16588.5 15949.83 14103.58 9422.632 9657.991 9570.66 7360.194 8019.765 [2,] 18474.5 18757.17 16739.42 10620.368 10832.009 10353.34 9530.806 10202.235 [,9] [1,] NA [2,] NA $out [1] 21604 13237 15456 7708 14064 13133 16210 17364 15463 $group [1] 1 4 4 5 5 6 7 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(13671, 16411.5, 17531.5, 18479, 18819, 13419, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/785fq1424710924.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,] 11040.50 8534.00 10025.12 [2,] 11869.44 10219.25 11841.12 [3,] 12296.88 10473.50 12518.31 [4,] 12923.38 11763.50 13192.31 [5,] 13457.12 13299.00 13996.25 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 11816.17 9769.157 11902.03 [2,] 12777.58 11177.843 13134.60 $out [1] 9675.00 16690.75 16121.50 16523.25 $group [1] 1 1 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(11040.5, 11869.4375, 12296.875, 12923.375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nriq1424710924.ps tmp/1nriq1424710924.png",intern=TRUE)) character(0) > try(system("convert tmp/2ncgf1424710924.ps tmp/2ncgf1424710924.png",intern=TRUE)) character(0) > try(system("convert tmp/3yy0d1424710924.ps tmp/3yy0d1424710924.png",intern=TRUE)) character(0) > try(system("convert tmp/45x4s1424710924.ps tmp/45x4s1424710924.png",intern=TRUE)) character(0) > try(system("convert tmp/5wxs81424710924.ps tmp/5wxs81424710924.png",intern=TRUE)) character(0) > try(system("convert tmp/6yy1h1424710924.ps tmp/6yy1h1424710924.png",intern=TRUE)) character(0) > try(system("convert tmp/785fq1424710924.ps tmp/785fq1424710924.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.675 0.476 3.177