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(78.21,75.50,79.87,85.76,77.02,75.47,75.29,77.52,78.44,83.50,86.29,92.14,96.91,104.23,114.60,122.09,114.52,113.77,117.03,109.84,109.90,108.74,110.49,107.82,111.26,119.06,124.54,120.60,110.28,95.93,102.72,112.68,113.03,111.48,109.56,109.16,112.32,116.08,109.63,109.63,103.27,103.32,107.38,110.45,111.24,109.44,107.94,110.58,107.31,108.70,107.70,108.08,109.32,111.95,108.07,103.38,98.54,88.16,79.70,63.30) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 78.21 96.91 111.26 112.32 107.31 NA [2,] 75.50 104.23 119.06 116.08 108.70 NA [3,] 79.87 114.60 124.54 109.63 107.70 NA [4,] 85.76 122.09 120.60 109.63 108.08 NA [5,] 77.02 114.52 110.28 103.27 109.32 NA [6,] 75.47 113.77 95.93 103.32 111.95 NA [7,] 75.29 117.03 102.72 107.38 108.07 NA [8,] 77.52 109.84 112.68 110.45 103.38 NA [9,] 78.44 109.90 113.03 111.24 98.54 NA [10,] 83.50 108.74 111.48 109.44 88.16 NA [11,] 86.29 110.49 109.56 107.94 79.70 NA [12,] 92.14 107.82 109.16 110.58 63.30 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -2.71 7.32 7.80 3.76 1.39 NA [2,] 4.37 10.37 5.48 -6.45 -1.00 NA [3,] 5.89 7.49 -3.94 0.00 0.38 NA [4,] -8.74 -7.57 -10.32 -6.36 1.24 NA [5,] -1.55 -0.75 -14.35 0.05 2.63 NA [6,] -0.18 3.26 6.79 4.06 -3.88 NA [7,] 2.23 -7.19 9.96 3.07 -4.69 NA [8,] 0.92 0.06 0.35 0.79 -4.84 NA [9,] 5.06 -1.16 -1.55 -1.80 -10.38 NA [10,] 2.79 1.75 -1.92 -1.50 -8.46 NA [11,] 5.85 -2.67 -0.40 2.64 -16.40 NA [12,] 4.77 3.44 3.16 -3.27 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/1cd6y1457112160.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/2fjl81457112160.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/3y12k1457112160.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/49rvz1457112160.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] [1,] 78.21 104.23 107.70 108.08 103.27 75.47 102.72 103.38 98.54 83.50 [2,] 96.91 104.23 107.70 108.08 103.27 95.93 102.72 103.38 98.54 88.16 [3,] 107.31 108.70 109.63 109.63 109.32 103.32 107.38 109.84 109.90 108.74 [4,] 111.26 116.08 114.60 120.60 110.28 111.95 108.07 110.45 111.24 109.44 [5,] 112.32 119.06 124.54 122.09 114.52 113.77 108.07 112.68 113.03 111.48 [,11] [,12] [1,] 79.70 92.14 [2,] 86.29 92.14 [3,] 107.94 107.82 [4,] 109.56 109.16 [5,] 110.49 110.58 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 97.17033 100.3268 104.7545 100.7834 104.3668 92.00031 103.5997 104.8444 [2,] 117.44967 117.0732 114.5055 118.4766 114.2732 114.63969 111.1603 114.8356 [,9] [,10] [,11] [,12] [1,] 100.9262 93.70361 91.49748 95.79371 [2,] 118.8738 123.77639 124.38252 119.84629 $out [1] 75.50 79.87 85.76 77.02 75.29 117.03 77.52 78.44 63.30 $group [1] 2 3 4 5 7 7 8 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(78.21, 96.91, 107.31, 111.26, 112.32, 104.23, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wn661457112160.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,] -2.71 -6.45 -3.94 -10.32 -1.55 -3.88 -7.19 0.06 -1.80 -1.92 -2.67 -3.270 [2,] 1.39 -1.00 0.00 -8.74 -1.55 -0.18 -4.69 0.06 -1.80 -1.92 -2.67 -0.055 [3,] 3.76 4.37 0.38 -7.57 -0.75 3.26 2.23 0.35 -1.55 -1.50 -0.40 3.300 [4,] 7.32 5.48 5.89 -6.36 0.05 4.06 3.07 0.79 -1.16 1.75 2.64 4.105 [5,] 7.80 10.37 7.49 -6.36 0.05 6.79 9.96 0.92 -1.16 2.79 5.85 4.770 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.4301231 -0.2087517 -3.781859 -9.251702 -1.880556 0.2640267 -3.253196 [2,] 7.9501231 8.9487517 4.541859 -5.888298 0.380556 6.2559733 7.713196 [,8] [,9] [,10] [,11] [,12] [1,] -0.1658162 -2.002222 -4.093213 -4.152033 0.0136 [2,] 0.8658162 -1.097778 1.093213 3.352033 6.5864 $out [1] 1.24 -14.35 2.63 -4.84 5.06 -10.38 -8.46 -16.40 $group [1] 4 5 5 8 9 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.70999999999999, 1.39, 3.76000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6oo4v1457112160.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] [1,] 75.290 104.230 102.720 103.27 79.700 NA [2,] 76.260 108.280 109.360 107.66 93.350 NA [3,] 78.325 110.195 111.370 109.63 107.505 NA [4,] 84.630 114.560 116.045 110.91 108.390 NA [5,] 92.140 122.090 124.540 112.32 111.950 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 74.50739 107.3306 108.3209 108.1477 100.6452 NA [2,] 82.14261 113.0594 114.4191 111.1123 114.3648 NA $out [1] 96.91 95.93 116.08 63.30 $group [1] 2 3 4 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(75.29, 76.26, 78.325, 84.63, 92.14, 104.23, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7kwya1457112160.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,] 96.600 107.31 97.9250 [2,] 100.176 107.60 102.2950 [3,] 102.164 108.72 105.1425 [4,] 103.798 109.63 108.5350 [5,] 107.268 109.90 114.3400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 100.512 107.7941 102.2964 [2,] 103.816 109.6459 107.9886 $out [1] 109.232 103.320 $group [1] 1 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(96.6, 100.176, 102.164, 103.798, 107.268, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cd6y1457112160.ps tmp/1cd6y1457112160.png",intern=TRUE)) character(0) > try(system("convert tmp/2fjl81457112160.ps tmp/2fjl81457112160.png",intern=TRUE)) character(0) > try(system("convert tmp/3y12k1457112160.ps tmp/3y12k1457112160.png",intern=TRUE)) character(0) > try(system("convert tmp/49rvz1457112160.ps tmp/49rvz1457112160.png",intern=TRUE)) character(0) > try(system("convert tmp/5wn661457112160.ps tmp/5wn661457112160.png",intern=TRUE)) character(0) > try(system("convert tmp/6oo4v1457112160.ps tmp/6oo4v1457112160.png",intern=TRUE)) character(0) > try(system("convert tmp/7kwya1457112160.ps tmp/7kwya1457112160.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.539 0.432 2.998