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(15071,14236,14771,14804,15597,15418,16903,16350,16393,15685,14556,14850,15391,13704,15409,15098,15254,15522,16669,16238,16246,15424,14952,15008,14929,13905,14994,14753,15031,15386,16160,16116,16219,16064,15436,15404,15112,14119,14775,14289,15121,15371,15782,16104,15674,15105,14223,14385,14558,13804,14672,14244,15089,14580,15218,15696,15129,15110,14204,13655,14534,12746,14074,13699,14184,14110,15820,15362,14993,14437,13694,13688) > 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,] 15071 15391 14929 15112 14558 14534 NA [2,] 14236 13704 13905 14119 13804 12746 NA [3,] 14771 15409 14994 14775 14672 14074 NA [4,] 14804 15098 14753 14289 14244 13699 NA [5,] 15597 15254 15031 15121 15089 14184 NA [6,] 15418 15522 15386 15371 14580 14110 NA [7,] 16903 16669 16160 15782 15218 15820 NA [8,] 16350 16238 16116 16104 15696 15362 NA [9,] 16393 16246 16219 15674 15129 14993 NA [10,] 15685 15424 16064 15105 15110 14437 NA [11,] 14556 14952 15436 14223 14204 13694 NA [12,] 14850 15008 15404 14385 13655 13688 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -835 -1687 -1024 -993 -754 -1788 NA [2,] 535 1705 1089 656 868 1328 NA [3,] 33 -311 -241 -486 -428 -375 NA [4,] 793 156 278 832 845 485 NA [5,] -179 268 355 250 -509 -74 NA [6,] 1485 1147 774 411 638 1710 NA [7,] -553 -431 -44 322 478 -458 NA [8,] 43 8 103 -430 -567 -369 NA [9,] -708 -822 -155 -569 -19 -556 NA [10,] -1129 -472 -628 -882 -906 -743 NA [11,] 294 56 -32 162 -549 -6 NA [12,] 541 -79 -292 173 879 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/1y53g1424868275.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/25vs11424868275.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/3af1m1424868275.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/44r061424868275.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] [1,] 14534 13704.0 14672 13699 15031 14110.0 15218 15362 14993.0 14437 13694.0 [2,] 14558 13704.0 14672 14244 15031 14580.0 15782 15696 15129.0 15105 14204.0 [3,] 15000 13854.5 14773 14521 15105 15378.5 15990 16110 15946.5 15267 14389.5 [4,] 15112 14119.0 14994 14804 15254 15418.0 16669 16238 16246.0 15685 14952.0 [5,] 15391 14236.0 15409 15098 15254 15522.0 16903 16350 16393.0 16064 15436.0 [,12] [1,] 13655.0 [2,] 13688.0 [3,] 14617.5 [4,] 15008.0 [5,] 15404.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 14642.65 13586.81 14565.3 14159.78 14961.16 14837.96 15417.86 15760.39 [2,] 15357.35 14122.19 14980.7 14882.22 15248.84 15919.04 16562.14 16459.61 [,9] [,10] [,11] [,12] [1,] 15226 14892.88 13907.02 13766.06 [2,] 16667 15641.12 14871.98 15468.94 $out [1] 12746 14074 15597 14184 $group [1] 2 3 5 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(14534, 14558, 15000, 15112, 15391, 13704, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5iqe71424868275.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] [1,] -1788.0 535.0 -486 156 -509 411.0 -553.0 -567.0 -822.0 -1129.0 -32 [2,] -1687.0 656.0 -428 278 -179 638.0 -458.0 -430.0 -708.0 -906.0 -32 [3,] -1008.5 978.5 -343 639 88 960.5 -237.5 -180.5 -562.5 -812.5 25 [4,] -835.0 1328.0 -241 832 268 1485.0 322.0 43.0 -155.0 -628.0 162 [5,] -754.0 1705.0 33 845 355 1710.0 478.0 103.0 -19.0 -472.0 294 [,12] [1,] -292 [2,] -79 [3,] 173 [4,] 541 [5,] 879 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1558.0675 545.0383 -463.621 281.6521 -200.3294 414.1576 -740.6252 [2,] -458.9325 1411.9617 -222.379 996.3479 376.3294 1506.8424 265.6252 [,8] [,9] [,10] [,11] [,12] [1,] -485.6003 -919.2029 -991.819 -100.1363 -265.0904 [2,] 124.6003 -205.7971 -633.181 150.1363 611.0904 $out [1] -549 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1788, -1687, -1008.5, -835, -754, 535, 656, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6d2g01424868275.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,] 14236.0 14952 13905.0 14119.0 13655.0 12746.0 NA [2,] 14787.5 15053 14961.5 14337.0 14224.0 13696.5 NA [3,] 15244.5 15400 15395.0 15108.5 14626.0 14147.0 NA [4,] 16017.5 15880 16090.0 15522.5 15119.5 14763.5 NA [5,] 16903.0 16669 16219.0 16104.0 15696.0 15820.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 14683.49 15022.8 14880.28 14567.79 14217.56 13660.33 NA [2,] 15805.51 15777.2 15909.72 15649.21 15034.44 14633.67 NA $out [1] 13704 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(14236, 14787.5, 15244.5, 16017.5, 16903, 14952, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/70ktf1424868275.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,] 13752.33 13854.50 13897.25 [2,] 14504.58 14569.25 14527.06 [3,] 14989.25 15052.50 14985.06 [4,] 15539.92 15662.50 15557.62 [5,] 16092.00 16110.00 16166.62 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 14517.03 14553.86 14515.02 [2,] 15461.47 15551.14 15455.11 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(13752.3333333333, 14504.5833333333, 14989.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1y53g1424868275.ps tmp/1y53g1424868275.png",intern=TRUE)) character(0) > try(system("convert tmp/25vs11424868275.ps tmp/25vs11424868275.png",intern=TRUE)) character(0) > try(system("convert tmp/3af1m1424868275.ps tmp/3af1m1424868275.png",intern=TRUE)) character(0) > try(system("convert tmp/44r061424868275.ps tmp/44r061424868275.png",intern=TRUE)) character(0) > try(system("convert tmp/5iqe71424868275.ps tmp/5iqe71424868275.png",intern=TRUE)) character(0) > try(system("convert tmp/6d2g01424868275.ps tmp/6d2g01424868275.png",intern=TRUE)) character(0) > try(system("convert tmp/70ktf1424868275.ps tmp/70ktf1424868275.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.535 0.399 2.957