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(6195800,6172725,6149325,6100900,6579950,6554600,6195800,5957250,5980325,5980325,6006000,6052150,6123975,6123975,6077825,5957250,6579950,6674850,6531525,6195800,6339450,6123975,6221150,6267625,6316050,6195800,6221150,6052150,6579950,6746675,6603350,6339450,6626425,6316050,6603350,6579950,6651775,6387875,6674850,6651775,7082400,6985225,6603350,6410950,6674850,6316050,6579950,6626425,6723600,6508450,6626425,6698250,6962150,6746675,6459700,6149325,6436625,5646875,6029075,6244225,6459700,6149325,6149325,6149325,6316050,6077825,5765175,5503550,5693350,4952350,5406375,5670275,5718700,5454800,5477875,5406375,5646875,5477875,5144750,4903925,5311150,4426825,5001100,5262725,5262725,4952350,4665375,4642300,4903925,4665375,4211675,3899025,4234750,3445325,4162925,4544800,4665375,4401475,4068025,4306575,4401475,4329650,3611725,3278600,3516825,2799225,3540225,3804125,4019275,3660475,3324750,3516825,3611725,3421925,2704325,2391675,2678650,1889225,2750475,3278600) > 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] [,9] [1,] 6195800 6123975 6316050 6651775 6723600 6459700 5718700 5262725 4665375 [2,] 6172725 6123975 6195800 6387875 6508450 6149325 5454800 4952350 4401475 [3,] 6149325 6077825 6221150 6674850 6626425 6149325 5477875 4665375 4068025 [4,] 6100900 5957250 6052150 6651775 6698250 6149325 5406375 4642300 4306575 [5,] 6579950 6579950 6579950 7082400 6962150 6316050 5646875 4903925 4401475 [6,] 6554600 6674850 6746675 6985225 6746675 6077825 5477875 4665375 4329650 [7,] 6195800 6531525 6603350 6603350 6459700 5765175 5144750 4211675 3611725 [8,] 5957250 6195800 6339450 6410950 6149325 5503550 4903925 3899025 3278600 [9,] 5980325 6339450 6626425 6674850 6436625 5693350 5311150 4234750 3516825 [10,] 5980325 6123975 6316050 6316050 5646875 4952350 4426825 3445325 2799225 [11,] 6006000 6221150 6603350 6579950 6029075 5406375 5001100 4162925 3540225 [12,] 6052150 6267625 6579950 6626425 6244225 5670275 5262725 4544800 3804125 [,10] [,11] [1,] 4019275 NA [2,] 3660475 NA [3,] 3324750 NA [4,] 3516825 NA [5,] 3611725 NA [6,] 3421925 NA [7,] 2704325 NA [8,] 2391675 NA [9,] 2678650 NA [10,] 1889225 NA [11,] 2750475 NA [12,] 3278600 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -23075 0 -120250 -263900 -215150 -310375 -263900 -310375 -263900 [2,] -23400 -46150 25350 286975 117975 0 23075 -286975 -333450 [3,] -48425 -120575 -169000 -23075 71825 0 -71500 -23075 238550 [4,] 479050 622700 527800 430625 263900 166725 240500 261625 94900 [5,] -25350 94900 166725 -97175 -215475 -238225 -169000 -238550 -71825 [6,] -358800 -143325 -143325 -381875 -286975 -312650 -333125 -453700 -717925 [7,] -238550 -335725 -263900 -192400 -310375 -261625 -240825 -312650 -333125 [8,] 23075 143650 286975 263900 287300 189800 407225 335725 238225 [9,] 0 -215475 -310375 -358800 -789750 -741000 -884325 -789425 -717600 [10,] 25675 97175 287300 263900 382200 454025 574275 717600 741000 [11,] 46150 46475 -23400 46475 215150 263900 261625 381875 263900 [12,] 71825 48425 71825 97175 215475 48425 0 120575 215150 [,10] [,11] [1,] -358800 NA [2,] -335725 NA [3,] 192075 NA [4,] 94900 NA [5,] -189800 NA [6,] -717600 NA [7,] -312650 NA [8,] 286975 NA [9,] -789425 NA [10,] 861250 NA [11,] 528125 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/wessaorg/rcomp/tmp/1kjx31439545571.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/2afgw1439545571.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/32d2d1439545571.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/4umwe1439545571.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,] 4019275 3660475 3324750 3516825 3611725 3421925 2704325 2391675 2678650 [2,] 5262725 4952350 4665375 4642300 4903925 4665375 4211675 3899025 4234750 [3,] 6159888 6136650 6113575 6004700 6448000 6316212 5980488 5730400 5836838 [4,] 6459700 6195800 6221150 6149325 6579950 6746675 6531525 6195800 6436625 [5,] 6723600 6508450 6674850 6698250 7082400 6985225 6603350 6410950 6674850 [,10] [,11] [,12] [1,] 1889225 2750475 3278600 [2,] 3445325 4162925 4544800 [3,] 5299612 5706188 5861212 [4,] 6123975 6221150 6267625 [5,] 6316050 6603350 6626425 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 5561831 5515373 5336248 5251730 5610591 5276312 4821398 4582840 4736693 [2,] 6757944 6757927 6890902 6757670 7285409 7356113 7139577 6877960 6936982 [,10] [,11] [,12] [1,] 3961252 4677816 5000420 [2,] 6637973 6734559 6722005 $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(4019275, 5262725, 6159887.5, 6459700, 6723600, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54pdp1439545571.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,] -358800 -335725 -169000 94900.0 -238550.0 -453700.0 -335725.0 143650.0 [2,] -310375 -286975 -71500 166725.0 -215475.0 -453700.0 -312650.0 189800.0 [3,] -263900 -11700 -23075 262762.5 -133087.5 -345962.5 -287137.5 275437.5 [4,] -120250 25350 71825 479050.0 -25350.0 -286975.0 -240825.0 287300.0 [5,] 0 286975 238550 622700.0 166725.0 -143325.0 -192400.0 407225.0 [,9] [,10] [,11] [,12] [1,] -884325 25675.0 -23400.0 0 [2,] -789425 263900.0 46475.0 48425 [3,] -729300 418112.5 238387.5 71825 [4,] -310375 717600.0 263900.0 120575 [5,] 0 861250.0 528125.0 215475 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -358894 -167750 -94685.88 106712.5 -228081.53 -429265 -323024.1 226722.6 [2,] -168906 144350 48535.88 418812.5 -38093.47 -262660 -251250.9 324152.4 [,9] [,10] [,11] [,12] [1,] -968652.5 191425.9 129753.3 33826 [2,] -489947.5 644799.1 347021.7 109824 $out [1] -717925 -717600 23075 $group [1] 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-358800, -310375, -263900, -120250, 0, -335725, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67zoh1439545571.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,] 5957250 5957250 6052150 6316050 5646875 4952350 4903925 3445325 2799225 [2,] 5993162 6123975 6268600 6495450 6196775 5586912 5072925 4187300 3528525 [3,] 6125112 6208475 6459700 6639100 6484075 5921500 5358762 4593550 3936075 [4,] 6195800 6435488 6603350 6674850 6710925 6149325 5477875 4784650 4365562 [5,] 6195800 6674850 6746675 6674850 6962150 6459700 5718700 5262725 4665375 [,10] [,11] [1,] 1889225 NA [2,] 2691488 NA [3,] 3301675 NA [4,] 3564275 NA [5,] 4019275 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 6032688 6066392 6307018 6557274 6249568 5664980 5174062 4321095 3554297 [2,] 6217537 6350558 6612382 6720926 6718582 6178020 5543463 4866005 4317853 [,10] [,11] [1,] 2903591 NA [2,] 3699759 NA $out [1] 6579950 6554600 7082400 6985225 4426825 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(5957250, 5993162.5, 6125112.5, 6195800, 6195800, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ikhj1439545571.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,] 4789622 5299612 4889381 [2,] 5289651 5783619 5365445 [3,] 5488291 5992594 5489148 [4,] 5684396 6148269 5716303 [5,] 5866445 6448000 5900253 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5308245 5826274 5329120 [2,] 5668337 6158913 5649177 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(4789622.5, 5289651.25, 5488291.25, 5684396.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1kjx31439545571.ps tmp/1kjx31439545571.png",intern=TRUE)) character(0) > try(system("convert tmp/2afgw1439545571.ps tmp/2afgw1439545571.png",intern=TRUE)) character(0) > try(system("convert tmp/32d2d1439545571.ps tmp/32d2d1439545571.png",intern=TRUE)) character(0) > try(system("convert tmp/4umwe1439545571.ps tmp/4umwe1439545571.png",intern=TRUE)) character(0) > try(system("convert tmp/54pdp1439545571.ps tmp/54pdp1439545571.png",intern=TRUE)) character(0) > try(system("convert tmp/67zoh1439545571.ps tmp/67zoh1439545571.png",intern=TRUE)) character(0) > try(system("convert tmp/7ikhj1439545571.ps tmp/7ikhj1439545571.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.445 0.456 2.936