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(8378669.00,7557530.00,8656721.00,7729873.00,7067002.00,7222189.00,6758161.00,6745665.00,8203660.00,8799755.00,7995151.00,6844694.00,7400186.00,6146183.00,6793027.00,5815146.00,5993505.00,5838016.00,5926815.00,5642890.00,7120621.00,7781743.00,7638921.00,5886070.00,7358890.00,6981189.00,8423532.00,6819313.00,6727221.00,6923349.00,7578240.00,7228898.00,8988846.00,8404694.00,9601659.00,8213138.00,8434646.00,8466539.00,9106270.00,8438555.00,7723821.00,7538413.00,7199881.00,8168314.00,9045790.00,8544483.00,9020709.00,7932021.00,8435986.00,7920357.00,8333659.00,7415547.00,7770392.00,8188878.00,8092465.00,7188528.00,8152373.00,9025069.00,9233973.00,6916290.00,8171721.00,7012501.00,8779456.00,7308709.00,8084547.00,8255978.00,7658071.00,7371877.00,8780827.00,10116778.00,9567175.00,7455902.00) > 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,] 8378669 7400186 7358890 8434646 8435986 8171721 NA [2,] 7557530 6146183 6981189 8466539 7920357 7012501 NA [3,] 8656721 6793027 8423532 9106270 8333659 8779456 NA [4,] 7729873 5815146 6819313 8438555 7415547 7308709 NA [5,] 7067002 5993505 6727221 7723821 7770392 8084547 NA [6,] 7222189 5838016 6923349 7538413 8188878 8255978 NA [7,] 6758161 5926815 7578240 7199881 8092465 7658071 NA [8,] 6745665 5642890 7228898 8168314 7188528 7371877 NA [9,] 8203660 7120621 8988846 9045790 8152373 8780827 NA [10,] 8799755 7781743 8404694 8544483 9025069 10116778 NA [11,] 7995151 7638921 9601659 9020709 9233973 9567175 NA [12,] 6844694 5886070 8213138 7932021 6916290 7455902 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -821139 -1254003 -377701 31893 -515629 -1159220 NA [2,] 1099191 646844 1442343 639731 413302 1766955 NA [3,] -926848 -977881 -1604219 -667715 -918112 -1470747 NA [4,] -662871 178359 -92092 -714734 354845 775838 NA [5,] 155187 -155489 196128 -185408 418486 171431 NA [6,] -464028 88799 654891 -338532 -96413 -597907 NA [7,] -12496 -283925 -349342 968433 -903937 -286194 NA [8,] 1457995 1477731 1759948 877476 963845 1408950 NA [9,] 596095 661122 -584152 -501307 872696 1335951 NA [10,] -804604 -142822 1196965 476226 208904 -549603 NA [11,] -1150457 -1752851 -1388521 -1088688 -2317683 -2111273 NA [12,] 555492 1472820 221508 503965 1255431 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/11cue1413030339.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/2k0xt1413030339.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/3ifcp1413030339.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/4u5sg1413030339.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,] 7358890 6146183 8333659 5815146 5993505 5838016 5926815 6745665 7120621 [2,] 7400186 6981189 8333659 6819313 6727221 6923349 6758161 6745665 8152373 [3,] 8275195 7285016 8540126 7362128 7395412 7380301 7389060 7208713 8492244 [4,] 8434646 7920357 8779456 7729873 7770392 8188878 7658071 7371877 8988846 [5,] 8435986 8466539 9106270 8438555 8084547 8255978 8092465 8168314 9045790 [,10] [,11] [,12] [1,] 7781743 7638921 5886070 [2,] 8404694 7995151 6844694 [3,] 8672119 9127341 7186096 [4,] 9025069 9567175 7932021 [5,] 9025069 9601659 8213138 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 7607935 6679222 8252573 6774787 6722533 6563994 6808589 6804786 7952691 [2,] 8942455 7890809 8827680 7949469 8068290 8196608 7969532 7612640 9031796 [,10] [,11] [,12] [1,] 8271957 8113335 6484735 [2,] 9072281 10141347 7887457 $out [1] 6793027 5642890 10116778 $group [1] 3 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(7358890, 7400186, 8275195, 8434646, 8435986, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5jopi1413030339.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] [1,] -1254003 413302.0 -1604219.0 -714734.0 -185408 -597907.0 -349342.0 [2,] -1159220 639731.0 -1470747.0 -662871.0 -155489 -464028.0 -349342.0 [3,] -668384 873017.5 -952364.5 43133.5 163309 -217472.5 -285059.5 [4,] -377701 1442343.0 -918112.0 354845.0 196128 88799.0 -12496.0 [5,] 31893 1766955.0 -667715.0 775838.0 418486 654891.0 -12496.0 [,8] [,9] [,10] [,11] [,12] [1,] 877476 -584152.0 -804604 -2317683 221508 [2,] 963845 -501307.0 -549603 -2111273 503965 [3,] 1433472 628608.5 33041 -1570686 555492 [4,] 1477731 872696.0 476226 -1150457 1255431 [5,] 1759948 1335951.0 1196965 -1088688 1472820 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1172489 355306.8 -1308831.9 -613326.2 -63495.32 -574063.8 -502336.05 [2,] -164279 1390728.2 -595897.1 699593.2 390113.32 139118.8 -67782.95 [,8] [,9] [,10] [,11] [,12] [1,] 1101999 -257667.8 -628651.8 -2190443.4 24508.02 [2,] 1764946 1514884.8 694733.8 -950928.6 1086475.98 $out [1] 968433 -903937 $group [1] 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1254003, -1159220, -668384, -377701, 31893, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61o9z1413030339.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,] 6745665 5642890 6727221 7199881 6916290 7012501 NA [2,] 6955848 5862043 6952269 7827921 7592970 7413890 NA [3,] 7643702 6069844 7468565 8436600 8122419 8128134 NA [4,] 8291164 7260404 8414113 8782596 8384822 8780142 NA [5,] 8799755 7781743 9601659 9106270 9233973 10116778 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 7034655 5432042 6801808 8001167 7761250 7504977 NA [2,] 8252748 6707646 8135322 8872034 8483588 8751291 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(6745665, 6955848, 7643701.5, 8291164.5, 8799755, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qw0c1413030339.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,] 7057695 7186096 7096256 [2,] 7217884 7323572 7290967 [3,] 7337594 7392236 7460747 [4,] 8365398 8516185 8551734 [5,] 8842931 9127341 8867708 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6814204 6848277 6885703 [2,] 7860983 7936195 8035791 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(7057695.33333333, 7217883.58333333, 7337593.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11cue1413030339.ps tmp/11cue1413030339.png",intern=TRUE)) character(0) > try(system("convert tmp/2k0xt1413030339.ps tmp/2k0xt1413030339.png",intern=TRUE)) character(0) > try(system("convert tmp/3ifcp1413030339.ps tmp/3ifcp1413030339.png",intern=TRUE)) character(0) > try(system("convert tmp/4u5sg1413030339.ps tmp/4u5sg1413030339.png",intern=TRUE)) character(0) > try(system("convert tmp/5jopi1413030339.ps tmp/5jopi1413030339.png",intern=TRUE)) character(0) > try(system("convert tmp/61o9z1413030339.ps tmp/61o9z1413030339.png",intern=TRUE)) character(0) > try(system("convert tmp/7qw0c1413030339.ps tmp/7qw0c1413030339.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.519 0.392 2.933