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 = '48' > par1 <- '48' > #'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] 2 > 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] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 [39] 2 2 2 2 2 2 2 2 2 2 > arr [,1] [,2] [,3] [1,] 102.96 111.44 106.25 [2,] 107.50 107.10 101.33 [3,] 103.50 117.78 98.06 [4,] 107.36 116.71 103.66 [5,] 103.59 97.74 88.34 [6,] 99.04 88.71 86.50 [7,] 93.19 90.67 91.00 [8,] 93.28 83.69 75.06 [9,] 104.48 90.61 81.39 [10,] 93.22 85.59 77.88 [11,] 106.43 93.53 89.28 [12,] 95.25 103.14 93.92 [13,] 113.86 112.93 103.45 [14,] 101.60 108.31 106.15 [15,] 93.83 99.52 98.29 [16,] 119.15 96.13 113.29 [17,] 95.81 90.74 101.54 [18,] 92.14 85.08 94.54 [19,] 97.92 86.62 90.92 [20,] 86.57 76.78 86.86 [21,] 92.39 74.59 90.69 [22,] 93.58 79.62 99.29 [23,] 101.66 90.55 99.51 [24,] 102.37 91.17 94.15 [25,] 104.47 98.19 NA [26,] 87.44 109.92 NA [27,] 88.74 109.43 NA [28,] 100.52 104.43 NA [29,] 101.26 102.49 NA [30,] 94.76 98.68 NA [31,] 95.97 97.15 NA [32,] 78.36 92.22 NA [33,] 81.60 84.55 NA [34,] 90.96 94.10 NA [35,] 90.16 95.94 NA [36,] 95.01 98.17 NA [37,] 114.54 106.92 NA [38,] 105.85 104.86 NA [39,] 104.14 108.51 NA [40,] 106.94 116.13 NA [41,] 94.27 109.21 NA [42,] 84.31 110.00 NA [43,] 78.89 98.57 NA [44,] 69.28 89.41 NA [45,] 67.15 86.52 NA [46,] 75.21 83.37 NA [47,] 77.74 89.42 NA [48,] 77.86 97.08 NA > darr [,1] [,2] [,3] [1,] 4.54 -4.34 -4.92 [2,] -4.00 10.68 -3.27 [3,] 3.86 -1.07 5.60 [4,] -3.77 -18.97 -15.32 [5,] -4.55 -9.03 -1.84 [6,] -5.85 1.96 4.50 [7,] 0.09 -6.98 -15.94 [8,] 11.20 6.92 6.33 [9,] -11.26 -5.02 -3.51 [10,] 13.21 7.94 11.40 [11,] -11.18 9.61 4.64 [12,] 18.61 9.79 9.53 [13,] -12.26 -4.62 2.70 [14,] -7.77 -8.79 -7.86 [15,] 25.32 -3.39 15.00 [16,] -23.34 -5.39 -11.75 [17,] -3.67 -5.66 -7.00 [18,] 5.78 1.54 -3.62 [19,] -11.35 -9.84 -4.06 [20,] 5.82 -2.19 3.83 [21,] 1.19 5.03 8.60 [22,] 8.08 10.93 0.22 [23,] 0.71 0.62 -5.36 [24,] 2.10 7.02 NA [25,] -17.03 11.73 NA [26,] 1.30 -0.49 NA [27,] 11.78 -5.00 NA [28,] 0.74 -1.94 NA [29,] -6.50 -3.81 NA [30,] 1.21 -1.53 NA [31,] -17.61 -4.93 NA [32,] 3.24 -7.67 NA [33,] 9.36 9.55 NA [34,] -0.80 1.84 NA [35,] 4.85 2.23 NA [36,] 19.53 8.75 NA [37,] -8.69 -2.06 NA [38,] -1.71 3.65 NA [39,] 2.80 7.62 NA [40,] -12.67 -6.92 NA [41,] -9.96 0.79 NA [42,] -5.42 -11.43 NA [43,] -9.61 -9.16 NA [44,] -2.13 -2.89 NA [45,] 8.06 -3.15 NA [46,] 2.53 6.05 NA [47,] 0.12 7.66 NA [48,] 33.58 9.17 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/13eo01457366960.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/2r2ko1457366960.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/337qr1457366960.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/497r81457366960.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,] 102.960 101.330 98.06 103.660 88.340 86.500 90.670 75.060 81.390 77.880 [2,] 104.605 104.215 100.78 105.510 93.040 87.605 90.835 79.375 86.000 81.735 [3,] 106.250 107.100 103.50 107.360 97.740 88.710 91.000 83.690 90.610 85.590 [4,] 108.845 107.300 110.64 112.035 100.665 93.875 92.095 88.485 97.545 89.405 [5,] 111.440 107.500 117.78 116.710 103.590 99.040 93.190 93.280 104.480 93.220 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 89.280 93.920 103.450 101.600 93.830 96.13 90.740 85.08 86.62 76.780 [2,] 91.405 94.585 108.190 103.875 96.060 104.71 93.275 88.61 88.77 81.675 [3,] 93.530 95.250 112.930 106.150 98.290 113.29 95.810 92.14 90.92 86.570 [4,] 99.980 99.195 113.395 107.230 98.905 116.22 98.675 93.34 94.42 86.715 [5,] 106.430 103.140 113.860 108.310 99.520 119.15 101.540 94.54 97.92 86.860 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 74.59 79.620 90.550 91.17 98.19 87.44 88.740 100.520 101.260 94.76 [2,] 82.64 86.600 95.030 92.66 98.19 87.44 88.740 100.520 101.260 94.76 [3,] 90.69 93.580 99.510 94.15 101.33 98.68 99.085 102.475 101.875 96.72 [4,] 91.54 96.435 100.585 98.26 104.47 109.92 109.430 104.430 102.490 98.68 [5,] 92.39 99.290 101.660 102.37 104.47 109.92 109.430 104.430 102.490 98.68 [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [1,] 95.97 78.36 81.600 90.96 90.16 95.01 106.92 104.860 104.140 106.940 94.27 [2,] 95.97 78.36 81.600 90.96 90.16 95.01 106.92 104.860 104.140 106.940 94.27 [3,] 96.56 85.29 83.075 92.53 93.05 96.59 110.73 105.355 106.325 111.535 101.74 [4,] 97.15 92.22 84.550 94.10 95.94 98.17 114.54 105.850 108.510 116.130 109.21 [5,] 97.15 92.22 84.550 94.10 95.94 98.17 114.54 105.850 108.510 116.130 109.21 [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 84.310 78.89 69.280 67.150 75.21 77.74 77.86 [2,] 84.310 78.89 69.280 67.150 75.21 77.74 77.86 [3,] 97.155 88.73 79.345 76.835 79.29 83.58 87.47 [4,] 110.000 98.57 89.410 86.520 83.37 89.42 97.08 [5,] 110.000 98.57 89.410 86.520 83.37 89.42 97.08 $n [1] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 [39] 2 2 2 2 2 2 2 2 2 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.3822 104.2858 94.50558 101.4078 90.78437 82.99042 89.85061 75.37974 [2,] 110.1178 109.9142 112.49442 113.3122 104.69563 94.42958 92.14939 92.00026 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 80.0785 78.59332 85.70777 91.0447 108.1819 103.0895 95.69475 102.7904 [2,] 101.1415 92.58668 101.35223 99.4553 117.6781 109.2105 100.88525 123.7896 [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 90.88405 87.82523 85.76599 81.97244 82.5713 84.60838 94.44265 89.0416 [2,] 100.73595 96.45477 96.07401 91.16756 98.8087 102.55162 104.57735 99.2584 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [1,] 94.3138 73.5647 75.96954 98.10664 100.5008 92.34046 95.24167 [2,] 108.3462 123.7953 122.20046 106.84336 103.2492 101.09954 97.87833 [,32] [,33] [,34] [,35] [,36] [,37] [,38] [,39] [1,] 69.80521 79.77918 89.0219 86.59242 93.05956 102.2167 104.2489 101.4427 [2,] 100.77479 86.37082 96.0381 99.50758 100.12044 119.2433 106.4611 111.2073 [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [1,] 101.2677 85.0486 68.45339 66.74294 56.85519 55.19428 70.17341 70.53077 [2,] 121.8023 118.4314 125.85661 110.71706 101.83481 98.47572 88.40659 96.62923 [,48] [1,] 65.99686 [2,] 108.94314 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" Warning message: In bxp(list(stats = c(102.96, 104.605, 106.25, 108.845, 111.44, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5dmqx1457366960.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,] -4.92 -4.000 -1.070 -18.970 -9.030 -5.850 -15.940 6.330 -11.260 7.940 [2,] -4.63 -3.635 1.395 -17.145 -6.790 -1.945 -11.460 6.625 -8.140 9.670 [3,] -4.34 -3.270 3.860 -15.320 -4.550 1.960 -6.980 6.920 -5.020 11.400 [4,] 0.10 3.705 4.730 -9.545 -3.195 3.230 -3.445 9.060 -4.265 12.305 [5,] 4.54 10.680 5.600 -3.770 -1.840 4.500 0.090 11.200 -3.510 13.210 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] -11.180 9.53 -12.26 -8.790 -3.390 -23.340 -7.000 -3.62 -11.350 -2.190 [2,] -3.270 9.66 -8.44 -8.325 5.805 -17.545 -6.330 -1.04 -10.595 0.820 [3,] 4.640 9.79 -4.62 -7.860 15.000 -11.750 -5.660 1.54 -9.840 3.830 [4,] 7.125 14.20 -0.96 -7.815 20.160 -8.570 -4.665 3.66 -6.950 4.825 [5,] 9.610 18.61 2.70 -7.770 25.320 -5.390 -3.670 5.78 -4.060 5.820 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [1,] 1.190 0.220 -5.360 2.10 -17.03 -0.490 -5.00 -1.94 -6.500 -1.53 -17.61 [2,] 3.110 4.150 -2.370 2.10 -17.03 -0.490 -5.00 -1.94 -6.500 -1.53 -17.61 [3,] 5.030 8.080 0.620 4.56 -2.65 0.405 3.39 -0.60 -5.155 -0.16 -11.27 [4,] 6.815 9.505 0.665 7.02 11.73 1.300 11.78 0.74 -3.810 1.21 -4.93 [5,] 8.600 10.930 0.710 7.02 11.73 1.300 11.78 0.74 -3.810 1.21 -4.93 [,32] [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] -7.670 9.360 -0.80 2.23 8.75 -8.690 -1.71 2.80 -12.670 -9.960 -11.430 [2,] -7.670 9.360 -0.80 2.23 8.75 -8.690 -1.71 2.80 -12.670 -9.960 -11.430 [3,] -2.215 9.455 0.52 3.54 14.14 -5.375 0.97 5.21 -9.795 -4.585 -8.425 [4,] 3.240 9.550 1.84 4.85 19.53 -2.060 3.65 7.62 -6.920 0.790 -5.420 [5,] 3.240 9.550 1.84 4.85 19.53 -2.060 3.65 7.62 -6.920 0.790 -5.420 [,43] [,44] [,45] [,46] [,47] [,48] [1,] -9.610 -2.89 -3.150 2.53 0.12 9.170 [2,] -9.610 -2.89 -3.150 2.53 0.12 9.170 [3,] -9.385 -2.51 2.455 4.29 3.89 21.375 [4,] -9.160 -2.13 8.060 6.05 7.66 33.580 [5,] -9.160 -2.13 8.060 6.05 7.66 33.580 $n [1] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 [39] 2 2 2 2 2 2 2 2 2 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -8.6547695 -9.965647 0.8177682 -22.252822 -7.829407 -2.760704 -14.2913906 [2,] -0.0252305 3.425647 6.9022318 -8.387178 -1.270593 6.680704 0.3313906 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 4.69876 -8.554827 8.996318 -4.842459 5.648551 -11.443356 -8.325229 [2,] 9.14124 -1.485173 13.803682 14.122459 13.931449 2.203356 -7.394771 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 1.905176 -19.937115 -7.178835 -2.747403 -13.165018 0.1765852 1.650249 [2,] 28.094824 -3.562885 -4.141165 5.827403 -6.514982 7.4834148 8.409751 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] 3.195097 -2.148568 -0.9367653 -34.7815 -1.594839 -15.3571 -3.594173 [2,] 12.964903 3.388568 10.0567653 29.4815 2.404839 22.1371 2.394173 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -8.160345 -3.221207 -25.43646 -14.403965 9.242727 -2.429484 0.6128608 [2,] -2.149655 2.901207 2.89646 9.973965 9.667273 3.469484 6.4671392 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 2.096274 -12.782226 -5.018346 -0.1750424 -16.219065 -16.595209 -15.139545 [2,] 26.183726 2.032226 6.958346 10.5950424 -3.370935 7.425209 -1.710455 [,43] [,44] [,45] [,46] [,47] [,48] [1,] -9.887753 -3.359094 -10.06913 0.3573549 -4.533905 -5.896553 [2,] -8.882247 -1.660906 14.97913 8.2226451 12.313905 48.646553 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" Warning message: In bxp(list(stats = c(-4.92, -4.63, -4.34, 0.100000000000001, 4.54000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dpqd1457366960.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] [1,] 69.280 74.590 75.060 [2,] 89.450 89.415 88.810 [3,] 95.130 97.115 94.345 [4,] 103.545 107.010 101.435 [5,] 119.150 117.780 113.290 $n [1] 48 48 24 $conf [,1] [,2] [,3] [1,] 91.91559 93.1024 90.27323 [2,] 98.34441 101.1276 98.41677 $out [1] 67.15 $group [1] 1 $names [1] "1" "2" NA > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7e4kn1457366960.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,] 76.83500 76.835 76.835 [2,] 89.65833 89.670 89.735 [3,] 96.55833 96.185 96.575 [4,] 102.17500 102.175 102.175 [5,] 111.53500 113.290 111.535 $n [1] 48 48 48 $conf [,1] [,2] [,3] [1,] 93.70387 93.33319 93.73802 [2,] 99.41280 99.03681 99.41198 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/13eo01457366960.ps tmp/13eo01457366960.png",intern=TRUE)) character(0) > try(system("convert tmp/2r2ko1457366960.ps tmp/2r2ko1457366960.png",intern=TRUE)) character(0) > try(system("convert tmp/337qr1457366960.ps tmp/337qr1457366960.png",intern=TRUE)) character(0) > try(system("convert tmp/497r81457366960.ps tmp/497r81457366960.png",intern=TRUE)) character(0) > try(system("convert tmp/5dmqx1457366960.ps tmp/5dmqx1457366960.png",intern=TRUE)) character(0) > try(system("convert tmp/6dpqd1457366960.ps tmp/6dpqd1457366960.png",intern=TRUE)) character(0) > try(system("convert tmp/7e4kn1457366960.ps tmp/7e4kn1457366960.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.615 0.468 3.106