R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(15.579,16.348,15.928,16.171,15.937,15.713,15.594,15.683,16.438,17.032,17.696,17.745,19.394,20.148,20.108,18.584,18.441,18.391,19.178,18.079,18.483,19.644,19.195,19.650,20.830,23.595,22.937,21.814,21.928,21.777,21.383,21.467,22.052,22.680,24.320,24.977,25.204,25.739,26.434,27.525,30.695,32.436,30.160,30.236,31.293,31.077,32.226,33.865,32.810,32.242,32.700,32.819,33.947,34.148,35.261,39.506,41.591,39.148,41.216,40.225,41.126,42.362,40.740,40.256,39.804,41.002,41.702,42.254,43.605,43.271,43.221,41.373,40.435,39.217,39.457,36.710,34.977,32.729,31.584,32.510,32.565,30.988,30.383,28.673) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.579 19.394 20.830 25.204 32.810 41.126 40.435 NA [2,] 16.348 20.148 23.595 25.739 32.242 42.362 39.217 NA [3,] 15.928 20.108 22.937 26.434 32.700 40.740 39.457 NA [4,] 16.171 18.584 21.814 27.525 32.819 40.256 36.710 NA [5,] 15.937 18.441 21.928 30.695 33.947 39.804 34.977 NA [6,] 15.713 18.391 21.777 32.436 34.148 41.002 32.729 NA [7,] 15.594 19.178 21.383 30.160 35.261 41.702 31.584 NA [8,] 15.683 18.079 21.467 30.236 39.506 42.254 32.510 NA [9,] 16.438 18.483 22.052 31.293 41.591 43.605 32.565 NA [10,] 17.032 19.644 22.680 31.077 39.148 43.271 30.988 NA [11,] 17.696 19.195 24.320 32.226 41.216 43.221 30.383 NA [12,] 17.745 19.650 24.977 33.865 40.225 41.373 28.673 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.769 0.754 2.765 0.535 -0.568 1.236 -1.218 NA [2,] -0.420 -0.040 -0.658 0.695 0.458 -1.622 0.240 NA [3,] 0.243 -1.524 -1.123 1.091 0.119 -0.484 -2.747 NA [4,] -0.234 -0.143 0.114 3.170 1.128 -0.452 -1.733 NA [5,] -0.224 -0.050 -0.151 1.741 0.201 1.198 -2.248 NA [6,] -0.119 0.787 -0.394 -2.276 1.113 0.700 -1.145 NA [7,] 0.089 -1.099 0.084 0.076 4.245 0.552 0.926 NA [8,] 0.755 0.404 0.585 1.057 2.085 1.351 0.055 NA [9,] 0.594 1.161 0.628 -0.216 -2.443 -0.334 -1.577 NA [10,] 0.664 -0.449 1.640 1.149 2.068 -0.050 -0.605 NA [11,] 0.049 0.455 0.657 1.639 -0.991 -1.848 -1.710 NA [12,] 1.649 1.180 0.227 -1.055 0.901 -0.938 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/1sb5v1413722687.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/2x9xf1413722687.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/3o81y1413722687.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/48iw41413722687.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] [1,] 15.5790 16.3480 15.9280 16.1710 15.9370 15.7130 15.5940 15.683 16.4380 [2,] 20.1120 21.8715 21.5225 20.1990 20.1845 20.0840 20.2805 19.773 20.2675 [3,] 25.2040 25.7390 26.4340 27.5250 30.6950 32.4360 30.1600 30.236 31.2930 [4,] 36.6225 35.7295 36.0785 34.7645 34.4620 33.4385 33.4225 36.008 37.0780 [5,] 41.1260 42.3620 40.7400 40.2560 39.8040 41.0020 41.7020 42.254 43.6050 [,10] [,11] [,12] [1,] 17.0320 17.6960 17.7450 [2,] 21.1620 21.7575 22.3135 [3,] 30.9880 30.3830 28.6730 [4,] 35.1125 36.7210 37.0450 [5,] 43.2710 43.2210 41.3730 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.3442 17.46323 17.74139 18.82672 22.16871 24.46091 22.31181 20.54072 [2,] 35.0638 34.01477 35.12661 36.22328 39.22129 40.41109 38.00819 39.93128 [,9] [,10] [,11] [,12] [1,] 21.25404 22.65699 21.44704 19.87559 [2,] 41.33196 39.31901 39.31896 37.47041 $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(15.579, 20.112, 25.204, 36.6225, 41.126, 16.348, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kbyy1413722687.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] [1,] -1.2180 -1.622 -2.7470 -1.733 -0.2240 -2.2760 0.076 0.0550 -2.4430 -0.6050 [2,] -0.0165 -0.539 -1.3235 -0.343 -0.1875 -0.7695 0.080 0.4945 -0.9555 -0.2495 [3,] 0.7540 -0.040 -0.4840 -0.143 -0.0500 -0.1190 0.089 0.7550 -0.2160 0.6640 [4,] 1.0025 0.349 0.1810 0.621 0.6995 0.7435 0.739 1.2040 0.6110 1.3945 [5,] 1.2360 0.695 1.0910 1.128 1.7410 1.1130 0.926 2.0850 1.1610 2.0680 [,11] [,12] [1,] -1.8480 -1.055 [2,] -1.3505 -0.938 [3,] 0.0490 0.564 [4,] 0.5560 1.180 [5,] 1.6390 1.649 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.1454696 -0.5702993 -1.3824631 -0.7186852 -0.5797021 -1.0225392 [2,] 1.3625304 0.4902993 0.4144631 0.4326852 0.4797021 0.7845392 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.3045442 0.331298 -1.1514885 -0.3177703 -1.089531 -0.8021784 [2,] 0.4825442 1.178702 0.7194885 1.6457703 1.187531 1.9301784 $out [1] 2.765 3.170 -2.248 -1.099 4.245 $group [1] 1 4 5 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.218, -0.0165000000000024, 0.754000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68gig1413722687.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] [1,] 15.579 18.0790 20.830 25.2040 32.2420 39.8040 28.6730 NA [2,] 15.698 18.4620 21.622 26.9795 32.8145 40.8710 31.2860 NA [3,] 16.054 19.1865 21.990 30.4655 34.7045 41.5375 32.6470 NA [4,] 16.735 19.6470 23.266 31.7595 39.8655 42.7915 37.9635 NA [5,] 17.745 20.1480 24.977 33.8650 41.5910 43.6050 40.4350 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.58102 18.64601 21.24016 28.28531 31.48849 40.66155 29.60135 NA [2,] 16.52698 19.72699 22.73984 32.64569 37.92051 42.41345 35.69265 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(15.579, 15.698, 16.054, 16.735, 17.745, 18.079, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7b88g1413722687.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,] 27.69700 25.2040 26.76125 [2,] 27.93621 26.9795 27.40250 [3,] 28.42536 30.1980 28.25225 [4,] 29.27621 30.8415 28.80050 [5,] 29.75100 32.4360 29.67925 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 27.81417 28.43652 27.61461 [2,] 29.03654 31.95948 28.88989 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(27.697, 27.9362142857143, 28.4253571428571, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1sb5v1413722687.ps tmp/1sb5v1413722687.png",intern=TRUE)) character(0) > try(system("convert tmp/2x9xf1413722687.ps tmp/2x9xf1413722687.png",intern=TRUE)) character(0) > try(system("convert tmp/3o81y1413722687.ps tmp/3o81y1413722687.png",intern=TRUE)) character(0) > try(system("convert tmp/48iw41413722687.ps tmp/48iw41413722687.png",intern=TRUE)) character(0) > try(system("convert tmp/5kbyy1413722687.ps tmp/5kbyy1413722687.png",intern=TRUE)) character(0) > try(system("convert tmp/68gig1413722687.ps tmp/68gig1413722687.png",intern=TRUE)) character(0) > try(system("convert tmp/7b88g1413722687.ps tmp/7b88g1413722687.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.509 0.375 2.916