R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(73.97,75.01,75.98,78.85,79.34,79.62,79.76,79.62,79.89,79.88,79.97,79.63,80.04,80.23,80.44,81.78,82.51,82.43,82.35,82.53,82.08,82.73,82.46,81.98,82.11,82.26,82.51,82.89,83.83,84.73,84.48,84.84,84.99,84.7,84.54,84.73,84.51,84.54,84.27,84.47,84.25,84.33,84.29,84.53,84.01,84.18,84.08,83.44,83.61,83.89,83.4,82.96,82.76,83.35,87.78,88.99,88.92,88.91,89.79,90.54,93.15,92.79,93.21,95.35,100.91,103.69,104.04,104.16,104.71,105.18,104.92,104.83,104.9,105.05,104.6,103.21,102.52,101.09,101.19,102.34,102.62,102.47,101.82,101.86,101.54,101.98,101.23,100.4,99.94,99.94,100,98.8,99.07,99.46,99.18,98.47,97.12,96.91,96.09,97.17,96.8,97.13,99.9,100.56,100.84,99.81,100.44,100.07) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 73.97 80.04 82.11 84.51 83.61 93.15 104.90 101.54 97.12 NA [2,] 75.01 80.23 82.26 84.54 83.89 92.79 105.05 101.98 96.91 NA [3,] 75.98 80.44 82.51 84.27 83.40 93.21 104.60 101.23 96.09 NA [4,] 78.85 81.78 82.89 84.47 82.96 95.35 103.21 100.40 97.17 NA [5,] 79.34 82.51 83.83 84.25 82.76 100.91 102.52 99.94 96.80 NA [6,] 79.62 82.43 84.73 84.33 83.35 103.69 101.09 99.94 97.13 NA [7,] 79.76 82.35 84.48 84.29 87.78 104.04 101.19 100.00 99.90 NA [8,] 79.62 82.53 84.84 84.53 88.99 104.16 102.34 98.80 100.56 NA [9,] 79.89 82.08 84.99 84.01 88.92 104.71 102.62 99.07 100.84 NA [10,] 79.88 82.73 84.70 84.18 88.91 105.18 102.47 99.46 99.81 NA [11,] 79.97 82.46 84.54 84.08 89.79 104.92 101.82 99.18 100.44 NA [12,] 79.63 81.98 84.73 83.44 90.54 104.83 101.86 98.47 100.07 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1.04 0.19 0.15 0.03 0.28 -0.36 0.15 0.44 -0.21 NA [2,] 0.97 0.21 0.25 -0.27 -0.49 0.42 -0.45 -0.75 -0.82 NA [3,] 2.87 1.34 0.38 0.20 -0.44 2.14 -1.39 -0.83 1.08 NA [4,] 0.49 0.73 0.94 -0.22 -0.20 5.56 -0.69 -0.46 -0.37 NA [5,] 0.28 -0.08 0.90 0.08 0.59 2.78 -1.43 0.00 0.33 NA [6,] 0.14 -0.08 -0.25 -0.04 4.43 0.35 0.10 0.06 2.77 NA [7,] -0.14 0.18 0.36 0.24 1.21 0.12 1.15 -1.20 0.66 NA [8,] 0.27 -0.45 0.15 -0.52 -0.07 0.55 0.28 0.27 0.28 NA [9,] -0.01 0.65 -0.29 0.17 -0.01 0.47 -0.15 0.39 -1.03 NA [10,] 0.09 -0.27 -0.16 -0.10 0.88 -0.26 -0.65 -0.28 0.63 NA [11,] -0.34 -0.48 0.19 -0.64 0.75 -0.09 0.04 -0.71 -0.37 NA [12,] 0.41 0.13 -0.22 0.17 2.61 0.07 -0.32 -1.35 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/1njdx1445012809.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/2jtf61445012809.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/3ppbx1445012809.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/4pb6t1445012809.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,] 73.97 75.01 75.98 78.85 79.34 79.62 79.76 79.62 79.89 79.88 [2,] 82.11 82.26 82.51 82.89 82.76 83.35 84.29 84.53 84.01 84.18 [3,] 84.51 84.54 84.27 84.47 84.25 84.73 87.78 88.99 88.92 88.91 [4,] 97.12 96.91 96.09 97.17 99.94 99.94 100.00 100.56 100.84 99.81 [5,] 104.90 105.05 104.60 103.21 102.52 103.69 104.04 104.16 104.71 105.18 [,11] [,12] [1,] 79.97 79.63 [2,] 84.08 83.44 [3,] 89.79 90.54 [4,] 100.44 100.07 [5,] 104.92 104.83 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 76.60473 76.82433 77.11787 76.9492 75.20187 75.9926 79.50607 80.54753 [2,] 92.41527 92.25567 91.42213 91.9908 93.29813 93.4674 96.05393 97.43247 [,9] [,10] [,11] [,12] [1,] 80.0562 80.6782 81.17373 81.78153 [2,] 97.7838 97.1418 98.40627 99.29847 $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(73.97, 82.11, 84.51, 97.12, 104.9, 75.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rtq41445012809.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,] -0.21 -0.82 -1.39 -0.69 -0.08 -0.25 -0.14 -0.52 -0.29 -0.65 -0.71 -0.32 [2,] 0.03 -0.49 -0.44 -0.37 0.00 -0.04 0.12 -0.07 -0.15 -0.27 -0.48 -0.27 [3,] 0.15 -0.27 0.38 -0.20 0.28 0.10 0.24 0.27 -0.01 -0.16 -0.34 0.10 [4,] 0.28 0.25 1.34 0.73 0.59 0.35 0.66 0.28 0.39 0.09 0.04 0.29 [5,] 0.44 0.97 2.87 0.94 0.90 0.35 1.21 0.55 0.65 0.63 0.75 0.41 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01833333 -0.6597333 -0.5574667 -0.7793333 -0.03073333 -0.1054 -0.0444 [2,] 0.28166667 0.1197333 1.3174667 0.3793333 0.59073333 0.3054 0.5244 [,8] [,9] [,10] [,11] [,12] [1,] 0.08566667 -0.2944 -0.3496 -0.61386667 -0.212824 [2,] 0.45433333 0.2744 0.0296 -0.06613333 0.412824 $out [1] 1.04 -0.36 5.56 2.78 -1.43 4.43 2.77 -1.20 -1.03 0.88 2.61 -1.35 $group [1] 1 1 4 5 5 6 6 7 9 10 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.210000000000008, 0.0300000000000011, 0.150000000000006, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69gh71445012809.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,] 73.970 80.040 82.11 84.01 82.760 92.790 101.090 98.470 96.090 NA [2,] 77.415 81.110 82.70 84.13 83.375 94.280 101.840 99.125 97.015 NA [3,] 79.620 82.215 84.51 84.28 85.835 103.865 102.495 99.940 98.490 NA [4,] 79.820 82.485 84.73 84.49 88.955 104.770 103.905 100.815 100.255 NA [5,] 79.970 82.730 84.99 84.54 90.540 105.180 105.050 101.980 100.840 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 78.52306 81.58785 83.5841 84.1158 83.28992 99.08044 101.5531 99.16918 [2,] 80.71694 82.84215 85.4359 84.4442 88.38008 108.64956 103.4369 100.71082 [,9] [,10] [1,] 97.01221 NA [2,] 99.96779 NA $out [1] 83.44 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(73.97, 77.415, 79.62, 79.82, 79.97, 80.04, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7pwld1445012809.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.99444 84.250 89.3000 [2,] 89.43000 84.490 89.8225 [3,] 91.11667 86.255 91.7000 [4,] 91.86111 88.955 92.2025 [5,] 91.92444 90.540 92.5450 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 90.00782 84.21848 90.61447 [2,] 92.22551 88.29152 92.78553 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(88.9944444444445, 89.43, 91.1166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1njdx1445012809.ps tmp/1njdx1445012809.png",intern=TRUE)) character(0) > try(system("convert tmp/2jtf61445012809.ps tmp/2jtf61445012809.png",intern=TRUE)) character(0) > try(system("convert tmp/3ppbx1445012809.ps tmp/3ppbx1445012809.png",intern=TRUE)) character(0) > try(system("convert tmp/4pb6t1445012809.ps tmp/4pb6t1445012809.png",intern=TRUE)) character(0) > try(system("convert tmp/5rtq41445012809.ps tmp/5rtq41445012809.png",intern=TRUE)) character(0) > try(system("convert tmp/69gh71445012809.ps tmp/69gh71445012809.png",intern=TRUE)) character(0) > try(system("convert tmp/7pwld1445012809.ps tmp/7pwld1445012809.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.492 0.492 3.007