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(89.65,90.65,89.34,89.15,88.82,88.82,91.97,93.01,93.24,93.2,93.19,92.2,93.39,94.75,94.25,94.37,94.02,92.77,92.64,93.19,92.74,92.52,92.25,91.6,93.73,96.21,96.36,95.69,95.07,95.5,95.22,97.41,98.31,98.54,98.45,98.03,101.45,102.44,102.42,100.98,100.69,100.28,98.06,97.37,97.25,98.93,100.04,100.09,100.79,99.76,99.63,99.26,99.69,99.17,98.79,97.97,98.1,97.91,97.16,96.8,97.46,96.59,96.35,96.12,96.16,95.95,96.06,95.89,95.9,95.82,95.54,95.51) > 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] 72 > (np <- floor(n / par1)) [1] 1 > 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] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 89.65 100.79 [2,] 90.65 99.76 [3,] 89.34 99.63 [4,] 89.15 99.26 [5,] 88.82 99.69 [6,] 88.82 99.17 [7,] 91.97 98.79 [8,] 93.01 97.97 [9,] 93.24 98.10 [10,] 93.20 97.91 [11,] 93.19 97.16 [12,] 92.20 96.80 [13,] 93.39 97.46 [14,] 94.75 96.59 [15,] 94.25 96.35 [16,] 94.37 96.12 [17,] 94.02 96.16 [18,] 92.77 95.95 [19,] 92.64 96.06 [20,] 93.19 95.89 [21,] 92.74 95.90 [22,] 92.52 95.82 [23,] 92.25 95.54 [24,] 91.60 95.51 [25,] 93.73 NA [26,] 96.21 NA [27,] 96.36 NA [28,] 95.69 NA [29,] 95.07 NA [30,] 95.50 NA [31,] 95.22 NA [32,] 97.41 NA [33,] 98.31 NA [34,] 98.54 NA [35,] 98.45 NA [36,] 98.03 NA [37,] 101.45 NA [38,] 102.44 NA [39,] 102.42 NA [40,] 100.98 NA [41,] 100.69 NA [42,] 100.28 NA [43,] 98.06 NA [44,] 97.37 NA [45,] 97.25 NA [46,] 98.93 NA [47,] 100.04 NA [48,] 100.09 NA > darr [,1] [,2] [1,] 1.00 -1.03 [2,] -1.31 -0.13 [3,] -0.19 -0.37 [4,] -0.33 0.43 [5,] 0.00 -0.52 [6,] 3.15 -0.38 [7,] 1.04 -0.82 [8,] 0.23 0.13 [9,] -0.04 -0.19 [10,] -0.01 -0.75 [11,] -0.99 -0.36 [12,] 1.19 0.66 [13,] 1.36 -0.87 [14,] -0.50 -0.24 [15,] 0.12 -0.23 [16,] -0.35 0.04 [17,] -1.25 -0.21 [18,] -0.13 0.11 [19,] 0.55 -0.17 [20,] -0.45 0.01 [21,] -0.22 -0.08 [22,] -0.27 -0.28 [23,] -0.65 -0.03 [24,] 2.13 NA [25,] 2.48 NA [26,] 0.15 NA [27,] -0.67 NA [28,] -0.62 NA [29,] 0.43 NA [30,] -0.28 NA [31,] 2.19 NA [32,] 0.90 NA [33,] 0.23 NA [34,] -0.09 NA [35,] -0.42 NA [36,] 3.42 NA [37,] 0.99 NA [38,] -0.02 NA [39,] -1.44 NA [40,] -0.29 NA [41,] -0.41 NA [42,] -2.22 NA [43,] -0.69 NA [44,] -0.12 NA [45,] 1.68 NA [46,] 1.11 NA [47,] 0.05 NA [48,] 0.70 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/1h86u1457982711.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/2f40g1457982711.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/3bnok1457982711.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/4syag1457982711.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,] 89.65 90.650 89.340 89.150 88.820 88.820 91.97 93.01 93.24 93.200 93.190 [2,] 89.65 90.650 89.340 89.150 88.820 88.820 91.97 93.01 93.24 93.200 93.190 [3,] 95.22 95.205 94.485 94.205 94.255 93.995 95.38 95.49 95.67 95.555 95.175 [4,] 100.79 99.760 99.630 99.260 99.690 99.170 98.79 97.97 98.10 97.910 97.160 [5,] 100.79 99.760 99.630 99.260 99.690 99.170 98.79 97.97 98.10 97.910 97.160 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [1,] 92.2 93.390 94.75 94.25 94.370 94.02 92.77 92.64 93.19 92.74 92.52 92.250 [2,] 92.2 93.390 94.75 94.25 94.370 94.02 92.77 92.64 93.19 92.74 92.52 92.250 [3,] 94.5 95.425 95.67 95.30 95.245 95.09 94.36 94.35 94.54 94.32 94.17 93.895 [4,] 96.8 97.460 96.59 96.35 96.120 96.16 95.95 96.06 95.89 95.90 95.82 95.540 [5,] 96.8 97.460 96.59 96.35 96.120 96.16 95.95 96.06 95.89 95.90 95.82 95.540 [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] 91.600 93.73 96.21 96.36 95.69 95.07 95.5 95.22 97.41 98.31 98.54 98.45 [2,] 91.600 93.73 96.21 96.36 95.69 95.07 95.5 95.22 97.41 98.31 98.54 98.45 [3,] 93.555 93.73 96.21 96.36 95.69 95.07 95.5 95.22 97.41 98.31 98.54 98.45 [4,] 95.510 93.73 96.21 96.36 95.69 95.07 95.5 95.22 97.41 98.31 98.54 98.45 [5,] 95.510 93.73 96.21 96.36 95.69 95.07 95.5 95.22 97.41 98.31 98.54 98.45 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [1,] 98.03 101.45 102.44 102.42 100.98 100.69 100.28 98.06 97.37 97.25 98.93 [2,] 98.03 101.45 102.44 102.42 100.98 100.69 100.28 98.06 97.37 97.25 98.93 [3,] 98.03 101.45 102.44 102.42 100.98 100.69 100.28 98.06 97.37 97.25 98.93 [4,] 98.03 101.45 102.44 102.42 100.98 100.69 100.28 98.06 97.37 97.25 98.93 [5,] 98.03 101.45 102.44 102.42 100.98 100.69 100.28 98.06 97.37 97.25 98.93 [,47] [,48] [1,] 100.04 100.09 [2,] 100.04 100.09 [3,] 100.04 100.09 [4,] 100.04 100.09 [5,] 100.04 100.09 $n [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 82.77407 85.02705 82.98872 82.90982 82.11072 82.43168 87.7605 [2,] 107.66593 105.38295 105.98128 105.50018 106.39928 105.55832 102.9995 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [1,] 89.94855 90.24027 90.29285 90.7396 89.36075 90.87788 93.6143 92.95382 [2,] 101.03145 101.09973 100.81715 99.6104 99.63925 99.97212 97.7257 97.64618 [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [1,] 93.28985 92.69913 90.80721 90.52908 91.52348 90.78956 90.48315 90.21932 [2,] 97.20015 97.48087 97.91279 98.17092 97.55652 97.85044 97.85685 97.57068 [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] 89.18664 93.73 96.21 96.36 95.69 95.07 95.5 95.22 97.41 98.31 98.54 98.45 [2,] 97.92336 93.73 96.21 96.36 95.69 95.07 95.5 95.22 97.41 98.31 98.54 98.45 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [1,] 98.03 101.45 102.44 102.42 100.98 100.69 100.28 98.06 97.37 97.25 98.93 [2,] 98.03 101.45 102.44 102.42 100.98 100.69 100.28 98.06 97.37 97.25 98.93 [,47] [,48] [1,] 100.04 100.09 [2,] 100.04 100.09 $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(89.65, 89.65, 95.22, 100.79, 100.79, 90.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rfr31457982711.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,] -1.030 -1.31 -0.37 -0.33 -0.52 -0.380 -0.82 0.13 -0.190 -0.75 -0.990 0.660 [2,] -1.030 -1.31 -0.37 -0.33 -0.52 -0.380 -0.82 0.13 -0.190 -0.75 -0.990 0.660 [3,] -0.015 -0.72 -0.28 0.05 -0.26 1.385 0.11 0.18 -0.115 -0.38 -0.675 0.925 [4,] 1.000 -0.13 -0.19 0.43 0.00 3.150 1.04 0.23 -0.040 -0.01 -0.360 1.190 [5,] 1.000 -0.13 -0.19 0.43 0.00 3.150 1.04 0.23 -0.040 -0.01 -0.360 1.190 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [1,] -0.870 -0.50 -0.230 -0.350 -1.25 -0.13 -0.17 -0.45 -0.22 -0.280 -0.65 [2,] -0.870 -0.50 -0.230 -0.350 -1.25 -0.13 -0.17 -0.45 -0.22 -0.280 -0.65 [3,] 0.245 -0.37 -0.055 -0.155 -0.73 -0.01 0.19 -0.22 -0.15 -0.275 -0.34 [4,] 1.360 -0.24 0.120 0.040 -0.21 0.11 0.55 0.01 -0.08 -0.270 -0.03 [5,] 1.360 -0.24 0.120 0.040 -0.21 0.11 0.55 0.01 -0.08 -0.270 -0.03 [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] 2.13 2.48 0.15 -0.67 -0.62 0.43 -0.28 2.19 0.9 0.23 -0.09 -0.42 [2,] 2.13 2.48 0.15 -0.67 -0.62 0.43 -0.28 2.19 0.9 0.23 -0.09 -0.42 [3,] 2.13 2.48 0.15 -0.67 -0.62 0.43 -0.28 2.19 0.9 0.23 -0.09 -0.42 [4,] 2.13 2.48 0.15 -0.67 -0.62 0.43 -0.28 2.19 0.9 0.23 -0.09 -0.42 [5,] 2.13 2.48 0.15 -0.67 -0.62 0.43 -0.28 2.19 0.9 0.23 -0.09 -0.42 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [1,] 3.42 0.99 -0.02 -1.44 -0.29 -0.41 -2.22 -0.69 -0.12 1.68 1.11 0.05 [2,] 3.42 0.99 -0.02 -1.44 -0.29 -0.41 -2.22 -0.69 -0.12 1.68 1.11 0.05 [3,] 3.42 0.99 -0.02 -1.44 -0.29 -0.41 -2.22 -0.69 -0.12 1.68 1.11 0.05 [4,] 3.42 0.99 -0.02 -1.44 -0.29 -0.41 -2.22 -0.69 -0.12 1.68 1.11 0.05 [5,] 3.42 0.99 -0.02 -1.44 -0.29 -0.41 -2.22 -0.69 -0.12 1.68 1.11 0.05 [,48] [1,] 0.7 [2,] 0.7 [3,] 0.7 [4,] 0.7 [5,] 0.7 $n [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.282974 -2.0383299 -0.48110117 -0.7990938 -0.8409589 -2.558817 -1.968045 [2,] 2.252974 0.5983299 -0.07889883 0.8990938 0.3209589 5.328817 2.188045 [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.06827713 -0.28258431 -1.2067492 -1.37885409 0.3328688 -2.24642 [2,] 0.29172287 0.05258431 0.4467492 0.02885409 1.5171312 2.73642 [,14] [,15] [,16] [,17] [,18] [,19] [1,] -0.66047947 -0.44603 -0.5907192 -1.8919179 -0.2781349 -0.6144047 [2,] -0.07952053 0.33603 0.2807192 0.4319179 0.2581349 0.9944047 [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] -0.7339252 -0.30641202 -0.2861723 -1.0326818 2.13 2.48 0.15 -0.67 -0.62 [2,] 0.2939252 0.00641202 -0.2638277 0.3526818 2.13 2.48 0.15 -0.67 -0.62 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [1,] 0.43 -0.28 2.19 0.9 0.23 -0.09 -0.42 3.42 0.99 -0.02 -1.44 -0.29 [2,] 0.43 -0.28 2.19 0.9 0.23 -0.09 -0.42 3.42 0.99 -0.02 -1.44 -0.29 [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] -0.41 -2.22 -0.69 -0.12 1.68 1.11 0.05 0.7 [2,] -0.41 -2.22 -0.69 -0.12 1.68 1.11 0.05 0.7 $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(-1.03, -1.03, -0.0150000000000006, 1, 1, -1.31, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zqvd1457982711.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] [1,] 88.820 95.510 [2,] 92.690 96.005 [3,] 94.560 96.980 [4,] 98.185 98.980 [5,] 102.440 100.790 $n [1] 48 24 $conf [,1] [,2] [1,] 93.30685 96.02051 [2,] 95.81315 97.93949 $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7rc6i1457982711.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,] 93.555 93.555 93.555 [2,] 94.520 94.520 94.520 [3,] 95.495 95.495 95.495 [4,] 98.185 98.185 98.185 [5,] 102.440 102.440 102.440 $n [1] 48 48 48 $conf [,1] [,2] [,3] [1,] 94.65918 94.65918 94.65918 [2,] 96.33082 96.33082 96.33082 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1h86u1457982711.ps tmp/1h86u1457982711.png",intern=TRUE)) character(0) > try(system("convert tmp/2f40g1457982711.ps tmp/2f40g1457982711.png",intern=TRUE)) character(0) > try(system("convert tmp/3bnok1457982711.ps tmp/3bnok1457982711.png",intern=TRUE)) character(0) > try(system("convert tmp/4syag1457982711.ps tmp/4syag1457982711.png",intern=TRUE)) character(0) > try(system("convert tmp/5rfr31457982711.ps tmp/5rfr31457982711.png",intern=TRUE)) character(0) > try(system("convert tmp/6zqvd1457982711.ps tmp/6zqvd1457982711.png",intern=TRUE)) character(0) > try(system("convert tmp/7rc6i1457982711.ps tmp/7rc6i1457982711.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.032 0.505 3.560