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(3167956.00 + ,3001753.00 + ,3571343.00 + ,3990145.00 + ,4472259.00 + ,4487988.00 + ,5021544.00 + ,4877589.00 + ,4563348.00 + ,4452338.00 + ,3535989.00 + ,3454304.00 + ,3331523.00 + ,3213977.00 + ,3896807.00 + ,4121803.00 + ,4566599.00 + ,4529566.00 + ,5172312.00 + ,5121598.00 + ,4713449.00 + ,4656638.00 + ,3647578.00 + ,3545823.00 + ,3388686.00 + ,3348700.00 + ,3973721.00 + ,4156519.00 + ,4713826.00 + ,4704148.00 + ,5175950.00 + ,5025767.00 + ,4600637.00 + ,4560314.00 + ,3443549.00 + ,3333873.00 + ,3072606.00 + ,2891262.00 + ,3390581.00 + ,3888685.00 + ,4173577.00 + ,4130139.00 + ,4851476.00 + ,4811406.00 + ,4322719.00 + ,4274814.00 + ,3355439.00 + ,3293039.00 + ,3114971.00 + ,3049444.00 + ,3697355.00 + ,3213665.00 + ,4447089.00 + ,4442139.00 + ,5119203.00 + ,5058056.00 + ,4623783.00 + ,4666071.00 + ,3719403.00 + ,3440349.00 + ,3466587.00 + ,3251624.00 + ,3921482.00 + ,4466794.00 + ,4916693.00 + ,4939490.00 + ,5627276.00 + ,5540569.00 + ,5128892.00 + ,5024163.00 + ,3807138.00 + ,3777434.00 + ,3675761.00 + ,3552136.00 + ,4177498.00 + ,4568847.00 + ,5027940.00 + ,5078079.00 + ,5759003.00 + ,5671424.00 + ,5239374.00 + ,5100023.00 + ,3944666.00 + ,3858569.00 + ,3670053.00 + ,3563751.00 + ,4341934.00 + ,4779391.00 + ,5440427.00 + ,5404974.00 + ,5934128.00 + ,5942981.00 + ,5477811.00 + ,5288928.00 + ,4099344.00 + ,4103791.00) > par1 = '4' > par1 <- '4' > #'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] 24 > 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] 24 24 24 24 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 3167956 4472259 4563348 3331523 4566599 4713449 3388686 4713826 4600637 [2,] 3001753 4487988 4452338 3213977 4529566 4656638 3348700 4704148 4560314 [3,] 3571343 5021544 3535989 3896807 5172312 3647578 3973721 5175950 3443549 [4,] 3990145 4877589 3454304 4121803 5121598 3545823 4156519 5025767 3333873 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 3072606 4173577 4322719 3114971 4447089 4623783 3466587 4916693 5128892 [2,] 2891262 4130139 4274814 3049444 4442139 4666071 3251624 4939490 5024163 [3,] 3390581 4851476 3355439 3697355 5119203 3719403 3921482 5627276 3807138 [4,] 3888685 4811406 3293039 3213665 5058056 3440349 4466794 5540569 3777434 [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 3675761 5027940 5239374 3670053 5440427 5477811 NA [2,] 3552136 5078079 5100023 3563751 5404974 5288928 NA [3,] 4177498 5759003 3944666 4341934 5934128 4099344 NA [4,] 4568847 5671424 3858569 4779391 5942981 4103791 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -166203 15729 -111010 -117546 -37033 -56811 -39986 -9678 -40323 [2,] 569590 533556 -916349 682830 642746 -1009060 625021 471802 -1116765 [3,] 418802 -143955 -81685 224996 -50714 -101755 182798 -150183 -109676 [4,] 482114 -314241 -122781 444796 -408149 -157137 557307 -425130 -261267 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] -181344 -43438 -47905 -65527 -4950 42288 -214963 22797 -104729 [2,] 499319 721337 -919375 647911 677064 -946668 669858 687786 -1217025 [3,] 498104 -40070 -62400 -483690 -61147 -279054 545312 -86707 -29704 [4,] 284892 -488687 -178068 1233424 -434273 26238 449899 -411677 -101673 [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] -123625 50139 -139351 -106302 -35453 -188883 NA [2,] 625362 680924 -1155357 778183 529154 -1189584 NA [3,] 391349 -87579 -86097 437457 8853 4447 NA [4,] 459093 -432050 -188516 661036 -465170 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/15f001413112732.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/2c6y51413112732.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/3pgxm1413112732.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/4h1zp1413112732.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] [1,] 3072606 2891262 3355439 3213665 [2,] 3568320 3450418 3672466 3661628 [3,] 4517804 4470163 3959194 4139161 [4,] 4815260 4821819 5070374 4951678 [5,] 5477811 5404974 5934128 5942981 $n [1] 24 24 24 24 $conf [,1] [,2] [,3] [,4] [1,] 4115645 4027864 3508346 3723099 [2,] 4919962 4912462 4410041 4555223 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(3072606, 3568320, 4517803.5, 4815259.5, 5477811, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5aaz91413112732.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] [1,] -214963.0 -1217025.0 -483690.0 -488687.0 [2,] -120585.5 -933021.5 -94667.0 -409913.0 [3,] -52358.0 551573.0 -55930.5 -157137.0 [4,] -22565.5 673461.0 203897.0 447347.5 [5,] 50139.0 778183.0 545312.0 1233424.0 $n [1] 24 24 24 23 $conf [,1] [,2] [,3] [,4] [1,] -83971.03 33456.45 -152222.21 -439563.8 [2,] -20744.97 1069689.55 40361.21 125289.8 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(-214963, -120585.5, -52358, -22565.5, 50139, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66e9k1413112732.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,] 3001753 4472259 3454304 3213977 4529566 3545823 3348700 4704148 3333873 [2,] 3084854 4480124 3495146 3272750 4548082 3596700 3368693 4708987 3388711 [3,] 3369650 4682788 3994164 3614165 4844098 4152108 3681204 4869796 4001932 [4,] 3780744 4949566 4507843 4009305 5146955 4685044 4065120 5100858 4580476 [5,] 3990145 5021544 4563348 4121803 5172312 4713449 4156519 5175950 4600637 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 2891262 4130139 3293039 3049444 4442139 3440349 3251624 4916693 3777434 [2,] 2981934 4151858 3324239 3082208 4444614 3579876 3359106 4928092 3792286 [3,] 3231594 4492492 3815126 3164318 4752572 4171593 3694034 5240030 4415650 [4,] 3639633 4831441 4298766 3455510 5088630 4644927 4194138 5583922 5076528 [5,] 3888685 4851476 4322719 3697355 5119203 4666071 4466794 5627276 5128892 [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 3552136 5027940 3858569 3563751 5404974 4099344 NA [2,] 3613948 5053010 3901618 3616902 5422700 4101568 NA [3,] 3926630 5374752 4522344 4005994 5687278 4696360 NA [4,] 4373172 5715214 5169698 4560662 5938554 5383370 NA [5,] 4568847 5759003 5239374 4779391 5942981 5477811 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2819897 4311929 3194133 3032287 4370989 3292317 3131026 4560218 3060438 [2,] 3919402 5053648 4794194 4196043 5317208 5011899 4231381 5179375 4943425 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 2712011 3955621 3045250 2869409 4243800 3330203 3034359 4721923 3401100 [2,] 3751176 5029362 4585003 3459227 5261345 5012983 4353710 5758136 5430201 [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 3326843 4851610 3520561 3260423 5279753 3683736 NA [2,] 4526416 5897893 5524128 4751564 6094802 5708983 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" NA Warning message: In bxp(list(stats = c(3001753, 3084854.5, 3369649.5, 3780744, 3990145, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7e08y1413112732.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,] 4233852 3959194 4132130 [2,] 4266608 4049177 4161997 [3,] 4302110 4304662 4254474 [4,] 4319979 4493983 4341259 [5,] 4335101 4517804 4365435 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 4259947 3953265 4112857 [2,] 4344273 4656059 4396090 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(4233852.45833333, 4266607.875, 4302110.10416667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15f001413112732.ps tmp/15f001413112732.png",intern=TRUE)) character(0) > try(system("convert tmp/2c6y51413112732.ps tmp/2c6y51413112732.png",intern=TRUE)) character(0) > try(system("convert tmp/3pgxm1413112732.ps tmp/3pgxm1413112732.png",intern=TRUE)) character(0) > try(system("convert tmp/4h1zp1413112732.ps tmp/4h1zp1413112732.png",intern=TRUE)) character(0) > try(system("convert tmp/5aaz91413112732.ps tmp/5aaz91413112732.png",intern=TRUE)) character(0) > try(system("convert tmp/66e9k1413112732.ps tmp/66e9k1413112732.png",intern=TRUE)) character(0) > try(system("convert tmp/7e08y1413112732.ps tmp/7e08y1413112732.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.416 0.379 2.824