R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(280190,280408,276836,275216,274352,271311,289802,290726,292300,278506,269826,265861,269034,264176,255198,253353,246057,235372,258556,260993,254663,250643,243422,247105,248541,245039,237080,237085,225554,226839,247934,248333,246969,245098,246263,255765,264319,268347,273046,273963,267430,271993,292710,295881,293299,288576,286445,297584,300431,298522,292213,285383,277537,277891,302686,300653,296369,287224,279998,283495,285775,282329,277799,271980,266730,262433,285378,286692,282917,277686,274371,277466,290604,290770,283654,278601,274405,272817,294292,300562,298982,296917,295008,297295) > par1 = '52' > par1 <- '52' > #'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] 1 > 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] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 280190 277537 [2,] 280408 277891 [3,] 276836 302686 [4,] 275216 300653 [5,] 274352 296369 [6,] 271311 287224 [7,] 289802 279998 [8,] 290726 283495 [9,] 292300 285775 [10,] 278506 282329 [11,] 269826 277799 [12,] 265861 271980 [13,] 269034 266730 [14,] 264176 262433 [15,] 255198 285378 [16,] 253353 286692 [17,] 246057 282917 [18,] 235372 277686 [19,] 258556 274371 [20,] 260993 277466 [21,] 254663 290604 [22,] 250643 290770 [23,] 243422 283654 [24,] 247105 278601 [25,] 248541 274405 [26,] 245039 272817 [27,] 237080 294292 [28,] 237085 300562 [29,] 225554 298982 [30,] 226839 296917 [31,] 247934 295008 [32,] 248333 297295 [33,] 246969 NA [34,] 245098 NA [35,] 246263 NA [36,] 255765 NA [37,] 264319 NA [38,] 268347 NA [39,] 273046 NA [40,] 273963 NA [41,] 267430 NA [42,] 271993 NA [43,] 292710 NA [44,] 295881 NA [45,] 293299 NA [46,] 288576 NA [47,] 286445 NA [48,] 297584 NA [49,] 300431 NA [50,] 298522 NA [51,] 292213 NA [52,] 285383 NA > darr [,1] [,2] [1,] 218 354 [2,] -3572 24795 [3,] -1620 -2033 [4,] -864 -4284 [5,] -3041 -9145 [6,] 18491 -7226 [7,] 924 3497 [8,] 1574 2280 [9,] -13794 -3446 [10,] -8680 -4530 [11,] -3965 -5819 [12,] 3173 -5250 [13,] -4858 -4297 [14,] -8978 22945 [15,] -1845 1314 [16,] -7296 -3775 [17,] -10685 -5231 [18,] 23184 -3315 [19,] 2437 3095 [20,] -6330 13138 [21,] -4020 166 [22,] -7221 -7116 [23,] 3683 -5053 [24,] 1436 -4196 [25,] -3502 -1588 [26,] -7959 21475 [27,] 5 6270 [28,] -11531 -1580 [29,] 1285 -2065 [30,] 21095 -1909 [31,] 399 2287 [32,] -1364 NA [33,] -1871 NA [34,] 1165 NA [35,] 9502 NA [36,] 8554 NA [37,] 4028 NA [38,] 4699 NA [39,] 917 NA [40,] -6533 NA [41,] 4563 NA [42,] 20717 NA [43,] 3171 NA [44,] -2582 NA [45,] -4723 NA [46,] -2131 NA [47,] 11139 NA [48,] 2847 NA [49,] -1909 NA [50,] -6309 NA [51,] -6830 NA [52,] -7846 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/1eth41384693917.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/2p4721384693917.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/3z18e1384693917.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/4t6bu1384693917.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] [1,] 277537.0 277891.0 276836 275216.0 274352.0 271311.0 279998 283495.0 [2,] 277537.0 277891.0 276836 275216.0 274352.0 271311.0 279998 283495.0 [3,] 278863.5 279149.5 289761 287934.5 285360.5 279267.5 284900 287110.5 [4,] 280190.0 280408.0 302686 300653.0 296369.0 287224.0 289802 290726.0 [5,] 280190.0 280408.0 302686 300653.0 296369.0 287224.0 289802 290726.0 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [1,] 285775.0 278506.0 269826.0 265861.0 266730 262433.0 255198 253353.0 246057 [2,] 285775.0 278506.0 269826.0 265861.0 266730 262433.0 255198 253353.0 246057 [3,] 289037.5 280417.5 273812.5 268920.5 267882 263304.5 270288 270022.5 264487 [4,] 292300.0 282329.0 277799.0 271980.0 269034 264176.0 285378 286692.0 282917 [5,] 292300.0 282329.0 277799.0 271980.0 269034 264176.0 285378 286692.0 282917 [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 235372 258556.0 260993.0 254663.0 250643.0 243422 247105 248541 245039 [2,] 235372 258556.0 260993.0 254663.0 250643.0 243422 247105 248541 245039 [3,] 256529 266463.5 269229.5 272633.5 270706.5 263538 262853 261473 258928 [4,] 277686 274371.0 277466.0 290604.0 290770.0 283654 278601 274405 272817 [5,] 277686 274371.0 277466.0 290604.0 290770.0 283654 278601 274405 272817 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 237080 237085.0 225554 226839 247934 248333 246969 245098 246263 255765 [2,] 237080 237085.0 225554 226839 247934 248333 246969 245098 246263 255765 [3,] 265686 268823.5 262268 261878 271471 272814 246969 245098 246263 255765 [4,] 294292 300562.0 298982 296917 295008 297295 246969 245098 246263 255765 [5,] 294292 300562.0 298982 296917 295008 297295 246969 245098 246263 255765 [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [1,] 264319 268347 273046 273963 267430 271993 292710 295881 293299 288576 [2,] 264319 268347 273046 273963 267430 271993 292710 295881 293299 288576 [3,] 264319 268347 273046 273963 267430 271993 292710 295881 293299 288576 [4,] 264319 268347 273046 273963 267430 271993 292710 295881 293299 288576 [5,] 264319 268347 273046 273963 267430 271993 292710 295881 293299 288576 [,47] [,48] [,49] [,50] [,51] [,52] [1,] 286445 297584 300431 298522 292213 285383 [2,] 286445 297584 300431 298522 292213 285383 [3,] 286445 297584 300431 298522 292213 285383 [4,] 286445 297584 300431 298522 292213 285383 [5,] 286445 297584 300431 298522 292213 285383 $n [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 275899.5 276337.4 260880.6 259515.6 260762.5 261489 273946.7 279031.8 [2,] 281827.5 281961.6 318641.4 316353.4 309958.5 297046 295853.3 295189.2 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 281747.6 276146.3 264904.8 262084.2 265307.9 261357.2 236570 232775.2 [2,] 296327.4 284688.7 282720.2 275756.8 270456.1 265251.8 304006 307269.8 [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 223305.9 209254.6 248794.5 250825.4 232479.2 225875.5 218589.7 227664.8 [2,] 305668.1 303803.4 284132.5 287633.6 312787.8 315537.5 308486.3 298041.2 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] 232577 227893.6 201767.1 197905.2 180232.1 183584.8 218878.6 218112.2 [2,] 290369 289962.4 329604.9 339741.8 344303.9 340171.2 324063.4 327515.8 [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 246969 245098 246263 255765 264319 268347 273046 273963 267430 271993 [2,] 246969 245098 246263 255765 264319 268347 273046 273963 267430 271993 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [,51] [,52] [1,] 292710 295881 293299 288576 286445 297584 300431 298522 292213 285383 [2,] 292710 295881 293299 288576 286445 297584 300431 298522 292213 285383 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" "49" "50" "51" "52" Warning message: In bxp(list(stats = c(277537, 277537, 278863.5, 280190, 280190, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5oe7k1384693917.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,] 218 -3572.0 -2033.0 -4284 -9145 -7226.0 924.0 1574 -13794 -8680 -5819 [2,] 218 -3572.0 -2033.0 -4284 -9145 -7226.0 924.0 1574 -13794 -8680 -5819 [3,] 286 10611.5 -1826.5 -2574 -6093 5632.5 2210.5 1927 -8620 -6605 -4892 [4,] 354 24795.0 -1620.0 -864 -3041 18491.0 3497.0 2280 -3446 -4530 -3965 [5,] 354 24795.0 -1620.0 -864 -3041 18491.0 3497.0 2280 -3446 -4530 -3965 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] -5250.0 -4858.0 -8978.0 -1845.0 -7296.0 -10685 -3315.0 2437 -6330 -4020 [2,] -5250.0 -4858.0 -8978.0 -1845.0 -7296.0 -10685 -3315.0 2437 -6330 -4020 [3,] -1038.5 -4577.5 6983.5 -265.5 -5535.5 -7958 9934.5 2766 3404 -1927 [4,] 3173.0 -4297.0 22945.0 1314.0 -3775.0 -5231 23184.0 3095 13138 166 [5,] 3173.0 -4297.0 22945.0 1314.0 -3775.0 -5231 23184.0 3095 13138 166 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] -7221.0 -5053 -4196 -3502 -7959 5.0 -11531.0 -2065 -1909 399 -1364 [2,] -7221.0 -5053 -4196 -3502 -7959 5.0 -11531.0 -2065 -1909 399 -1364 [3,] -7168.5 -685 -1380 -2545 6758 3137.5 -6555.5 -390 9593 1343 -1364 [4,] -7116.0 3683 1436 -1588 21475 6270.0 -1580.0 1285 21095 2287 -1364 [5,] -7116.0 3683 1436 -1588 21475 6270.0 -1580.0 1285 21095 2287 -1364 [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [1,] -1871 1165 9502 8554 4028 4699 917 -6533 4563 20717 3171 -2582 [2,] -1871 1165 9502 8554 4028 4699 917 -6533 4563 20717 3171 -2582 [3,] -1871 1165 9502 8554 4028 4699 917 -6533 4563 20717 3171 -2582 [4,] -1871 1165 9502 8554 4028 4699 917 -6533 4563 20717 3171 -2582 [5,] -1871 1165 9502 8554 4028 4699 917 -6533 4563 20717 3171 -2582 [,45] [,46] [,47] [,48] [,49] [,50] [,51] [,52] [1,] -4723 -2131 11139 2847 -1909 -6309 -6830 -7846 [2,] -4723 -2131 11139 2847 -1909 -6309 -6830 -7846 [3,] -4723 -2131 11139 2847 -1909 -6309 -6830 -7846 [4,] -4723 -2131 11139 2847 -1909 -6309 -6830 -7846 [5,] -4723 -2131 11139 2847 -1909 -6309 -6830 -7846 $n [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 134.0569 -21080.93 -2287.915 -6394.922 -12912.5641 -23099.27 -664.1295 [2,] 437.9431 42303.93 -1365.085 1246.922 726.5641 34364.27 5085.1295 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 1138.237 -20181.083 -11241.499 -6963.342 -10448.917 -5204.265 -28681.79 [2,] 2715.763 2941.083 -1968.501 -2820.658 8371.917 -3950.735 42648.79 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] -3794.826 -9469.262 -14051.365 -19670.94 2030.864 -18346.21 -6603.719 [2,] 3263.826 -1601.738 -1864.635 39539.94 3501.136 25154.21 2749.719 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] -7285.809 -10445.11 -7672.232 -4683.3758 -26126.51 -3861.938 -17673.043 [2,] -7051.191 9075.11 4912.232 -406.6242 39642.51 10136.938 4562.043 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] -4132.716 -16107.73 -766.3278 -1364 -1871 1165 9502 8554 4028 4699 [2,] 3352.716 35293.73 3452.3278 -1364 -1871 1165 9502 8554 4028 4699 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 917 -6533 4563 20717 3171 -2582 -4723 -2131 11139 2847 -1909 -6309 [2,] 917 -6533 4563 20717 3171 -2582 -4723 -2131 11139 2847 -1909 -6309 [,51] [,52] [1,] -6830 -7846 [2,] -6830 -7846 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" "49" "50" "51" "52" Warning message: In bxp(list(stats = c(218, 218, 286, 354, 354, -3572, -3572, 10611.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6forb1384693917.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] [1,] 225554.0 262433.0 [2,] 248133.5 277611.5 [3,] 267888.5 283574.5 [4,] 282895.5 294650.0 [5,] 300431.0 302686.0 $n [1] 52 32 $conf [,1] [,2] [1,] 260271.9 278815.5 [2,] 275505.1 288333.5 $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qcij1384693917.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,] 245098 245098 245098 [2,] 264403 264403 264403 [3,] 271732 271732 271732 [4,] 285914 285914 285914 [5,] 300431 300431 300431 $n [1] 52 52 52 $conf [,1] [,2] [,3] [1,] 267018.8 267018.8 267018.8 [2,] 276445.2 276445.2 276445.2 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1eth41384693917.ps tmp/1eth41384693917.png",intern=TRUE)) character(0) > try(system("convert tmp/2p4721384693917.ps tmp/2p4721384693917.png",intern=TRUE)) character(0) > try(system("convert tmp/3z18e1384693917.ps tmp/3z18e1384693917.png",intern=TRUE)) character(0) > try(system("convert tmp/4t6bu1384693917.ps tmp/4t6bu1384693917.png",intern=TRUE)) character(0) > try(system("convert tmp/5oe7k1384693917.ps tmp/5oe7k1384693917.png",intern=TRUE)) character(0) > try(system("convert tmp/6forb1384693917.ps tmp/6forb1384693917.png",intern=TRUE)) character(0) > try(system("convert tmp/7qcij1384693917.ps tmp/7qcij1384693917.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.852 0.948 5.778