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(1.4272,1.3686,1.3569,1.3406,1.2565,1.2209,1.277,1.2894,1.3067,1.3898,1.3661,1.322,1.336,1.3649,1.3999,1.4442,1.4349,1.4388,1.4264,1.4343,1.377,1.3706,1.3556,1.3179,1.2905,1.3224,1.3201,1.3162,1.2789,1.2526,1.2288,1.24,1.2856,1.2974,1.2828,1.3119,1.3288,1.3359,1.2964,1.3026,1.2982,1.3189,1.308,1.331,1.3348,1.3635,1.3493,1.3704,1.361,1.3658,1.3823,1.3812,1.3732,1.3592,1.3539,1.3316,1.2901,1.2673,1.2472,1.2331,1.1621,1.135,1.0838,1.0779,1.115,1.1213,1.0996,1.1139,1.1221,1.1235,1.0736,1.0877) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.4272 1.3360 1.2905 1.3288 1.3610 1.1621 NA [2,] 1.3686 1.3649 1.3224 1.3359 1.3658 1.1350 NA [3,] 1.3569 1.3999 1.3201 1.2964 1.3823 1.0838 NA [4,] 1.3406 1.4442 1.3162 1.3026 1.3812 1.0779 NA [5,] 1.2565 1.4349 1.2789 1.2982 1.3732 1.1150 NA [6,] 1.2209 1.4388 1.2526 1.3189 1.3592 1.1213 NA [7,] 1.2770 1.4264 1.2288 1.3080 1.3539 1.0996 NA [8,] 1.2894 1.4343 1.2400 1.3310 1.3316 1.1139 NA [9,] 1.3067 1.3770 1.2856 1.3348 1.2901 1.1221 NA [10,] 1.3898 1.3706 1.2974 1.3635 1.2673 1.1235 NA [11,] 1.3661 1.3556 1.2828 1.3493 1.2472 1.0736 NA [12,] 1.3220 1.3179 1.3119 1.3704 1.2331 1.0877 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.0586 0.0289 0.0319 0.0071 0.0048 -0.0271 NA [2,] -0.0117 0.0350 -0.0023 -0.0395 0.0165 -0.0512 NA [3,] -0.0163 0.0443 -0.0039 0.0062 -0.0011 -0.0059 NA [4,] -0.0841 -0.0093 -0.0373 -0.0044 -0.0080 0.0371 NA [5,] -0.0356 0.0039 -0.0263 0.0207 -0.0140 0.0063 NA [6,] 0.0561 -0.0124 -0.0238 -0.0109 -0.0053 -0.0217 NA [7,] 0.0124 0.0079 0.0112 0.0230 -0.0223 0.0143 NA [8,] 0.0173 -0.0573 0.0456 0.0038 -0.0415 0.0082 NA [9,] 0.0831 -0.0064 0.0118 0.0287 -0.0228 0.0014 NA [10,] -0.0237 -0.0150 -0.0146 -0.0142 -0.0201 -0.0499 NA [11,] -0.0441 -0.0377 0.0291 0.0211 -0.0141 0.0141 NA [12,] 0.0140 -0.0274 0.0169 -0.0094 -0.0710 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/17ktu1457176467.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/2qne21457176467.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/3d4fi1457176467.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/4kwoy1457176467.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,] 1.2905 1.3224 1.2964 1.3026 1.11500 1.12130 1.0996 1.1139 1.2856 1.12350 [2,] 1.2905 1.3224 1.2964 1.3026 1.25650 1.22090 1.2288 1.2400 1.2856 1.26730 [3,] 1.3324 1.3504 1.3385 1.3284 1.28855 1.28575 1.2925 1.3102 1.2984 1.33045 [4,] 1.3610 1.3658 1.3823 1.3812 1.37320 1.35920 1.3539 1.3316 1.3348 1.37060 [5,] 1.4272 1.3686 1.3999 1.4442 1.43490 1.43880 1.4264 1.4343 1.3770 1.38980 [,11] [,12] [1,] 1.24720 1.2331 [2,] 1.24720 1.2331 [3,] 1.31605 1.3149 [4,] 1.35560 1.3220 [5,] 1.36610 1.3704 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.286925 1.322406 1.283092 1.2777 1.213275 1.196542 1.211806 1.251115 [2,] 1.377875 1.378394 1.393908 1.3791 1.363825 1.374958 1.373194 1.369285 [,9] [,10] [,11] [,12] [1,] 1.266664 1.263818 1.246128 1.257557 [2,] 1.330136 1.397082 1.385972 1.372243 $out [1] 1.1621 1.1350 1.0838 1.0779 1.1221 1.0736 1.0877 $group [1] 1 2 3 4 9 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.2905, 1.2905, 1.3324, 1.361, 1.4272, 1.3224, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59jhs1457176467.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] [1,] -0.05860 -0.0512 -0.0163 -0.08410 -0.03560 -0.02380 0.0079 -0.0573 -0.0228 [2,] -0.02710 -0.0395 -0.0059 -0.03730 -0.02630 -0.02170 0.0079 -0.0415 -0.0064 [3,] 0.00595 -0.0070 -0.0025 -0.00865 -0.00505 -0.01165 0.0118 0.0060 0.0066 [4,] 0.02890 0.0165 0.0062 -0.00440 0.00630 -0.00530 0.0143 0.0173 0.0287 [5,] 0.03190 0.0350 0.0062 0.03710 0.02070 -0.00530 0.0230 0.0456 0.0287 [,10] [,11] [,12] [1,] -0.02370 -4.410000e-02 -0.0710 [2,] -0.02370 -3.770000e-02 -0.0274 [3,] -0.01755 -1.110223e-16 -0.0094 [4,] -0.01460 2.110000e-02 0.0140 [5,] -0.01420 2.910000e-02 0.0169 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.03017181 -0.04312181 -0.010304891 -0.02987156 -0.02607805 -0.02222853 [2,] 0.04207181 0.02912181 0.005304891 0.01257156 0.01597805 -0.00107147 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.007671793 -0.0319279 -0.01604063 -0.02341979 -0.0379279 -0.03865314 [2,] 0.015928207 0.0439279 0.02924063 -0.01168021 0.0379279 0.01985314 $out [1] 0.0443 0.0561 -0.0223 0.0831 -0.0499 $group [1] 3 6 7 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0586, -0.0270999999999999, 0.00595000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ko331457176467.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] [1,] 1.22090 1.31790 1.22880 1.2964 1.23310 1.07360 NA [2,] 1.28320 1.36025 1.26575 1.3053 1.27870 1.08575 NA [3,] 1.33130 1.38845 1.28805 1.3299 1.35655 1.11445 NA [4,] 1.36735 1.43460 1.31405 1.3426 1.36950 1.12280 NA [5,] 1.42720 1.44420 1.32240 1.3704 1.38230 1.16210 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.292919 1.354538 1.26602 1.312887 1.315136 1.097551 NA [2,] 1.369681 1.422362 1.31008 1.346913 1.397964 1.131349 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.2209, 1.2832, 1.3313, 1.36735, 1.4272, 1.3179, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7u2vq1457176467.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,] 1.273833 1.285750 1.286888 [2,] 1.283783 1.295450 1.291769 [3,] 1.291408 1.315475 1.307763 [4,] 1.308508 1.331425 1.332969 [5,] 1.317600 1.350400 1.345675 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.280131 1.299067 1.288971 [2,] 1.302686 1.331883 1.326554 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.27383333333333, 1.28378333333333, 1.29140833333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17ktu1457176467.ps tmp/17ktu1457176467.png",intern=TRUE)) character(0) > try(system("convert tmp/2qne21457176467.ps tmp/2qne21457176467.png",intern=TRUE)) character(0) > try(system("convert tmp/3d4fi1457176467.ps tmp/3d4fi1457176467.png",intern=TRUE)) character(0) > try(system("convert tmp/4kwoy1457176467.ps tmp/4kwoy1457176467.png",intern=TRUE)) character(0) > try(system("convert tmp/59jhs1457176467.ps tmp/59jhs1457176467.png",intern=TRUE)) character(0) > try(system("convert tmp/6ko331457176467.ps tmp/6ko331457176467.png",intern=TRUE)) character(0) > try(system("convert tmp/7u2vq1457176467.ps tmp/7u2vq1457176467.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.465 0.409 2.900