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(82.6,85.99,86.85,86.12,97.19,89.8,90.27,90.68,90.05,90.28,91.52,88.3,85.31,87.86,87.77,88.44,88.73,94.4,94.09,90.32,89.68,94.15,95.2,91.82,90.33,95.14,96.06,97.21,100.33,98.79,102.48,99.29,98.83,97.25,94.55,93.53,93.58,95.79,94.77,94.2,96.23,92.3,88.86,86.44,86.21,88.57,90.69,89,86.88,90.65,90.68,89.64,102.62,101.84,92.51,94.29,94.68,96.94,94.03,89.65,84.9,89.07,89.8,93.22,92.23,98.41,96.63,89.8,90,92.13,93.27,90.81,85.42,88.28,88.73,90.18,92.74,96.13,94.85,94.25,96.94,101.22,98.71,95.51,93.91,98.17,97.59,99.64,107.88,108.49,100.25,99.27,101.73,101.25,97.09,94.74,94.53,93.48,96.05,106.22,98.33,99.86,93.78,88.96,83.77,89.46,86.78,88.4,87.19,92.23,95.99,104.75,105.63,108.71,96.4,93.31,93.77,98.7,95.04,95.61) > 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] 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] [,10] [,11] [1,] 82.60 85.31 90.33 93.58 86.88 84.90 85.42 93.91 94.53 87.19 NA [2,] 85.99 87.86 95.14 95.79 90.65 89.07 88.28 98.17 93.48 92.23 NA [3,] 86.85 87.77 96.06 94.77 90.68 89.80 88.73 97.59 96.05 95.99 NA [4,] 86.12 88.44 97.21 94.20 89.64 93.22 90.18 99.64 106.22 104.75 NA [5,] 97.19 88.73 100.33 96.23 102.62 92.23 92.74 107.88 98.33 105.63 NA [6,] 89.80 94.40 98.79 92.30 101.84 98.41 96.13 108.49 99.86 108.71 NA [7,] 90.27 94.09 102.48 88.86 92.51 96.63 94.85 100.25 93.78 96.40 NA [8,] 90.68 90.32 99.29 86.44 94.29 89.80 94.25 99.27 88.96 93.31 NA [9,] 90.05 89.68 98.83 86.21 94.68 90.00 96.94 101.73 83.77 93.77 NA [10,] 90.28 94.15 97.25 88.57 96.94 92.13 101.22 101.25 89.46 98.70 NA [11,] 91.52 95.20 94.55 90.69 94.03 93.27 98.71 97.09 86.78 95.04 NA [12,] 88.30 91.82 93.53 89.00 89.65 90.81 95.51 94.74 88.40 95.61 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 3.39 2.55 4.81 2.21 3.77 4.17 2.86 4.26 -1.05 5.04 NA [2,] 0.86 -0.09 0.92 -1.02 0.03 0.73 0.45 -0.58 2.57 3.76 NA [3,] -0.73 0.67 1.15 -0.57 -1.04 3.42 1.45 2.05 10.17 8.76 NA [4,] 11.07 0.29 3.12 2.03 12.98 -0.99 2.56 8.24 -7.89 0.88 NA [5,] -7.39 5.67 -1.54 -3.93 -0.78 6.18 3.39 0.61 1.53 3.08 NA [6,] 0.47 -0.31 3.69 -3.44 -9.33 -1.78 -1.28 -8.24 -6.08 -12.31 NA [7,] 0.41 -3.77 -3.19 -2.42 1.78 -6.83 -0.60 -0.98 -4.82 -3.09 NA [8,] -0.63 -0.64 -0.46 -0.23 0.39 0.20 2.69 2.46 -5.19 0.46 NA [9,] 0.23 4.47 -1.58 2.36 2.26 2.13 4.28 -0.48 5.69 4.93 NA [10,] 1.24 1.05 -2.70 2.12 -2.91 1.14 -2.51 -4.16 -2.68 -3.66 NA [11,] -3.22 -3.38 -1.02 -1.69 -4.38 -2.46 -3.20 -2.35 1.62 0.57 NA [12,] -2.99 -1.49 0.05 -2.12 -4.75 -5.39 -1.60 -0.21 -1.21 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/1zccv1457461648.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/2iowi1457461648.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/3yo7x1457461648.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/42yyj1457461648.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,] 82.600 85.99 86.850 86.12 88.73 89.80 88.86 86.440 83.77 88.570 [2,] 85.310 88.28 88.730 89.64 92.74 94.40 92.51 89.800 89.68 90.280 [3,] 87.035 91.44 92.725 93.71 97.76 98.60 94.47 91.995 91.91 95.545 [4,] 93.580 95.14 96.050 99.64 102.62 101.84 96.63 94.290 96.94 98.700 [5,] 94.530 98.17 97.590 106.22 107.88 108.71 102.48 99.290 101.73 101.250 [,11] [,12] [1,] 86.78 88.300 [2,] 91.52 89.000 [3,] 94.29 91.315 [4,] 95.20 94.740 [5,] 98.71 95.610 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 82.90298 88.01247 89.06764 88.7136 92.82356 94.88268 92.41148 89.75162 [2,] 91.16702 94.86753 96.38236 98.7064 102.69644 102.31732 96.52852 94.23838 [,9] [,10] [,11] [,12] [1,] 88.28261 91.33803 92.45133 88.44707 [2,] 95.53739 99.75197 96.12867 94.18293 $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(82.6, 85.31, 87.035, 93.58, 94.53, 85.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5a0rj1457461648.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] [1,] 2.21 -1.02 -1.04 -7.890 -7.39 -12.31 -6.830 -0.640 -1.58 -4.160 -4.380 [2,] 2.55 -0.09 -0.57 0.290 -1.54 -8.24 -3.770 -0.630 0.23 -2.910 -3.220 [3,] 3.58 0.59 1.30 2.295 1.07 -2.61 -2.755 -0.015 2.31 -2.595 -2.405 [4,] 4.26 0.92 3.42 8.240 3.39 -0.31 -0.600 0.460 4.47 1.140 -1.020 [5,] 5.04 0.92 8.76 12.980 6.18 3.69 1.780 0.460 5.69 2.120 1.620 [,12] [1,] -5.39 [2,] -2.99 [3,] -1.60 [4,] -1.21 [5,] 0.05 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.725616 0.08536373 -0.6935631 -1.677137 -1.393225 -6.572144 -4.338858 [2,] 4.434384 1.09463627 3.2935631 6.267137 3.533225 1.352144 -1.171142 [,8] [,9] [,10] [,11] [,12] [1,] -0.5596075 0.1915269 -4.6185415 -3.504208 -2.5374667 [2,] 0.5296075 4.4284731 -0.5714585 -1.305792 -0.6625333 $out [1] -1.05 2.57 3.76 10.17 2.69 2.46 -5.19 $group [1] 1 2 2 3 8 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2.21000000000001, 2.55, 3.58000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6by561457461648.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,] 82.600 85.31 90.330 86.210 86.88 84.900 85.420 93.910 83.77 87.190 [2,] 86.485 88.15 94.845 88.715 90.15 89.800 89.455 97.340 88.68 93.540 [3,] 89.925 90.00 97.230 91.495 93.27 91.470 94.550 99.455 93.63 95.800 [4,] 90.480 94.12 99.060 94.485 95.81 93.245 96.535 101.490 97.19 101.725 [5,] 91.520 95.20 102.480 96.230 102.62 98.410 101.220 101.730 106.22 108.710 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 88.10285 87.27704 95.30751 88.86326 90.68844 89.89871 91.32076 97.56216 [2,] 91.74715 92.72296 99.15249 94.12674 95.85156 93.04129 97.77924 101.34784 [,9] [,10] [,11] [1,] 89.74853 92.06677 NA [2,] 97.51147 99.53323 NA $out [1] 97.19 107.88 108.49 $group [1] 1 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(82.6, 86.485, 89.925, 90.48, 91.52, 85.31, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7kalv1457461648.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,] 88.4650 87.0350 89.05250 [2,] 92.0830 91.6750 91.95250 [3,] 93.1745 93.2175 93.31312 [4,] 95.0035 95.0075 94.62000 [5,] 98.8730 98.6000 98.08875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 91.84244 91.69752 92.09646 [2,] 94.50656 94.73748 94.52979 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(88.465, 92.083, 93.1745, 95.0035, 98.873, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zccv1457461648.ps tmp/1zccv1457461648.png",intern=TRUE)) character(0) > try(system("convert tmp/2iowi1457461648.ps tmp/2iowi1457461648.png",intern=TRUE)) character(0) > try(system("convert tmp/3yo7x1457461648.ps tmp/3yo7x1457461648.png",intern=TRUE)) character(0) > try(system("convert tmp/42yyj1457461648.ps tmp/42yyj1457461648.png",intern=TRUE)) character(0) > try(system("convert tmp/5a0rj1457461648.ps tmp/5a0rj1457461648.png",intern=TRUE)) character(0) > try(system("convert tmp/6by561457461648.ps tmp/6by561457461648.png",intern=TRUE)) character(0) > try(system("convert tmp/7kalv1457461648.ps tmp/7kalv1457461648.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.466 0.375 2.865