R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 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(106.6,113.5,109.3,105.9,109.2,101.7,106.2,105.7,106.2,107.6,109,107.6,108.5,105.6,106,106.7,109.9,106.6,115.3,110.6,107.6,97.4,110.6,102.4,96.7,105.3,90.7,97.5,97.8,96,98.7,101.4,98.7,99.8,93,94.7,95.8,102.5,96.2,112.8,103.8,99,103.9,125.3,112.9,105.9,106.2,96.2,105.5,102.6,104.7,111,109.2,108.3,106.7,103.6,103.9,104.7,112.4,103.1,129.1,114.9,107.6,96.9,105.9,100.9,97.4,110.3,89,94.3,97.9,95.1,97.8,103.8,98.9,106.9,97.1,99.5,101.1,101.1,94.6,112.5,102.6,100.1,92.1,101.7,93.9,86,95.9,88.7,93.4,92.7,87.6,86.5,88.6,87.6,81.7,76.6,77.7,78.7,93.1,91.8,97.3,94.3,88.4,115.6,116.3,115.9,114.8,113,112.7,114.8,113.5,116.2,116.3,116.5,116.3,116.9,117.9,117.1,117.3,117.3,116.7,117.7,117.2,116.1) > 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] 126 > (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] 11 11 11 11 11 11 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 106.6 108.5 96.7 95.8 105.5 129.1 97.8 92.1 81.7 114.8 117.3 [2,] 113.5 105.6 105.3 102.5 102.6 114.9 103.8 101.7 76.6 113.0 117.3 [3,] 109.3 106.0 90.7 96.2 104.7 107.6 98.9 93.9 77.7 112.7 116.7 [4,] 105.9 106.7 97.5 112.8 111.0 96.9 106.9 86.0 78.7 114.8 117.7 [5,] 109.2 109.9 97.8 103.8 109.2 105.9 97.1 95.9 93.1 113.5 117.2 [6,] 101.7 106.6 96.0 99.0 108.3 100.9 99.5 88.7 91.8 116.2 116.1 [7,] 106.2 115.3 98.7 103.9 106.7 97.4 101.1 93.4 97.3 116.3 NA [8,] 105.7 110.6 101.4 125.3 103.6 110.3 101.1 92.7 94.3 116.5 NA [9,] 106.2 107.6 98.7 112.9 103.9 89.0 94.6 87.6 88.4 116.3 NA [10,] 107.6 97.4 99.8 105.9 104.7 94.3 112.5 86.5 115.6 116.9 NA [11,] 109.0 110.6 93.0 106.2 112.4 97.9 102.6 88.6 116.3 117.9 NA [12,] 107.6 102.4 94.7 96.2 103.1 95.1 100.1 87.6 115.9 117.1 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 6.9 -2.9 8.6 6.7 -2.9 -14.2 6.0 9.6 -5.1 -1.8 0.0 [2,] -4.2 0.4 -14.6 -6.3 2.1 -7.3 -4.9 -7.8 1.1 -0.3 -0.6 [3,] -3.4 0.7 6.8 16.6 6.3 -10.7 8.0 -7.9 1.0 2.1 1.0 [4,] 3.3 3.2 0.3 -9.0 -1.8 9.0 -9.8 9.9 14.4 -1.3 -0.5 [5,] -7.5 -3.3 -1.8 -4.8 -0.9 -5.0 2.4 -7.2 -1.3 2.7 -1.1 [6,] 4.5 8.7 2.7 4.9 -1.6 -3.5 1.6 4.7 5.5 0.1 NA [7,] -0.5 -4.7 2.7 21.4 -3.1 12.9 0.0 -0.7 -3.0 0.2 NA [8,] 0.5 -3.0 -2.7 -12.4 0.3 -21.3 -6.5 -5.1 -5.9 -0.2 NA [9,] 1.4 -10.2 1.1 -7.0 0.8 5.3 17.9 -1.1 27.2 0.6 NA [10,] 1.4 13.2 -6.8 0.3 7.7 3.6 -9.9 2.1 0.7 1.0 NA [11,] -1.4 -8.2 1.7 -10.0 -9.3 -2.8 -2.5 -1.0 -0.4 -0.8 NA [12,] 0.9 -5.7 1.1 9.3 26.0 2.7 -8.0 -5.9 -1.1 0.2 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/15vqs1457087360.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/21w8u1457087360.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/3r4nr1457087360.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/4gzpl1457087360.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] [1,] 81.70 101.70 77.70 78.7 93.10 88.70 93.4 92.70 87.6 86.5 88.6 [2,] 96.25 102.55 95.05 97.2 97.45 97.50 97.4 101.10 89.0 97.4 97.9 [3,] 105.50 105.30 104.70 106.7 105.90 100.90 102.5 104.65 101.3 105.3 107.6 [4,] 111.65 113.25 108.45 111.9 109.55 107.45 106.7 110.60 107.6 112.5 112.4 [5,] 129.10 117.30 116.70 117.7 117.20 116.20 116.3 116.50 116.3 116.9 117.9 [,12] [1,] 87.60 [2,] 95.10 [3,] 101.25 [4,] 107.60 [5,] 117.10 $n [1] 11 11 11 11 11 11 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.16363 100.2026 98.3164 99.6971 100.1357 96.15994 97.85335 [2,] 112.83637 110.3974 111.0836 113.7029 111.6643 105.64006 107.14665 [,8] [,9] [,10] [,11] [,12] [1,] 99.90342 92.0067 97.75544 100.3552 95.0045 [2,] 109.39658 110.5933 112.84456 114.8448 107.4955 $out [1] 76.6 125.3 $group [1] 2 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(81.7, 96.25, 105.5, 111.65, 129.1, 101.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51a8a1457087360.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,] -14.2 -14.60 -10.70 -9.80 -7.5 -3.5 -4.70 -12.40 -10.20 0.3 -10.00 -8.00 [2,] -2.9 -6.80 -1.35 -1.55 -4.9 0.1 -3.00 -6.50 -1.10 0.3 -8.20 -5.70 [3,] 0.0 -4.20 1.00 0.30 -1.8 3.6 -0.25 -4.05 0.95 1.2 -1.95 0.55 [4,] 6.8 0.05 6.55 6.15 -1.0 4.9 2.70 -0.20 5.30 3.6 -0.80 2.70 [5,] 9.6 2.10 16.60 14.40 2.7 8.7 2.70 0.50 5.30 7.7 1.70 9.30 $n [1] 11 11 11 11 11 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -4.620963 -7.4632573 -2.763465 -3.368187 -3.65791291 1.201729 -3.097947 [2,] 4.620963 -0.9367427 4.763465 3.968187 0.05791291 5.998271 2.597947 [,8] [,9] [,10] [,11] [,12] [1,] -7.1977312 -2.247695 -0.4488116 -5.647335 -3.646975 [2,] -0.9022688 4.147695 2.8488116 1.747335 4.746975 $out [1] 21.4 12.9 -21.3 17.9 27.2 13.2 -6.8 -9.9 26.0 $group [1] 7 7 8 9 9 10 10 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-14.2, -2.90000000000001, 0, 6.8, 9.60000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69jzn1457087360.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] [,10] [1,] 101.70 102.40 90.70 95.80 102.60 89.00 94.60 86.00 76.60 112.70 [2,] 106.05 105.80 95.35 97.60 103.75 96.00 98.35 87.60 80.20 114.15 [3,] 107.10 107.15 97.65 103.85 105.10 99.40 100.60 90.40 92.45 116.25 [4,] 109.10 110.25 99.25 109.50 108.75 108.95 103.20 93.65 106.45 116.70 [5,] 113.50 115.30 101.40 125.30 112.40 114.90 106.90 101.70 116.30 117.90 [,11] [1,] 116.10 [2,] 116.70 [3,] 117.25 [4,] 117.30 [5,] 117.70 $n [1] 12 12 12 12 12 12 12 12 12 12 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.7089 105.1203 95.87118 98.42233 102.8195 93.49342 98.38788 87.64055 [2,] 108.4911 109.1797 99.42882 109.27767 107.3805 105.30658 102.81212 93.15945 [,9] [,10] [,11] [1,] 80.4772 115.0869 116.863 [2,] 104.4228 117.4131 117.637 $out [1] 97.4 105.3 129.1 112.5 $group [1] 2 3 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(101.7, 106.05, 107.1, 109.1, 113.5, 102.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7gzls1457087360.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,] 100.5200 100.9 98.825 [2,] 102.1173 101.9 101.950 [3,] 103.8750 105.0 103.725 [4,] 104.9727 105.7 105.075 [5,] 106.1500 107.6 107.900 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 102.5726 103.2668 102.2997 [2,] 105.1774 106.7332 105.1503 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(100.52, 102.117272727273, 103.875, 104.972727272727, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15vqs1457087360.ps tmp/15vqs1457087360.png",intern=TRUE)) character(0) > try(system("convert tmp/21w8u1457087360.ps tmp/21w8u1457087360.png",intern=TRUE)) character(0) > try(system("convert tmp/3r4nr1457087360.ps tmp/3r4nr1457087360.png",intern=TRUE)) character(0) > try(system("convert tmp/4gzpl1457087360.ps tmp/4gzpl1457087360.png",intern=TRUE)) character(0) > try(system("convert tmp/51a8a1457087360.ps tmp/51a8a1457087360.png",intern=TRUE)) character(0) > try(system("convert tmp/69jzn1457087360.ps tmp/69jzn1457087360.png",intern=TRUE)) character(0) > try(system("convert tmp/7gzls1457087360.ps tmp/7gzls1457087360.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.402 0.368 2.801