R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-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(14.544,14.931,14.886,16.005,17.064,15.168,16.050,15.839,15.137,14.954,15.648,15.305,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) > 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] 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,] 14.544 15.579 19.394 20.830 25.204 32.810 NA [2,] 14.931 16.348 20.148 23.595 25.739 32.242 NA [3,] 14.886 15.928 20.108 22.937 26.434 32.700 NA [4,] 16.005 16.171 18.584 21.814 27.525 32.819 NA [5,] 17.064 15.937 18.441 21.928 30.695 33.947 NA [6,] 15.168 15.713 18.391 21.777 32.436 34.148 NA [7,] 16.050 15.594 19.178 21.383 30.160 35.261 NA [8,] 15.839 15.683 18.079 21.467 30.236 39.506 NA [9,] 15.137 16.438 18.483 22.052 31.293 41.591 NA [10,] 14.954 17.032 19.644 22.680 31.077 39.148 NA [11,] 15.648 17.696 19.195 24.320 32.226 41.216 NA [12,] 15.305 17.745 19.650 24.977 33.865 40.225 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.387 0.769 0.754 2.765 0.535 -0.568 NA [2,] -0.045 -0.420 -0.040 -0.658 0.695 0.458 NA [3,] 1.119 0.243 -1.524 -1.123 1.091 0.119 NA [4,] 1.059 -0.234 -0.143 0.114 3.170 1.128 NA [5,] -1.896 -0.224 -0.050 -0.151 1.741 0.201 NA [6,] 0.882 -0.119 0.787 -0.394 -2.276 1.113 NA [7,] -0.211 0.089 -1.099 0.084 0.076 4.245 NA [8,] -0.702 0.755 0.404 0.585 1.057 2.085 NA [9,] -0.183 0.594 1.161 0.628 -0.216 -2.443 NA [10,] 0.694 0.664 -0.449 1.640 1.149 2.068 NA [11,] -0.343 0.049 0.455 0.657 1.639 -0.991 NA [12,] 0.274 1.649 1.180 0.227 -1.055 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/1mihw1362672770.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/2xmpm1362672770.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/3j3a71362672770.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/4abzq1362672770.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,] 14.544 14.9310 14.8860 16.005 15.9370 15.168 15.5940 15.683 15.1370 14.954 [2,] 15.579 16.3480 15.9280 16.171 17.0640 15.713 16.0500 15.839 16.4380 17.032 [3,] 20.112 21.8715 21.5225 20.199 20.1845 20.084 20.2805 19.773 20.2675 21.162 [4,] 25.204 25.7390 26.4340 27.525 30.6950 32.436 30.1600 30.236 31.2930 31.077 [5,] 32.810 32.2420 32.7000 32.819 33.9470 34.148 35.2610 39.506 41.5910 39.148 [,11] [,12] [1,] 15.6480 15.3050 [2,] 17.6960 17.7450 [3,] 21.7575 22.3135 [4,] 32.2260 33.8650 [5,] 41.2160 40.2250 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 13.90356 15.814 14.74579 12.8753 11.39206 9.297125 11.17909 10.48647 [2,] 26.32044 27.929 28.29921 27.5227 28.97694 30.870875 29.38191 29.05953 [,9] [,10] [,11] [,12] [1,] 10.68555 12.10252 12.38518 11.91558 [2,] 29.84945 30.22148 31.12982 32.71142 $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(14.544, 15.579, 20.112, 25.204, 32.81, 14.931, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zdne1362672770.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,] 0.3870 -0.6580 -1.524 -0.2340 -0.2240 -2.276 -0.211 0.404 -0.2160 -0.4490 [2,] 0.3870 -0.4200 -1.123 -0.1430 -0.2240 -0.394 -0.211 0.404 -0.2160 0.6640 [3,] 0.6445 -0.0425 0.181 0.5865 -0.1005 0.334 0.080 0.670 0.2055 0.9215 [4,] 0.7690 0.4580 1.091 1.1280 0.2010 0.882 0.089 1.057 0.6280 1.6400 [5,] 0.7690 0.6950 1.119 1.1280 0.2010 1.113 0.089 1.057 1.1610 2.0680 [,11] [,12] [1,] -0.991 -1.055 [2,] -0.343 0.227 [3,] 0.252 0.274 [4,] 0.657 1.180 [5,] 1.639 1.649 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3980977 -0.6088384 -1.247102 -0.2333361 -0.3746387 -0.4890612 -0.1135097 [2,] 0.8909023 0.5238384 1.609102 1.4063361 0.1736387 1.1570612 0.2735097 [,8] [,9] [,10] [,11] [,12] [1,] 0.2487939 -0.3389073 0.2919485 -0.3930323 -0.3993874 [2,] 1.0912061 0.7499073 1.5510515 0.8970323 0.9473874 $out [1] 2.765 -0.568 3.170 -1.896 1.741 -1.099 4.245 -0.702 2.085 -2.443 $group [1] 1 1 4 5 5 7 7 8 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.386999999999999, 0.386999999999999, 0.644500000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kuo71362672770.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,] 14.5440 15.579 18.0790 20.830 25.2040 32.2420 NA [2,] 14.9425 15.698 18.4620 21.622 26.9795 32.8145 NA [3,] 15.2365 16.054 19.1865 21.990 30.4655 34.7045 NA [4,] 15.9220 16.735 19.6470 23.266 31.7595 39.8655 NA [5,] 17.0640 17.745 20.1480 24.977 33.8650 41.5910 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 14.78974 15.58102 18.64601 21.24016 28.28531 31.48849 NA [2,] 15.68326 16.52698 19.72699 22.73984 32.64569 37.92051 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(14.544, 14.9425, 15.2365, 15.922, 17.064, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7l1i61362672770.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,] 21.39350 19.77300 20.32162 [2,] 22.16633 20.14825 21.35106 [3,] 22.97042 20.27400 22.67731 [4,] 24.12742 21.64000 23.20413 [5,] 25.29450 22.31350 24.93212 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 22.07595 19.5936 21.83212 [2,] 23.86488 20.9544 23.52251 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(21.3935, 22.1663333333333, 22.9704166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1mihw1362672770.ps tmp/1mihw1362672770.png",intern=TRUE)) character(0) > try(system("convert tmp/2xmpm1362672770.ps tmp/2xmpm1362672770.png",intern=TRUE)) character(0) > try(system("convert tmp/3j3a71362672770.ps tmp/3j3a71362672770.png",intern=TRUE)) character(0) > try(system("convert tmp/4abzq1362672770.ps tmp/4abzq1362672770.png",intern=TRUE)) character(0) > try(system("convert tmp/5zdne1362672770.ps tmp/5zdne1362672770.png",intern=TRUE)) character(0) > try(system("convert tmp/6kuo71362672770.ps tmp/6kuo71362672770.png",intern=TRUE)) character(0) > try(system("convert tmp/7l1i61362672770.ps tmp/7l1i61362672770.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.326 0.578 3.897