R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(103.75,103.89,104.01,104.28,104.34,104.48,104.56,104.71,104.79,104.87,104.95,105,105.05,105.57,105.98,106.45,107.13,107.87,108.56,109.04,109.98,110.4,110.99,111.23,111.76,112.18,112.88,113.54,114.11,114.8,115.56,116.03,116.98,117.65,118.12,118.6,119.03,119.82,120.76,121.4,122.12,123.08,123.86,124.46,125.14,125.89,126.32,126.93,127.48,128.28,129.11,130.23,131.04,132.2,133.12,134.48,135.74,136.88,138.12,139.99) > par1 = '60' > par1 <- '60' > #'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] 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] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 103.75 NA [2,] 103.89 NA [3,] 104.01 NA [4,] 104.28 NA [5,] 104.34 NA [6,] 104.48 NA [7,] 104.56 NA [8,] 104.71 NA [9,] 104.79 NA [10,] 104.87 NA [11,] 104.95 NA [12,] 105.00 NA [13,] 105.05 NA [14,] 105.57 NA [15,] 105.98 NA [16,] 106.45 NA [17,] 107.13 NA [18,] 107.87 NA [19,] 108.56 NA [20,] 109.04 NA [21,] 109.98 NA [22,] 110.40 NA [23,] 110.99 NA [24,] 111.23 NA [25,] 111.76 NA [26,] 112.18 NA [27,] 112.88 NA [28,] 113.54 NA [29,] 114.11 NA [30,] 114.80 NA [31,] 115.56 NA [32,] 116.03 NA [33,] 116.98 NA [34,] 117.65 NA [35,] 118.12 NA [36,] 118.60 NA [37,] 119.03 NA [38,] 119.82 NA [39,] 120.76 NA [40,] 121.40 NA [41,] 122.12 NA [42,] 123.08 NA [43,] 123.86 NA [44,] 124.46 NA [45,] 125.14 NA [46,] 125.89 NA [47,] 126.32 NA [48,] 126.93 NA [49,] 127.48 NA [50,] 128.28 NA [51,] 129.11 NA [52,] 130.23 NA [53,] 131.04 NA [54,] 132.20 NA [55,] 133.12 NA [56,] 134.48 NA [57,] 135.74 NA [58,] 136.88 NA [59,] 138.12 NA [60,] 139.99 NA > darr [,1] [,2] [1,] 0.14 NA [2,] 0.12 NA [3,] 0.27 NA [4,] 0.06 NA [5,] 0.14 NA [6,] 0.08 NA [7,] 0.15 NA [8,] 0.08 NA [9,] 0.08 NA [10,] 0.08 NA [11,] 0.05 NA [12,] 0.05 NA [13,] 0.52 NA [14,] 0.41 NA [15,] 0.47 NA [16,] 0.68 NA [17,] 0.74 NA [18,] 0.69 NA [19,] 0.48 NA [20,] 0.94 NA [21,] 0.42 NA [22,] 0.59 NA [23,] 0.24 NA [24,] 0.53 NA [25,] 0.42 NA [26,] 0.70 NA [27,] 0.66 NA [28,] 0.57 NA [29,] 0.69 NA [30,] 0.76 NA [31,] 0.47 NA [32,] 0.95 NA [33,] 0.67 NA [34,] 0.47 NA [35,] 0.48 NA [36,] 0.43 NA [37,] 0.79 NA [38,] 0.94 NA [39,] 0.64 NA [40,] 0.72 NA [41,] 0.96 NA [42,] 0.78 NA [43,] 0.60 NA [44,] 0.68 NA [45,] 0.75 NA [46,] 0.43 NA [47,] 0.61 NA [48,] 0.55 NA [49,] 0.80 NA [50,] 0.83 NA [51,] 1.12 NA [52,] 0.81 NA [53,] 1.16 NA [54,] 0.92 NA [55,] 1.36 NA [56,] 1.26 NA [57,] 1.14 NA [58,] 1.24 NA [59,] 1.87 NA [60,] 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/1rrtz1476296877.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/28p4b1476296877.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/3hngs1476296877.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/4uerz1476296877.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,] 103.75 103.89 104.01 104.28 104.34 104.48 104.56 104.71 104.79 104.87 [2,] 103.75 103.89 104.01 104.28 104.34 104.48 104.56 104.71 104.79 104.87 [3,] 103.75 103.89 104.01 104.28 104.34 104.48 104.56 104.71 104.79 104.87 [4,] 103.75 103.89 104.01 104.28 104.34 104.48 104.56 104.71 104.79 104.87 [5,] 103.75 103.89 104.01 104.28 104.34 104.48 104.56 104.71 104.79 104.87 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 104.95 105 105.05 105.57 105.98 106.45 107.13 107.87 108.56 109.04 [2,] 104.95 105 105.05 105.57 105.98 106.45 107.13 107.87 108.56 109.04 [3,] 104.95 105 105.05 105.57 105.98 106.45 107.13 107.87 108.56 109.04 [4,] 104.95 105 105.05 105.57 105.98 106.45 107.13 107.87 108.56 109.04 [5,] 104.95 105 105.05 105.57 105.98 106.45 107.13 107.87 108.56 109.04 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [1,] 109.98 110.4 110.99 111.23 111.76 112.18 112.88 113.54 114.11 114.8 115.56 [2,] 109.98 110.4 110.99 111.23 111.76 112.18 112.88 113.54 114.11 114.8 115.56 [3,] 109.98 110.4 110.99 111.23 111.76 112.18 112.88 113.54 114.11 114.8 115.56 [4,] 109.98 110.4 110.99 111.23 111.76 112.18 112.88 113.54 114.11 114.8 115.56 [5,] 109.98 110.4 110.99 111.23 111.76 112.18 112.88 113.54 114.11 114.8 115.56 [,32] [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 116.03 116.98 117.65 118.12 118.6 119.03 119.82 120.76 121.4 122.12 123.08 [2,] 116.03 116.98 117.65 118.12 118.6 119.03 119.82 120.76 121.4 122.12 123.08 [3,] 116.03 116.98 117.65 118.12 118.6 119.03 119.82 120.76 121.4 122.12 123.08 [4,] 116.03 116.98 117.65 118.12 118.6 119.03 119.82 120.76 121.4 122.12 123.08 [5,] 116.03 116.98 117.65 118.12 118.6 119.03 119.82 120.76 121.4 122.12 123.08 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [,51] [,52] [1,] 123.86 124.46 125.14 125.89 126.32 126.93 127.48 128.28 129.11 130.23 [2,] 123.86 124.46 125.14 125.89 126.32 126.93 127.48 128.28 129.11 130.23 [3,] 123.86 124.46 125.14 125.89 126.32 126.93 127.48 128.28 129.11 130.23 [4,] 123.86 124.46 125.14 125.89 126.32 126.93 127.48 128.28 129.11 130.23 [5,] 123.86 124.46 125.14 125.89 126.32 126.93 127.48 128.28 129.11 130.23 [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 131.04 132.2 133.12 134.48 135.74 136.88 138.12 139.99 [2,] 131.04 132.2 133.12 134.48 135.74 136.88 138.12 139.99 [3,] 131.04 132.2 133.12 134.48 135.74 136.88 138.12 139.99 [4,] 131.04 132.2 133.12 134.48 135.74 136.88 138.12 139.99 [5,] 131.04 132.2 133.12 134.48 135.74 136.88 138.12 139.99 $n [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 103.75 103.89 104.01 104.28 104.34 104.48 104.56 104.71 104.79 104.87 [2,] 103.75 103.89 104.01 104.28 104.34 104.48 104.56 104.71 104.79 104.87 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 104.95 105 105.05 105.57 105.98 106.45 107.13 107.87 108.56 109.04 [2,] 104.95 105 105.05 105.57 105.98 106.45 107.13 107.87 108.56 109.04 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [1,] 109.98 110.4 110.99 111.23 111.76 112.18 112.88 113.54 114.11 114.8 115.56 [2,] 109.98 110.4 110.99 111.23 111.76 112.18 112.88 113.54 114.11 114.8 115.56 [,32] [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 116.03 116.98 117.65 118.12 118.6 119.03 119.82 120.76 121.4 122.12 123.08 [2,] 116.03 116.98 117.65 118.12 118.6 119.03 119.82 120.76 121.4 122.12 123.08 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [,51] [,52] [1,] 123.86 124.46 125.14 125.89 126.32 126.93 127.48 128.28 129.11 130.23 [2,] 123.86 124.46 125.14 125.89 126.32 126.93 127.48 128.28 129.11 130.23 [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 131.04 132.2 133.12 134.48 135.74 136.88 138.12 139.99 [2,] 131.04 132.2 133.12 134.48 135.74 136.88 138.12 139.99 $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" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "60" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/504o01476296877.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] [,13] [,14] [1,] 0.14 0.12 0.27 0.06 0.14 0.08 0.15 0.08 0.08 0.08 0.05 0.05 0.52 0.41 [2,] 0.14 0.12 0.27 0.06 0.14 0.08 0.15 0.08 0.08 0.08 0.05 0.05 0.52 0.41 [3,] 0.14 0.12 0.27 0.06 0.14 0.08 0.15 0.08 0.08 0.08 0.05 0.05 0.52 0.41 [4,] 0.14 0.12 0.27 0.06 0.14 0.08 0.15 0.08 0.08 0.08 0.05 0.05 0.52 0.41 [5,] 0.14 0.12 0.27 0.06 0.14 0.08 0.15 0.08 0.08 0.08 0.05 0.05 0.52 0.41 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 0.47 0.68 0.74 0.69 0.48 0.94 0.42 0.59 0.24 0.53 0.42 0.7 [2,] 0.47 0.68 0.74 0.69 0.48 0.94 0.42 0.59 0.24 0.53 0.42 0.7 [3,] 0.47 0.68 0.74 0.69 0.48 0.94 0.42 0.59 0.24 0.53 0.42 0.7 [4,] 0.47 0.68 0.74 0.69 0.48 0.94 0.42 0.59 0.24 0.53 0.42 0.7 [5,] 0.47 0.68 0.74 0.69 0.48 0.94 0.42 0.59 0.24 0.53 0.42 0.7 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 0.66 0.57 0.69 0.76 0.47 0.95 0.67 0.47 0.48 0.43 0.79 0.94 [2,] 0.66 0.57 0.69 0.76 0.47 0.95 0.67 0.47 0.48 0.43 0.79 0.94 [3,] 0.66 0.57 0.69 0.76 0.47 0.95 0.67 0.47 0.48 0.43 0.79 0.94 [4,] 0.66 0.57 0.69 0.76 0.47 0.95 0.67 0.47 0.48 0.43 0.79 0.94 [5,] 0.66 0.57 0.69 0.76 0.47 0.95 0.67 0.47 0.48 0.43 0.79 0.94 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 0.64 0.72 0.96 0.78 0.6 0.68 0.75 0.43 0.61 0.55 0.8 0.83 [2,] 0.64 0.72 0.96 0.78 0.6 0.68 0.75 0.43 0.61 0.55 0.8 0.83 [3,] 0.64 0.72 0.96 0.78 0.6 0.68 0.75 0.43 0.61 0.55 0.8 0.83 [4,] 0.64 0.72 0.96 0.78 0.6 0.68 0.75 0.43 0.61 0.55 0.8 0.83 [5,] 0.64 0.72 0.96 0.78 0.6 0.68 0.75 0.43 0.61 0.55 0.8 0.83 [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 1.12 0.81 1.16 0.92 1.36 1.26 1.14 1.24 1.87 NA [2,] 1.12 0.81 1.16 0.92 1.36 1.26 1.14 1.24 1.87 NA [3,] 1.12 0.81 1.16 0.92 1.36 1.26 1.14 1.24 1.87 NA [4,] 1.12 0.81 1.16 0.92 1.36 1.26 1.14 1.24 1.87 NA [5,] 1.12 0.81 1.16 0.92 1.36 1.26 1.14 1.24 1.87 NA $n [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 1 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 0.14 0.12 0.27 0.06 0.14 0.08 0.15 0.08 0.08 0.08 0.05 0.05 0.52 0.41 [2,] 0.14 0.12 0.27 0.06 0.14 0.08 0.15 0.08 0.08 0.08 0.05 0.05 0.52 0.41 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 0.47 0.68 0.74 0.69 0.48 0.94 0.42 0.59 0.24 0.53 0.42 0.7 [2,] 0.47 0.68 0.74 0.69 0.48 0.94 0.42 0.59 0.24 0.53 0.42 0.7 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 0.66 0.57 0.69 0.76 0.47 0.95 0.67 0.47 0.48 0.43 0.79 0.94 [2,] 0.66 0.57 0.69 0.76 0.47 0.95 0.67 0.47 0.48 0.43 0.79 0.94 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 0.64 0.72 0.96 0.78 0.6 0.68 0.75 0.43 0.61 0.55 0.8 0.83 [2,] 0.64 0.72 0.96 0.78 0.6 0.68 0.75 0.43 0.61 0.55 0.8 0.83 [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 1.12 0.81 1.16 0.92 1.36 1.26 1.14 1.24 1.87 NA [2,] 1.12 0.81 1.16 0.92 1.36 1.26 1.14 1.24 1.87 NA $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" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "60" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ejcw1476296877.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,] 103.750 NA [2,] 106.215 NA [3,] 115.180 NA [4,] 125.515 NA [5,] 139.990 NA $n [1] 60 0 $conf [,1] [,2] [1,] 111.2432 NA [2,] 119.1168 NA $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7i4971476296877.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,] 103.750 103.750 103.750 [2,] 106.215 106.215 106.215 [3,] 115.180 115.180 115.180 [4,] 125.515 125.515 125.515 [5,] 139.990 139.990 139.990 $n [1] 60 60 60 $conf [,1] [,2] [,3] [1,] 111.2432 111.2432 111.2432 [2,] 119.1168 119.1168 119.1168 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1rrtz1476296877.ps tmp/1rrtz1476296877.png",intern=TRUE)) character(0) > try(system("convert tmp/28p4b1476296877.ps tmp/28p4b1476296877.png",intern=TRUE)) character(0) > try(system("convert tmp/3hngs1476296877.ps tmp/3hngs1476296877.png",intern=TRUE)) character(0) > try(system("convert tmp/4uerz1476296877.ps tmp/4uerz1476296877.png",intern=TRUE)) character(0) > try(system("convert tmp/504o01476296877.ps tmp/504o01476296877.png",intern=TRUE)) character(0) > try(system("convert tmp/6ejcw1476296877.ps tmp/6ejcw1476296877.png",intern=TRUE)) character(0) > try(system("convert tmp/7i4971476296877.ps tmp/7i4971476296877.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.582 0.192 2.832