R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(3207324 + ,3178086 + ,3148485 + ,3087246 + ,3693267 + ,3661164 + ,3207324 + ,2905563 + ,2934699 + ,2934699 + ,2967168 + ,3025542 + ,3207324 + ,3148485 + ,3239325 + ,3388641 + ,4238049 + ,4238049 + ,4056732 + ,3874950 + ,4024266 + ,4205949 + ,4238049 + ,4328892 + ,4601499 + ,4419732 + ,4419732 + ,4692342 + ,5448042 + ,5509281 + ,5357202 + ,4993734 + ,5266260 + ,5266260 + ,5295495 + ,5448042 + ,5568120 + ,5629359 + ,5629359 + ,5811042 + ,6508356 + ,6689670 + ,6718809 + ,6264966 + ,6508356 + ,6417513 + ,6235746 + ,6628434 + ,6718809 + ,6566727 + ,6598830 + ,6809748 + ,7597920 + ,7990056 + ,7990056 + ,7808739 + ,8080980 + ,7808739 + ,7656276 + ,8233527 + ,8323902 + ,8110134 + ,8654901 + ,8868684 + ,9504309 + ,9926133 + ,9867774 + ,9835290 + ,10078677 + ,10049076 + ,9686076 + ,10230759 + ,10412541 + ,10230759 + ,10986462 + ,11349927 + ,12196086 + ,12529950 + ,12439476 + ,12257691 + ,12409872 + ,12591555 + ,11985168 + ,12468612 + ,12773337 + ,12650394 + ,13438098 + ,13710240 + ,14861511 + ,15072414 + ,14800254 + ,14952351 + ,15043194 + ,15134034 + ,14556783 + ,15101568 + ,15403311 + ,15101568 + ,15980562 + ,16252821 + ,17433111 + ,17614893 + ,17673267 + ,17977893 + ,17977893 + ,18097971 + ,17553189 + ,17825814 + ,18007131 + ,17673267 + ,18642738 + ,18824436 + ,20034063 + ,20247849 + ,20549592 + ,20822217 + ,20851353 + ,20883456 + ,20338689 + ,20883456) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3207324 3207324 4601499 5568120 6718809 8323902 10412541 12773337 [2,] 3178086 3148485 4419732 5629359 6566727 8110134 10230759 12650394 [3,] 3148485 3239325 4419732 5629359 6598830 8654901 10986462 13438098 [4,] 3087246 3388641 4692342 5811042 6809748 8868684 11349927 13710240 [5,] 3693267 4238049 5448042 6508356 7597920 9504309 12196086 14861511 [6,] 3661164 4238049 5509281 6689670 7990056 9926133 12529950 15072414 [7,] 3207324 4056732 5357202 6718809 7990056 9867774 12439476 14800254 [8,] 2905563 3874950 4993734 6264966 7808739 9835290 12257691 14952351 [9,] 2934699 4024266 5266260 6508356 8080980 10078677 12409872 15043194 [10,] 2934699 4205949 5266260 6417513 7808739 10049076 12591555 15134034 [11,] 2967168 4238049 5295495 6235746 7656276 9686076 11985168 14556783 [12,] 3025542 4328892 5448042 6628434 8233527 10230759 12468612 15101568 [,9] [,10] [,11] [1,] 15403311 18007131 NA [2,] 15101568 17673267 NA [3,] 15980562 18642738 NA [4,] 16252821 18824436 NA [5,] 17433111 20034063 NA [6,] 17614893 20247849 NA [7,] 17673267 20549592 NA [8,] 17977893 20822217 NA [9,] 17977893 20851353 NA [10,] 18097971 20883456 NA [11,] 17553189 20338689 NA [12,] 17825814 20883456 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -29238 -58839 -181767 61239 -152082 -213768 -181782 -122943 -301743 [2,] -29601 90840 0 0 32103 544767 755703 787704 878994 [3,] -61239 149316 272610 181683 210918 213783 363465 272142 272259 [4,] 606021 849408 755700 697314 788172 635625 846159 1151271 1180290 [5,] -32103 0 61239 181314 392136 421824 333864 210903 181782 [6,] -453840 -181317 -152079 29139 0 -58359 -90474 -272160 58374 [7,] -301761 -181782 -363468 -453843 -181317 -32484 -181785 152097 304626 [8,] 29136 149316 272526 243390 272241 243387 152181 90843 0 [9,] 0 181683 0 -90843 -272241 -29601 181683 90840 120078 [10,] 32469 32100 29235 -181767 -152463 -363000 -606387 -577251 -544782 [11,] 58374 90843 152547 392688 577251 544683 483444 544785 272625 [12,] 181782 272607 120078 90375 90375 181782 304725 301743 181317 [,10] [,11] [1,] -333864 NA [2,] 969471 NA [3,] 181698 NA [4,] 1209627 NA [5,] 213786 NA [6,] 301743 NA [7,] 272625 NA [8,] 29136 NA [9,] 32103 NA [10,] -544767 NA [11,] 544767 NA [12,] 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/fisher/rcomp/tmp/10b1l1375883701.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/fisher/rcomp/tmp/2hp9w1375883701.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/fisher/rcomp/tmp/3l70g1375883701.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/fisher/rcomp/tmp/406su1375883701.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] [1,] 3207324 3148485 3148485 3087246 3693267 3661164 3207324 2905563 [2,] 4601499 4419732 4419732 4692342 5448042 5509281 5357202 4993734 [3,] 7521356 7338430 7626866 7839216 8551114 8958094 8928915 8822014 [4,] 12773337 12650394 13438098 13710240 14861511 15072414 14800254 14952351 [5,] 18007131 17673267 18642738 18824436 20034063 20247849 20549592 20822217 [,9] [,10] [,11] [,12] [1,] 2934699 2934699 2967168 3025542 [2,] 5266260 5266260 5295495 5448042 [3,] 9079828 8928908 8671176 9232143 [4,] 15043194 15134034 14556783 15101568 [5,] 20851353 20883456 20338689 20883456 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3438379 3226064 3120930 3333515 3847770 4179972 4210790 3846292 [2,] 11604332 11450797 12132801 12344917 13254459 13736217 13647040 13797737 [,9] [,10] [,11] [,12] [1,] 4194882 3998574 4043867 4408857 [2,] 13964775 13859241 13298485 14055429 $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(3207324, 4601499, 7521355.5, 12773337, 18007131, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5fzy01375883701.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] [1,] -333864.0 -29601.0 149316.0 606021.0 -32103.0 -453840.0 -453843.0 [2,] -213768.0 0.0 181683.0 697314.0 61239.0 -181317.0 -301761.0 [3,] -166924.5 317803.5 212350.5 817165.5 196342.5 -74416.5 -181549.5 [4,] -58839.0 787704.0 272259.0 1151271.0 333864.0 29139.0 152097.0 [5,] 61239.0 969471.0 363465.0 1209627.0 421824.0 301743.0 304626.0 [,8] [,9] [,10] [,11] [,12] [1,] 0.0 -90843.0 -606387.0 58374 90375 [2,] 29136.0 -29601.0 -544782.0 152547 120078 [3,] 150748.5 16051.5 -272383.5 438066 181782 [4,] 243390.0 120078.0 29235.0 544767 272607 [5,] 272526.0 181683.0 32469.0 577251 304725 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -244333.21 -75764.82 167095.1 590350.5 60128.18 -179568.71 -408315.05 [2,] -89515.79 711371.82 257605.9 1043980.5 332556.82 30735.71 45216.05 [,8] [,9] [,10] [,11] [,12] [1,] 43698.66 -58734.1 -559185.28 242097.3 101450.1 [2,] 257798.34 90837.1 14418.28 634034.7 262113.9 $out [1] -61239 -272241 $group [1] 3 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-333864, -213768, -166924.5, -58839, 61239, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6kaes1375883701.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] [1,] 2905563 3148485 4419732 5568120 6566727 8110134 10230759 12650394 [2,] 2950934 3313983 4646920 5720200 6764278 8761792 11168194 13574169 [3,] 3117866 4040499 5266260 6341240 7732508 9760683 12226888 14830882 [4,] 3207324 4238049 5402622 6568395 7990056 9987604 12454044 15057804 [5,] 3207324 4328892 5509281 6718809 8233527 10230759 12591555 15134034 [,9] [,10] [,11] [1,] 15101568 17673267 NA [2,] 16116692 18733587 NA [3,] 17584041 20293269 NA [4,] 17901854 20836785 NA [5,] 18097971 20883456 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3000924 3619026 4921579 5954372 7173422 9201582 11640404 14154187 [2,] 3234807 4461972 5610941 6728107 8291593 10319784 12813373 15507578 [,9] [,10] [,11] [1,] 16769817 19333986 NA [2,] 18398265 21252552 NA $out [1] 3693267 3661164 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(2905563, 2950933.5, 3117865.5, 3207324, 3207324, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7km9i1375883701.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,] 8670851 7338430 8383812 [2,] 9176681 7733041 8909877 [3,] 10160405 8746595 9874473 [4,] 10328240 8943505 10003534 [5,] 10417465 9232143 10120588 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9635172 8194494 9375648 [2,] 10685639 9298696 10373297 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(8670851.1, 9176680.95, 10160405.4, 10328240.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10b1l1375883701.ps tmp/10b1l1375883701.png",intern=TRUE)) character(0) > try(system("convert tmp/2hp9w1375883701.ps tmp/2hp9w1375883701.png",intern=TRUE)) character(0) > try(system("convert tmp/3l70g1375883701.ps tmp/3l70g1375883701.png",intern=TRUE)) character(0) > try(system("convert tmp/406su1375883701.ps tmp/406su1375883701.png",intern=TRUE)) character(0) > try(system("convert tmp/5fzy01375883701.ps tmp/5fzy01375883701.png",intern=TRUE)) character(0) > try(system("convert tmp/6kaes1375883701.ps tmp/6kaes1375883701.png",intern=TRUE)) character(0) > try(system("convert tmp/7km9i1375883701.ps tmp/7km9i1375883701.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.973 0.893 4.871