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(102.96,107.5,103.5,107.36,103.59,99.04,93.19,93.28,104.48,93.22,106.43,95.25,113.86,101.6,93.83,119.15,95.81,92.14,97.92,86.57,92.39,93.58,101.66,102.37,104.47,87.44,88.74,100.52,101.26,94.76,95.97,78.36,81.6,90.96,90.16,95.01,114.54,105.85,104.14,106.94,94.27,84.31,78.89,69.28,67.15,75.21,77.74,77.86,111.44,107.1,117.78,116.71,97.74,88.71,90.67,83.69,90.61,85.59,93.53,103.14,112.93,108.31,99.52,96.13,90.74,85.08,86.62,76.78,74.59,79.62,90.55,91.17,98.19,109.92,109.43,104.43,102.49,98.68,97.15,92.22,84.55,94.1,95.94,98.17,106.92,104.86,108.51,116.13,109.21,110,98.57,89.41,86.52,83.37,89.42,97.08,106.25,101.33,98.06,103.66,88.34,86.5,91,75.06,81.39,77.88,89.28,93.92,103.45,106.15,98.29,113.29,101.54,94.54,90.92,86.86,90.69,99.29,99.51,94.15) > 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] [1,] 102.96 113.86 104.47 114.54 111.44 112.93 98.19 106.92 106.25 103.45 [2,] 107.50 101.60 87.44 105.85 107.10 108.31 109.92 104.86 101.33 106.15 [3,] 103.50 93.83 88.74 104.14 117.78 99.52 109.43 108.51 98.06 98.29 [4,] 107.36 119.15 100.52 106.94 116.71 96.13 104.43 116.13 103.66 113.29 [5,] 103.59 95.81 101.26 94.27 97.74 90.74 102.49 109.21 88.34 101.54 [6,] 99.04 92.14 94.76 84.31 88.71 85.08 98.68 110.00 86.50 94.54 [7,] 93.19 97.92 95.97 78.89 90.67 86.62 97.15 98.57 91.00 90.92 [8,] 93.28 86.57 78.36 69.28 83.69 76.78 92.22 89.41 75.06 86.86 [9,] 104.48 92.39 81.60 67.15 90.61 74.59 84.55 86.52 81.39 90.69 [10,] 93.22 93.58 90.96 75.21 85.59 79.62 94.10 83.37 77.88 99.29 [11,] 106.43 101.66 90.16 77.74 93.53 90.55 95.94 89.42 89.28 99.51 [12,] 95.25 102.37 95.01 77.86 103.14 91.17 98.17 97.08 93.92 94.15 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 4.54 -12.26 -17.03 -8.69 -4.34 -4.62 11.73 -2.06 -4.92 2.70 NA [2,] -4.00 -7.77 1.30 -1.71 10.68 -8.79 -0.49 3.65 -3.27 -7.86 NA [3,] 3.86 25.32 11.78 2.80 -1.07 -3.39 -5.00 7.62 5.60 15.00 NA [4,] -3.77 -23.34 0.74 -12.67 -18.97 -5.39 -1.94 -6.92 -15.32 -11.75 NA [5,] -4.55 -3.67 -6.50 -9.96 -9.03 -5.66 -3.81 0.79 -1.84 -7.00 NA [6,] -5.85 5.78 1.21 -5.42 1.96 1.54 -1.53 -11.43 4.50 -3.62 NA [7,] 0.09 -11.35 -17.61 -9.61 -6.98 -9.84 -4.93 -9.16 -15.94 -4.06 NA [8,] 11.20 5.82 3.24 -2.13 6.92 -2.19 -7.67 -2.89 6.33 3.83 NA [9,] -11.26 1.19 9.36 8.06 -5.02 5.03 9.55 -3.15 -3.51 8.60 NA [10,] 13.21 8.08 -0.80 2.53 7.94 10.93 1.84 6.05 11.40 0.22 NA [11,] -11.18 0.71 4.85 0.12 9.61 0.62 2.23 7.66 4.64 -5.36 NA [12,] 18.61 2.10 19.53 33.58 9.79 7.02 8.75 9.17 9.53 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/1vrhd1457192324.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/2cwx41457192324.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/3b0x41457192324.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/4n9zz1457192324.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,] 98.190 101.33 88.74 96.13 88.34 84.31 86.620 69.28 74.590 75.210 [2,] 103.450 101.60 98.06 103.66 94.27 86.50 90.670 76.78 81.390 79.620 [3,] 106.585 106.00 101.51 107.15 99.50 93.34 92.095 85.13 85.535 88.275 [4,] 112.930 107.50 108.51 116.13 102.49 98.68 97.150 89.41 90.690 93.580 [5,] 114.540 109.92 117.78 119.15 109.21 110.00 98.570 93.28 104.480 99.290 [,11] [,12] [1,] 77.74 91.17 [2,] 89.42 93.92 [3,] 92.04 95.13 [4,] 99.51 98.17 [5,] 106.43 103.14 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.8484 103.0521 96.28876 100.9195 95.39296 87.25439 88.85733 78.81955 [2,] 111.3216 108.9479 106.73124 113.3805 103.60704 99.42561 95.33267 91.44045 [,9] [,10] [,11] [,12] [1,] 80.88835 81.30003 86.99863 93.00653 [2,] 90.18165 95.24997 97.08137 97.25347 $out [1] 87.44 78.89 67.15 77.86 $group [1] 2 7 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.19, 103.45, 106.585, 112.93, 114.54, 101.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nso01457192324.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] [1,] -17.03 -8.79 -5.00 -23.340 -9.960 -11.43 -17.610 -7.670 -11.26 -0.800 [2,] -8.69 -7.77 -1.07 -15.320 -7.000 -5.42 -11.350 -2.190 -3.51 1.840 [3,] -4.48 -2.49 4.73 -9.335 -5.105 -0.16 -9.385 3.535 3.11 6.995 [4,] 2.70 1.30 11.78 -3.770 -3.670 1.96 -4.930 6.330 8.60 10.930 [5,] 11.73 10.68 25.32 0.740 0.790 5.78 0.090 11.200 9.55 13.210 [,11] [,12] [1,] -5.36 2.10 [2,] 0.12 8.75 [3,] 1.47 9.53 [4,] 4.85 18.61 [5,] 9.61 19.53 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -10.170898 -7.021734 -1.690372 -15.105841 -6.768801 -3.847342 -12.592688 [2,] 1.210898 2.041734 11.150372 -3.564159 -3.441199 3.527342 -6.177312 [,8] [,9] [,10] [,11] [,12] [1,] -0.7219317 -2.940639 2.453274 -0.8932966 4.337067 [2,] 7.7919317 9.160639 11.536726 3.8332966 14.722933 $out [1] -11.18 33.58 $group [1] 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-17.03, -8.69000000000001, -4.48, 2.7, 11.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69ojr1457192324.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,] 93.190 86.570 78.360 67.150 83.690 74.590 84.55 83.370 75.060 [2,] 94.265 92.985 88.090 76.475 89.660 82.350 95.02 89.415 83.945 [3,] 103.230 96.865 92.860 81.600 95.635 90.645 98.18 101.715 90.140 [4,] 105.455 102.015 98.245 104.995 109.270 97.825 103.46 108.860 99.695 [5,] 107.500 113.860 104.470 114.540 117.780 112.930 109.92 116.130 106.250 [,10] [,11] [1,] 86.860 NA [2,] 92.535 NA [3,] 98.790 NA [4,] 102.495 NA [5,] 113.290 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.12617 92.74636 88.22824 68.59184 86.69075 83.58675 94.33046 92.846 [2,] 108.33383 100.98364 97.49176 94.60816 104.57925 97.70325 102.02954 110.584 [,9] [,10] [,11] [1,] 82.95632 94.24718 NA [2,] 97.32368 103.33282 NA $out [1] 119.15 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(93.19, 94.265, 103.23, 105.455, 107.5, 86.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7nds31457192324.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,] 83.151 85.1300 82.97375 [2,] 89.686 90.1575 89.70000 [3,] 94.117 94.2350 95.02437 [4,] 103.093 103.7550 103.83750 [5,] 108.432 107.1500 109.63625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 88.00198 88.03309 88.57617 [2,] 100.23202 100.43691 101.47258 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(83.151, 89.686, 94.117, 103.093, 108.432, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vrhd1457192324.ps tmp/1vrhd1457192324.png",intern=TRUE)) character(0) > try(system("convert tmp/2cwx41457192324.ps tmp/2cwx41457192324.png",intern=TRUE)) character(0) > try(system("convert tmp/3b0x41457192324.ps tmp/3b0x41457192324.png",intern=TRUE)) character(0) > try(system("convert tmp/4n9zz1457192324.ps tmp/4n9zz1457192324.png",intern=TRUE)) character(0) > try(system("convert tmp/5nso01457192324.ps tmp/5nso01457192324.png",intern=TRUE)) character(0) > try(system("convert tmp/69ojr1457192324.ps tmp/69ojr1457192324.png",intern=TRUE)) character(0) > try(system("convert tmp/7nds31457192324.ps tmp/7nds31457192324.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.389 0.432 2.846