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(18.3,18.6,18.7,20.1,18.9,20.1,3167956,3001753,3571343,3990145,4472259,4487988,5021544,4877589,4563348,4452338,3535989,3454304,3331523,3213977,3896807,4121803,4566599,4529566,5172312,5121598,4713449,4656638,3647578,3545823,3388686,3348700,3973721,4156519,4713826,4704148,5175950,5025767,4600637,4560314,3443549,3333873,3072606,2891262,3390581,3888685,4173577,4130139,4851476,4811406,4322719,4274814,3355439,3293039,3114971,3049444,3697355,3213665,4447089,4442139,5119203,5058056,4623783,4666071,3719403,3440349,3466587,3251624,3921482,4466794,4916693,4939490,5627276,5540569,5128892,5024163,3807138,3777434,3675761,3552136,4177498,4568847,5027940,5078079,5759003,5671424,5239374,5100023,3944666,3858569,3670053,3563751,4341934,4779391,5440427,5404974,5934128,5942981,5477811,5288928,4099344,4103791) > 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] 102 > (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] 9 9 9 9 9 9 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 18.3 5021544 5172312 5175950 4851476 5119203 5627276 5759003 5934128 [2,] 18.6 4877589 5121598 5025767 4811406 5058056 5540569 5671424 5942981 [3,] 18.7 4563348 4713449 4600637 4322719 4623783 5128892 5239374 5477811 [4,] 20.1 4452338 4656638 4560314 4274814 4666071 5024163 5100023 5288928 [5,] 18.9 3535989 3647578 3443549 3355439 3719403 3807138 3944666 4099344 [6,] 20.1 3454304 3545823 3333873 3293039 3440349 3777434 3858569 4103791 [7,] 3167956.0 3331523 3388686 3072606 3114971 3466587 3675761 3670053 NA [8,] 3001753.0 3213977 3348700 2891262 3049444 3251624 3552136 3563751 NA [9,] 3571343.0 3896807 3973721 3390581 3697355 3921482 4177498 4341934 NA [10,] 3990145.0 4121803 4156519 3888685 3213665 4466794 4568847 4779391 NA [11,] 4472259.0 4566599 4713826 4173577 4447089 4916693 5027940 5440427 NA [12,] 4487988.0 4529566 4704148 4130139 4442139 4939490 5078079 5404974 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.3 -143955 -50714 -150183 -40070 -61147 -86707 -87579 [2,] 0.1 -314241 -408149 -425130 -488687 -434273 -411677 -432050 [3,] 1.4 -111010 -56811 -40323 -47905 42288 -104729 -139351 [4,] -1.2 -916349 -1009060 -1116765 -919375 -946668 -1217025 -1155357 [5,] 1.2 -81685 -101755 -109676 -62400 -279054 -29704 -86097 [6,] 3167935.9 -122781 -157137 -261267 -178068 26238 -101673 -188516 [7,] -166203.0 -117546 -39986 -181344 -65527 -214963 -123625 -106302 [8,] 569590.0 682830 625021 499319 647911 669858 625362 778183 [9,] 418802.0 224996 182798 498104 -483690 545312 391349 437457 [10,] 482114.0 444796 557307 284892 1233424 449899 459093 661036 [11,] 15729.0 -37033 -9678 -43438 -4950 22797 50139 -35453 [12,] 533556.0 642746 471802 721337 677064 687786 680924 529154 [,9] [1,] 8853 [2,] -465170 [3,] -188883 [4,] -1189584 [5,] 4447 [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] 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/1c5sf1413035322.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/2c8nb1413035322.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/37mij1413035322.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/48irg1413035322.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,] 4851476 4811406 4322719 4274814 3355439 3293039 3072606 2891262 3390581 [2,] 5021544 4877589 4563348 4452338 3443549 3333873 3141464 3025598 3634349 [3,] 5172312 5058056 4623783 4656638 3647578 3454304 3360104 3232800 3909144 [4,] 5627276 5540569 5128892 5024163 3807138 3777434 3568320 3450418 4075610 [5,] 5934128 5942981 5477811 5288928 4099344 4103791 3675761 3563751 4341934 [,10] [,11] [,12] [1,] 3213665 4173577 4130139 [2,] 3939415 4459674 4465064 [3,] 4139161 4640212 4616857 [4,] 4517820 4972316 5008784 [5,] 4779391 5440427 5404974 $n [1] 9 9 9 9 9 9 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 4853293 4708887 4325930 4355477 3456088 3220695 3121656 2995490 3662650 [2,] 5491331 5407225 4921636 4957799 3839068 3687913 3598553 3470111 4155639 [,10] [,11] [,12] [1,] 3816055 4353843 4313127 [2,] 4462267 4926582 4920587 $out [1] 18.3 18.6 18.7 20.1 18.9 20.1 $group [1] 1 2 3 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(4851476, 5021544, 5172312, 5627276, 5934128, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nqtm1413035322.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] [1,] -150183 -465170 -188883 -1217025 -109676 -261267.0 -214963.0 499319.0 [2,] -87579 -434273 -111010 -1155357 -101755 -183292.0 -173773.5 597305.5 [3,] -61147 -425130 -56811 -1009060 -81685 -139959.0 -120585.5 636636.5 [4,] -40070 -408149 -40323 -919375 -29704 -37717.5 -85914.5 676344.0 [5,] 8853 -408149 42288 -916349 4447 26238.0 -39986.0 778183.0 [,9] [,10] [,11] [,12] [1,] 182798.0 284892.0 -43438 471802 [2,] 203897.0 447347.5 -36243 531355 [3,] 405075.5 470603.5 -7314 659905 [4,] 467780.5 609171.5 19263 684355 [5,] 545312.0 661036.0 50139 721337 $n [1] 9 9 9 9 9 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -86168.41 -438888.6 -94039.49 -1133343.9 -119631.86 -221279.01 -169664.8 [2,] -36125.59 -411371.4 -19582.51 -884776.1 -43738.14 -58638.99 -71506.2 [,8] [,9] [,10] [,11] [,12] [1,] 592484.5 257666.4 380206.3 -38320.45 574437 [2,] 680788.5 552484.6 561000.7 23692.45 745373 $out [1] 0.1 -314241.0 -488687.0 -1.2 -279054.0 3167935.9 -483690.0 [8] 1233424.0 $group [1] 2 2 2 4 5 6 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-150183, -87579, -61147, -40070, 8853, -465170, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6osd01413035322.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,] 18.3 3213977 3348700 2891262 3049444 3251624 3552136 3563751 4099344 [2,] 18.8 3495146 3596700 3362227 3253352 3592995 3792286 3901618 4103791 [3,] 1500886.6 4287070 4406578 4009412 3986084 4545288 4796505 4939707 5383370 [4,] 3780744.0 4564974 4713638 4580476 4444614 4928092 5103486 5422700 5934128 [5,] 4487988.0 5021544 5172312 5175950 4851476 5119203 5627276 5759003 5942981 $n [1] 12 12 12 12 12 12 12 12 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -223527.6 3799115 3897136 3453761 3442742 3936342 4198458 4245931 4202743 [2,] 3225300.7 4775026 4916021 4565063 4529427 5154235 5394552 5633483 6563996 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(18.3, 18.8, 1500886.55, 3780744, 4487988, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7m00x1413035322.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,] 3200800 3232800 3218540 [2,] 3322349 3550941 3590498 [3,] 4186522 4378009 4466890 [4,] 4693361 4648425 4792185 [5,] 4740101 5172312 5324410 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3561194 3877439 3918792 [2,] 4811849 4878579 5014987 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(3200800.23333333, 3322349.20972222, 4186521.62361111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1c5sf1413035322.ps tmp/1c5sf1413035322.png",intern=TRUE)) character(0) > try(system("convert tmp/2c8nb1413035322.ps tmp/2c8nb1413035322.png",intern=TRUE)) character(0) > try(system("convert tmp/37mij1413035322.ps tmp/37mij1413035322.png",intern=TRUE)) character(0) > try(system("convert tmp/48irg1413035322.ps tmp/48irg1413035322.png",intern=TRUE)) character(0) > try(system("convert tmp/5nqtm1413035322.ps tmp/5nqtm1413035322.png",intern=TRUE)) character(0) > try(system("convert tmp/6osd01413035322.ps tmp/6osd01413035322.png",intern=TRUE)) character(0) > try(system("convert tmp/7m00x1413035322.ps tmp/7m00x1413035322.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.439 0.399 2.855