R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(29312,29336,29357,29380,29402,29426,29448,29471,29495,29517,29540,29563,29586,29609,29631,29654,29677,29700,29723,29746,29769,29792,29815,29837,29861,29884,29905,29928,29951,29974,29996,30020,30043,30065,30089,30111,30134,30158,30179,30202,30224,30248,30270,30293,30317,30339,30362,30385,30408,30431,30452,30476,30498,30521,30544,30567,30590,30613,30636,30659,30682,30705,30727,30750,30773,30796,30818,30842,30865,30887,30911,30933,30956,30980,31001,31024,31046,31070,31092,31115,31139,31161,31184,31207,31230,31253,31274,31298,31320,31343,31366,31389,31412,31435,31458,31481,31504,31527,31548,31571,31594,31617,31640,31663,31686,31709,31732,31754) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > 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 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 29312 29586 29861 30134 30408 30682 30956 31230 31504 NA [2,] 29336 29609 29884 30158 30431 30705 30980 31253 31527 NA [3,] 29357 29631 29905 30179 30452 30727 31001 31274 31548 NA [4,] 29380 29654 29928 30202 30476 30750 31024 31298 31571 NA [5,] 29402 29677 29951 30224 30498 30773 31046 31320 31594 NA [6,] 29426 29700 29974 30248 30521 30796 31070 31343 31617 NA [7,] 29448 29723 29996 30270 30544 30818 31092 31366 31640 NA [8,] 29471 29746 30020 30293 30567 30842 31115 31389 31663 NA [9,] 29495 29769 30043 30317 30590 30865 31139 31412 31686 NA [10,] 29517 29792 30065 30339 30613 30887 31161 31435 31709 NA [11,] 29540 29815 30089 30362 30636 30911 31184 31458 31732 NA [12,] 29563 29837 30111 30385 30659 30933 31207 31481 31754 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 24 23 23 24 23 23 24 23 23 NA [2,] 21 22 21 21 21 22 21 21 21 NA [3,] 23 23 23 23 24 23 23 24 23 NA [4,] 22 23 23 22 22 23 22 22 23 NA [5,] 24 23 23 24 23 23 24 23 23 NA [6,] 22 23 22 22 23 22 22 23 23 NA [7,] 23 23 24 23 23 24 23 23 23 NA [8,] 24 23 23 24 23 23 24 23 23 NA [9,] 22 23 22 22 23 22 22 23 23 NA [10,] 23 23 24 23 23 24 23 23 23 NA [11,] 23 22 22 23 23 22 23 23 22 NA [12,] 23 24 23 23 23 23 23 23 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/1b3zj1471087497.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/2droc1471087497.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/3hwhc1471087497.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/49jrb1471087497.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] [,10] [,11] [,12] [1,] 29312 29336 29357 29380 29402 29426 29448 29471 29495 29517 29540 29563 [2,] 29861 29884 29905 29928 29951 29974 29996 30020 30043 30065 30089 30111 [3,] 30408 30431 30452 30476 30498 30521 30544 30567 30590 30613 30636 30659 [4,] 30956 30980 31001 31024 31046 31070 31092 31115 31139 31161 31184 31207 [5,] 31504 31527 31548 31571 31594 31617 31640 31663 31686 31709 31732 31754 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 29831.3 29853.77 29874.77 29898.77 29921.3 29943.77 29966.77 29990.3 [2,] 30984.7 31008.23 31029.23 31053.23 31074.7 31098.23 31121.23 31143.7 [,9] [,10] [,11] [,12] [1,] 30012.77 30035.77 30059.3 30081.77 [2,] 31167.23 31190.23 31212.7 31236.23 $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(29312, 29861, 30408, 30956, 31504, 29336, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5af851471087497.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] [,9] [,10] [,11] [,12] [1,] 23 21 23 22 23 22 23 23 22 23 22 23 [2,] 23 21 23 22 23 22 23 23 22 23 22 23 [3,] 23 21 23 22 23 22 23 23 22 23 23 23 [4,] 24 21 23 23 24 23 23 24 23 23 23 23 [5,] 24 21 23 23 24 23 23 24 23 23 23 23 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 22.47333 21 23 21.47333 22.47333 21.47333 23 22.47333 21.47333 23 [2,] 23.52667 21 23 22.52667 23.52667 22.52667 23 23.52667 22.52667 23 [,11] [,12] [1,] 22.47333 23 [2,] 23.52667 23 $out [1] 22 22 24 24 24 24 24 24 24 $group [1] 2 2 3 3 7 7 10 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(23, 23, 23, 24, 24, 21, 21, 21, 21, 21, 23, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xy861471087497.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,] 29312.0 29586.0 29861.0 30134.0 30408.0 30682.0 30956.0 31230.0 31504.0 [2,] 29368.5 29642.5 29916.5 30190.5 30464.0 30738.5 31012.5 31286.0 31559.5 [3,] 29437.0 29711.5 29985.0 30259.0 30532.5 30807.0 31081.0 31354.5 31628.5 [4,] 29506.0 29780.5 30054.0 30328.0 30601.5 30876.0 31150.0 31423.5 31697.5 [5,] 29563.0 29837.0 30111.0 30385.0 30659.0 30933.0 31207.0 31481.0 31754.0 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 29374.29 29648.56 29922.29 30196.29 30469.79 30744.29 31018.29 31291.79 [2,] 29499.71 29774.44 30047.71 30321.71 30595.21 30869.71 31143.71 31417.21 [,9] [,10] [1,] 31565.56 NA [2,] 31691.44 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/779pt1471087497.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,] 30408.11 30408.0 30408.5 [2,] 30464.28 30464.0 30464.5 [3,] 30532.89 30532.5 30533.0 [4,] 30601.89 30601.5 30602.0 [5,] 30658.89 30659.0 30659.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 30470.12 30469.79 30470.29 [2,] 30595.65 30595.21 30595.71 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1b3zj1471087497.ps tmp/1b3zj1471087497.png",intern=TRUE)) character(0) > try(system("convert tmp/2droc1471087497.ps tmp/2droc1471087497.png",intern=TRUE)) character(0) > try(system("convert tmp/3hwhc1471087497.ps tmp/3hwhc1471087497.png",intern=TRUE)) character(0) > try(system("convert tmp/49jrb1471087497.ps tmp/49jrb1471087497.png",intern=TRUE)) character(0) > try(system("convert tmp/5af851471087497.ps tmp/5af851471087497.png",intern=TRUE)) character(0) > try(system("convert tmp/6xy861471087497.ps tmp/6xy861471087497.png",intern=TRUE)) character(0) > try(system("convert tmp/779pt1471087497.ps tmp/779pt1471087497.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.496 0.272 2.815