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(82303,79596,74472,73562,66618,69029,89899,93774,90305,83799,80320,82497,84420,84646,84186,83269,77793,81145,101691,107357,104253,95963,91432,94324,93855,92183,87600,83641,78195,79604,100846,105293,102518,93132,87479,85476,85460,82868,79941,76909,72613,72496,93244,99126,96748,89318,84724,83111,87497,86961,82319,79196,76898,77971,97335,106855,105401,99108,93456,92506,94602,93027,89722,87391,83030,83390,104501,110393,111017,103434,97817,96893) > 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,] 82303 84420 93855 85460 87497 94602 NA [2,] 79596 84646 92183 82868 86961 93027 NA [3,] 74472 84186 87600 79941 82319 89722 NA [4,] 73562 83269 83641 76909 79196 87391 NA [5,] 66618 77793 78195 72613 76898 83030 NA [6,] 69029 81145 79604 72496 77971 83390 NA [7,] 89899 101691 100846 93244 97335 104501 NA [8,] 93774 107357 105293 99126 106855 110393 NA [9,] 90305 104253 102518 96748 105401 111017 NA [10,] 83799 95963 93132 89318 99108 103434 NA [11,] 80320 91432 87479 84724 93456 97817 NA [12,] 82497 94324 85476 83111 92506 96893 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2707 226 -1672 -2592 -536 -1575 NA [2,] -5124 -460 -4583 -2927 -4642 -3305 NA [3,] -910 -917 -3959 -3032 -3123 -2331 NA [4,] -6944 -5476 -5446 -4296 -2298 -4361 NA [5,] 2411 3352 1409 -117 1073 360 NA [6,] 20870 20546 21242 20748 19364 21111 NA [7,] 3875 5666 4447 5882 9520 5892 NA [8,] -3469 -3104 -2775 -2378 -1454 624 NA [9,] -6506 -8290 -9386 -7430 -6293 -7583 NA [10,] -3479 -4531 -5653 -4594 -5652 -5617 NA [11,] 2177 2892 -2003 -1613 -950 -924 NA [12,] 1923 -469 -16 4386 2096 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/1jy3u1412937214.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/2h6eu1412937214.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/369bz1412937214.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/4vbbe1412937214.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,] 82303.0 79596.0 74472.0 73562.0 66618.0 69029.0 89899.0 93774 90305.0 [2,] 84420.0 82868.0 79941.0 76909.0 72613.0 72496.0 93244.0 99126 96748.0 [3,] 86478.5 85803.5 83252.5 81232.5 77345.5 78787.5 99090.5 106074 103385.5 [4,] 93855.0 92183.0 87600.0 83641.0 78195.0 81145.0 101691.0 107357 105401.0 [5,] 94602.0 93027.0 89722.0 87391.0 83030.0 83390.0 104501.0 110393 111017.0 [,10] [,11] [,12] [1,] 83799.0 80320.0 82497 [2,] 89318.0 84724.0 83111 [3,] 94547.5 89455.5 88991 [4,] 99108.0 93456.0 94324 [5,] 103434.0 97817.0 96893 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 80392.62 79795.02 78312.2 76890.14 73744.93 73208.62 93641.91 100764.7 [2,] 92564.38 91811.98 88192.8 85574.86 80946.07 84366.38 104539.09 111383.3 [,9] [,10] [,11] [,12] [1,] 97804.04 88232.63 83823.08 81758.25 [2,] 108966.96 100862.37 95087.92 96223.75 $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(82303, 84420, 86478.5, 93855, 94602, 79596, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/543mz1412937214.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,] -2707.0 -5124 -3959.0 -6944.0 -117 20546 3875 -3469.0 -9386.0 -5653.0 [2,] -2592.0 -4642 -3123.0 -5476.0 360 20546 4447 -3104.0 -8290.0 -5652.0 [3,] -1623.5 -3944 -2681.5 -4903.5 1241 20809 5774 -2576.5 -7506.5 -5105.5 [4,] -536.0 -2927 -917.0 -4296.0 2411 21111 5892 -1454.0 -6506.0 -4531.0 [5,] 226.0 -460 -910.0 -4296.0 3352 21242 5892 624.0 -6293.0 -3479.0 [,11] [,12] [1,] -2003 -469 [2,] -1613 -16 [3,] -937 1923 [4,] 2177 2096 [5,] 2892 4386 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2949.6864 -5050.23 -4104.441 -5664.638 -81.96125 20444.56 4841.928 [2,] -297.3136 -2837.77 -1258.559 -4142.362 2563.96125 21173.44 6706.072 [,8] [,9] [,10] [,11] [,12] [1,] -3640.803 -8657.238 -5828.581 -3381.672 430.6661 [2,] -1512.197 -6355.762 -4382.419 1507.672 3415.3339 $out [1] -2298 19364 9520 $group [1] 4 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2707, -2592, -1623.5, -536, 226, -5124, -4642, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xr8b1412937214.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,] 66618.0 77793.0 78195.0 72496.0 76898.0 83030.0 NA [2,] 74017.0 83727.5 84558.5 78425.0 80757.5 88556.5 NA [3,] 81311.5 88039.0 89891.5 83917.5 90001.5 95747.5 NA [4,] 86849.0 98827.0 97350.5 91281.0 98221.5 103967.5 NA [5,] 93774.0 107357.0 105293.0 99126.0 106855.0 111017.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 75458.74 81152.02 84056.98 78053.79 82036.05 88718.44 NA [2,] 87164.26 94925.98 95726.02 89781.21 97966.95 102776.56 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(66618, 74017, 81311.5, 86849, 93774, 77793, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/70s0h1412937214.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,] 75857.83 77345.50 75889.38 [2,] 81850.67 82242.50 82077.69 [3,] 88578.67 87734.75 88629.31 [4,] 96022.50 96819.00 96084.94 [5,] 103799.67 106074.00 103949.62 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 82114.80 81086.31 82240.51 [2,] 95042.53 94383.19 95018.11 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(75857.8333333333, 81850.6666666667, 88578.6666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jy3u1412937214.ps tmp/1jy3u1412937214.png",intern=TRUE)) character(0) > try(system("convert tmp/2h6eu1412937214.ps tmp/2h6eu1412937214.png",intern=TRUE)) character(0) > try(system("convert tmp/369bz1412937214.ps tmp/369bz1412937214.png",intern=TRUE)) character(0) > try(system("convert tmp/4vbbe1412937214.ps tmp/4vbbe1412937214.png",intern=TRUE)) character(0) > try(system("convert tmp/543mz1412937214.ps tmp/543mz1412937214.png",intern=TRUE)) character(0) > try(system("convert tmp/6xr8b1412937214.ps tmp/6xr8b1412937214.png",intern=TRUE)) character(0) > try(system("convert tmp/70s0h1412937214.ps tmp/70s0h1412937214.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.392 0.469 2.894