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(12347,12624,11918,10028,10228,11026,13878,22165,23533,13445,12164,9606,12177,13142,11210,9485,10082,10680,13579,21709,22205,14687,11222,8196,12794,12627,11080,10425,10865,10771,14771,20993,23882,14825,11648,10091,14976,14472,12254,12257,10767,12275,14845,21939,26740,16974,12956,12494,16024,15306,13989,12792,10697,14257,17251,25795,29016,18968,16009,14511) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 12347 12177 12794 14976 16024 NA [2,] 12624 13142 12627 14472 15306 NA [3,] 11918 11210 11080 12254 13989 NA [4,] 10028 9485 10425 12257 12792 NA [5,] 10228 10082 10865 10767 10697 NA [6,] 11026 10680 10771 12275 14257 NA [7,] 13878 13579 14771 14845 17251 NA [8,] 22165 21709 20993 21939 25795 NA [9,] 23533 22205 23882 26740 29016 NA [10,] 13445 14687 14825 16974 18968 NA [11,] 12164 11222 11648 12956 16009 NA [12,] 9606 8196 10091 12494 14511 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 277 965 -167 -504 -718 NA [2,] -706 -1932 -1547 -2218 -1317 NA [3,] -1890 -1725 -655 3 -1197 NA [4,] 200 597 440 -1490 -2095 NA [5,] 798 598 -94 1508 3560 NA [6,] 2852 2899 4000 2570 2994 NA [7,] 8287 8130 6222 7094 8544 NA [8,] 1368 496 2889 4801 3221 NA [9,] -10088 -7518 -9057 -9766 -10048 NA [10,] -1281 -3465 -3177 -4018 -2959 NA [11,] -2558 -3026 -1557 -462 -1498 NA [12,] 2571 4598 4885 3530 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/1suqu1476820336.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/28a8k1476820336.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/3g1nh1476820336.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/40pai1476820336.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] [,12] [1,] 12177 12624 11080 9485 10082 10680 13579 21709 22205 13445 11222 8196 [2,] 12347 12627 11210 10028 10228 10771 13878 21709 23533 14687 11648 9606 [3,] 12794 13142 11918 10425 10697 11026 14771 21939 23882 14825 12164 10091 [4,] 14976 14472 12254 12257 10767 12275 14845 22165 26740 16974 12956 12494 [5,] 16024 15306 12254 12792 10865 14257 14845 22165 29016 18968 12956 14511 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 10936.36 11838.33 11180.31 8849.994 10316.14 9963.277 14087.72 21616.79 [2,] 14651.64 14445.67 12655.69 12000.006 11077.86 12088.723 15454.28 22261.21 [,9] [,10] [,11] [,12] [1,] 21615.94 13209.01 11239.77 8050.346 [2,] 26148.06 16440.99 13088.23 12131.654 $out [1] 13989 17251 20993 25795 16009 $group [1] 3 7 8 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(12177, 12347, 12794, 14976, 16024, 12624, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53byw1476820336.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,] -718 -2218 -1890 -2095 -94 2852 6222 496 -10088 -4018 -3026 2571.0 [2,] -504 -1932 -1725 -1490 598 2852 7094 1368 -10048 -3465 -2558 3050.5 [3,] -167 -1547 -1197 200 798 2899 8130 2889 -9766 -3177 -1557 4064.0 [4,] 277 -1317 -655 440 1508 2994 8287 3221 -9057 -2959 -1498 4741.5 [5,] 965 -706 3 597 1508 2994 8544 4801 -9057 -2959 -462 4885.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -718.8526 -1981.557 -1953.0593 -1163.733 154.9963 2798.663 7287.029 [2,] 384.8526 -1112.443 -440.9407 1563.733 1441.0037 2999.337 8972.971 [,8] [,9] [,10] [,11] [,12] [1,] 1579.675 -10466.238 -3534.538 -2305.9933 2728.11 [2,] 4198.325 -9065.762 -2819.462 -808.0067 5399.89 $out [1] 3560 4000 2570 -7518 -1281 $group [1] 5 6 6 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-718, -504, -167, 277, 965, -2218, -1932, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fwcq1476820336.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] [1,] 9606.0 8196.0 10091.0 10767 10697.0 NA [2,] 10627.0 10381.0 10818.0 12266 14123.0 NA [3,] 12255.5 11699.5 12137.5 13714 15657.5 NA [4,] 13661.5 14133.0 14798.0 15975 18109.5 NA [5,] 13878.0 14687.0 14825.0 16974 18968.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 10871.44 9988.188 10322.2 12022.3 13839.23 NA [2,] 13639.56 13410.812 13952.8 15405.7 17475.77 NA $out [1] 22165 23533 21709 22205 20993 23882 21939 26740 25795 29016 $group [1] 1 1 2 2 3 3 4 4 5 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(9606, 10627, 12255.5, 13661.5, 13878, 8196, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/76sht1476820336.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,] 10527.8 10091.0 10497.50 [2,] 11399.6 10861.5 11332.75 [3,] 13217.0 12479.0 12925.75 [4,] 15322.3 14798.0 15096.00 [5,] 15779.8 14825.0 15830.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 11427.83 10683.54 11209.31 [2,] 15006.17 14274.46 14642.19 $out [1] 22520.2 25075.2 21939.0 23882.0 21937.0 25136.5 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(10527.8, 11399.6, 13217, 15322.3, 15779.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1suqu1476820336.ps tmp/1suqu1476820336.png",intern=TRUE)) character(0) > try(system("convert tmp/28a8k1476820336.ps tmp/28a8k1476820336.png",intern=TRUE)) character(0) > try(system("convert tmp/3g1nh1476820336.ps tmp/3g1nh1476820336.png",intern=TRUE)) character(0) > try(system("convert tmp/40pai1476820336.ps tmp/40pai1476820336.png",intern=TRUE)) character(0) > try(system("convert tmp/53byw1476820336.ps tmp/53byw1476820336.png",intern=TRUE)) character(0) > try(system("convert tmp/6fwcq1476820336.ps tmp/6fwcq1476820336.png",intern=TRUE)) character(0) > try(system("convert tmp/76sht1476820336.ps tmp/76sht1476820336.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.372 0.192 2.607