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,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] 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,] 3167956 3331523 3388686 3072606 3114971 3466587 3675761 3670053 NA [2,] 3001753 3213977 3348700 2891262 3049444 3251624 3552136 3563751 NA [3,] 3571343 3896807 3973721 3390581 3697355 3921482 4177498 4341934 NA [4,] 3990145 4121803 4156519 3888685 3213665 4466794 4568847 4779391 NA [5,] 4472259 4566599 4713826 4173577 4447089 4916693 5027940 5440427 NA [6,] 4487988 4529566 4704148 4130139 4442139 4939490 5078079 5404974 NA [7,] 5021544 5172312 5175950 4851476 5119203 5627276 5759003 5934128 NA [8,] 4877589 5121598 5025767 4811406 5058056 5540569 5671424 5942981 NA [9,] 4563348 4713449 4600637 4322719 4623783 5128892 5239374 5477811 NA [10,] 4452338 4656638 4560314 4274814 4666071 5024163 5100023 5288928 NA [11,] 3535989 3647578 3443549 3355439 3719403 3807138 3944666 4099344 NA [12,] 3454304 3545823 3333873 3293039 3440349 3777434 3858569 4103791 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -166203 -117546 -39986 -181344 -65527 -214963 -123625 -106302 NA [2,] 569590 682830 625021 499319 647911 669858 625362 778183 NA [3,] 418802 224996 182798 498104 -483690 545312 391349 437457 NA [4,] 482114 444796 557307 284892 1233424 449899 459093 661036 NA [5,] 15729 -37033 -9678 -43438 -4950 22797 50139 -35453 NA [6,] 533556 642746 471802 721337 677064 687786 680924 529154 NA [7,] -143955 -50714 -150183 -40070 -61147 -86707 -87579 8853 NA [8,] -314241 -408149 -425130 -488687 -434273 -411677 -432050 -465170 NA [9,] -111010 -56811 -40323 -47905 42288 -104729 -139351 -188883 NA [10,] -916349 -1009060 -1116765 -919375 -946668 -1217025 -1155357 -1189584 NA [11,] -81685 -101755 -109676 -62400 -279054 -29704 -86097 4447 NA [12,] -122781 -157137 -261267 -178068 26238 -101673 -188516 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/1r9r61432122445.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/2xxkl1432122445.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/3ehau1432122445.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/4oj4j1432122445.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,] 3072606 2891262 3390581 3213665 4173577 4130139 4851476 4811406 4322719 [2,] 3141464 3025598 3634349 3939415 4459674 4465064 5070374 4951678 4581992 [3,] 3360104 3232800 3909144 4139161 4640212 4616857 5174131 5089827 4668616 [4,] 3568320 3450418 4075610 4517820 4972316 5008784 5693140 5605996 5184133 [5,] 3675761 3563751 4341934 4779391 5440427 5404974 5934128 5942981 5477811 [,10] [,11] [,12] [1,] 4274814 3355439 3293039 [2,] 4506326 3489769 3387111 [3,] 4661354 3683490 3500064 [4,] 5062093 3875902 3818002 [5,] 5288928 4099344 4103791 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 3121656 2995490 3662650 3816055 4353843 4313127 4826245 4724315 4332252 [2,] 3598553 3470111 4155639 4462267 4926582 4920587 5522017 5455339 5004980 [,10] [,11] [,12] [1,] 4350895 3467791 3259362 [2,] 4971814 3899190 3740765 $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(3072606, 3141463.5, 3360104.5, 3568320, 3675761, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ke4t1432122445.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,] -214963.0 499319.0 182798.0 284892.0 -43438 471802 -150183 -488687.0 [2,] -173773.5 597305.5 203897.0 447347.5 -36243 531355 -115767 -449721.5 [3,] -120585.5 636636.5 405075.5 470603.5 -7314 659905 -73927 -428590.0 [4,] -85914.5 676344.0 467780.5 609171.5 19263 684355 -45392 -409913.0 [5,] -39986.0 778183.0 545312.0 661036.0 50139 721337 8853 -408149.0 [,9] [,10] [,11] [,12] [1,] -188883.0 -1217025.0 -109676.0 -261267 [2,] -125180.5 -1172470.5 -105715.5 -183292 [3,] -80770.0 -1062912.5 -83891.0 -157137 [4,] -44114.0 -933021.5 -46052.0 -112227 [5,] 42288.0 -916349.0 4447.0 -101673 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -169664.8 592484.5 257666.4 380206.3 -38320.45 574437 -113239.49 -450827.6 [2,] -71506.2 680788.5 552484.6 561000.7 23692.45 745373 -34614.51 -406352.4 [,9] [,10] [,11] [,12] [1,] -126054.91 -1196672.1 -117219.89 -199575.9 [2,] -35485.09 -929152.9 -50562.11 -114698.1 $out [1] -483690 1233424 -314241 -279054 26238 $group [1] 3 4 8 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-214963, -173773.5, -120585.5, -85914.5, -39986, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6g79u1432122445.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 3213977 3333873 2891262 3049444 3251624 3552136 3563751 NA [2,] 3495146 3596700 3416118 3324239 3327007 3792286 3901618 4101568 NA [3,] 4221242 4325684 4358416 4009412 4080771 4691744 4798394 5034160 NA [4,] 4525668 4685044 4708987 4298766 4644927 5076528 5169698 5459119 NA [5,] 5021544 5172312 5175950 4851476 5119203 5627276 5759003 5942981 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 3751214 3829284 3768730 3564923 3479659 4105992 4220013 4414971 NA [2,] 4691269 4822085 4948103 4453901 4681883 5277495 5376774 5653348 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(3001753, 3495146.5, 4221241.5, 4525668, 5021544, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/77vmw1432122445.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,] 3234081 3232800 3218540 [2,] 3647518 3591777 3641462 [3,] 4431398 4378009 4466890 [4,] 4793331 4664985 4831069 [5,] 5332612 5174131 5377498 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3908785 3888512 3924302 [2,] 4954011 4867506 5009477 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(3234080.875, 3647518, 4431398.25, 4793331.375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1r9r61432122445.ps tmp/1r9r61432122445.png",intern=TRUE)) character(0) > try(system("convert tmp/2xxkl1432122445.ps tmp/2xxkl1432122445.png",intern=TRUE)) character(0) > try(system("convert tmp/3ehau1432122445.ps tmp/3ehau1432122445.png",intern=TRUE)) character(0) > try(system("convert tmp/4oj4j1432122445.ps tmp/4oj4j1432122445.png",intern=TRUE)) character(0) > try(system("convert tmp/5ke4t1432122445.ps tmp/5ke4t1432122445.png",intern=TRUE)) character(0) > try(system("convert tmp/6g79u1432122445.ps tmp/6g79u1432122445.png",intern=TRUE)) character(0) > try(system("convert tmp/77vmw1432122445.ps tmp/77vmw1432122445.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.475 0.422 2.934