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(152512,151944,151368,150176,161968,161344,152512,146640,147208,147208,147840,148976,150744,150744,149608,146640,161968,164304,160776,152512,156048,150744,153136,154280,155472,152512,153136,148976,161968,166072,162544,156048,163112,155472,162544,161968,163736,157240,164304,163736,174336,171944,162544,157808,164304,155472,161968,163112,165504,160208,163112,164880,171376,166072,159008,151368,158440,139000,148408,153704,159008,151368,151368,151368,155472,149608,141912,135472,140144,121904,133080,139576,140768,134272,134840,133080,139000,134840,126640,120712,130736,108968,123104,129544,129544,121904,114840,114272,120712,114840,103672,95976,104240,84808,102472,111872,114840,108344,100136,106008,108344,106576,88904,80704,86568,68904,87144,93640,98936,90104,81840,86568,88904,84232,66568,58872,65936,46504,67704,80704) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 152512 150744 155472 163736 165504 159008 140768 129544 114840 98936 [2,] 151944 150744 152512 157240 160208 151368 134272 121904 108344 90104 [3,] 151368 149608 153136 164304 163112 151368 134840 114840 100136 81840 [4,] 150176 146640 148976 163736 164880 151368 133080 114272 106008 86568 [5,] 161968 161968 161968 174336 171376 155472 139000 120712 108344 88904 [6,] 161344 164304 166072 171944 166072 149608 134840 114840 106576 84232 [7,] 152512 160776 162544 162544 159008 141912 126640 103672 88904 66568 [8,] 146640 152512 156048 157808 151368 135472 120712 95976 80704 58872 [9,] 147208 156048 163112 164304 158440 140144 130736 104240 86568 65936 [10,] 147208 150744 155472 155472 139000 121904 108968 84808 68904 46504 [11,] 147840 153136 162544 161968 148408 133080 123104 102472 87144 67704 [12,] 148976 154280 161968 163112 153704 139576 129544 111872 93640 80704 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -568 0 -2960 -6496 -5296 -7640 -6496 -7640 -6496 -8832 NA [2,] -576 -1136 624 7064 2904 0 568 -7064 -8208 -8264 NA [3,] -1192 -2968 -4160 -568 1768 0 -1760 -568 5872 4728 NA [4,] 11792 15328 12992 10600 6496 4104 5920 6440 2336 2336 NA [5,] -624 2336 4104 -2392 -5304 -5864 -4160 -5872 -1768 -4672 NA [6,] -8832 -3528 -3528 -9400 -7064 -7696 -8200 -11168 -17672 -17664 NA [7,] -5872 -8264 -6496 -4736 -7640 -6440 -5928 -7696 -8200 -7696 NA [8,] 568 3536 7064 6496 7072 4672 10024 8264 5864 7064 NA [9,] 0 -5304 -7640 -8832 -19440 -18240 -21768 -19432 -17664 -19432 NA [10,] 632 2392 7072 6496 9408 11176 14136 17664 18240 21200 NA [11,] 1136 1144 -576 1144 5296 6496 6440 9400 6496 13000 NA [12,] 1768 1192 1768 2392 5304 1192 0 2968 5296 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/1mcdi1438251385.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/25ti71438251385.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/334jc1438251385.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/4yqru1438251385.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,] 98936 90104 81840 86568 88904 84232 66568 58872 65936 46504 [2,] 129544 121904 114840 114272 120712 114840 103672 95976 104240 84808 [3,] 151628 151056 150488 147808 158720 155476 147212 141056 143676 130452 [4,] 159008 152512 153136 151368 161968 166072 160776 152512 158440 150744 [5,] 165504 160208 164304 164880 174336 171944 162544 157808 164304 155472 [,11] [,12] [1,] 67704 80704 [2,] 102472 111872 [3,] 140460 144276 [4,] 153136 154280 [5,] 162544 163112 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 136906.6 135763 131353.8 129273.4 138106.9 129878.5 118680.6 112808.4 [2,] 166349.4 166349 169622.2 166342.6 179333.1 181073.5 175743.4 169303.6 [,9] [,10] [,11] [,12] [1,] 116595.5 97507.75 115146.2 123087.3 [2,] 170756.5 163396.25 165773.8 165464.7 $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(98936, 129544, 151628, 159008, 165504, 90104, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53tz01438251385.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] [,12] [1,] -8832 -8264 -4160 2336 -5872 -11168 -8264 3536 -21768 632 -576 0 [2,] -7640 -7064 -1760 4104 -5304 -11168 -7696 4672 -19432 6496 1144 1192 [3,] -6496 -288 -568 6468 -3276 -8516 -7068 6780 -17952 10292 5868 1768 [4,] -2960 624 1768 11792 -624 -7064 -5928 7072 -7640 17664 6496 2968 [5,] 0 7064 5872 15328 4104 -3528 -4736 10024 0 21200 13000 5304 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -8834.315 -4129.231 -2330.729 2626.769 -5614.3146 -10566.522 -7951.363 [2,] -4157.685 3553.231 1194.729 10309.231 -937.6854 -6465.478 -6184.637 [,8] [,9] [,10] [,11] [,12] [1,] 5580.864 -23843.75 4712.022 3193.927 832.64 [2,] 7979.136 -12060.25 15871.978 8542.073 2703.36 $out [1] -17672 -17664 568 $group [1] 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-8832, -7640, -6496, -2960, 0, -8264, -7064, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60cvx1438251385.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] [,8] [,9] [,10] [,11] [1,] 146640 146640 148976 155472 139000 121904 120712 84808 68904 46504 NA [2,] 147524 150744 154304 159888 152536 137524 124872 103072 86856 66252 NA [3,] 150772 152824 159008 163424 159608 145760 131908 113072 96888 81272 NA [4,] 152512 158412 162544 164304 165192 151368 134840 117776 107460 87736 NA [5,] 152512 164304 166072 164304 171376 159008 140768 129544 114840 98936 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 148496.9 149326.6 155249.7 161409.8 153835.5 139445.7 127361.5 106365.4 [2,] 153047.1 156321.4 162766.3 165438.2 165380.5 152074.3 136454.5 119778.6 [,9] [,10] [,11] [1,] 87490.38 71473 NA [2,] 106285.62 91071 NA $out [1] 161968 161344 174336 171944 108968 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(146640, 147524, 150772, 152512, 152512, 146640, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7o4ht1438251385.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,] 117898.4 130452 120354.0 [2,] 130206.8 142366 132072.5 [3,] 135096.4 147510 135117.5 [4,] 139923.6 151342 140709.0 [5,] 144404.8 158720 145237.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 130664.5 143416 131178.3 [2,] 139528.3 151604 139056.7 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(117898.4, 130206.8, 135096.4, 139923.6, 144404.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1mcdi1438251385.ps tmp/1mcdi1438251385.png",intern=TRUE)) character(0) > try(system("convert tmp/25ti71438251385.ps tmp/25ti71438251385.png",intern=TRUE)) character(0) > try(system("convert tmp/334jc1438251385.ps tmp/334jc1438251385.png",intern=TRUE)) character(0) > try(system("convert tmp/4yqru1438251385.ps tmp/4yqru1438251385.png",intern=TRUE)) character(0) > try(system("convert tmp/53tz01438251385.ps tmp/53tz01438251385.png",intern=TRUE)) character(0) > try(system("convert tmp/60cvx1438251385.ps tmp/60cvx1438251385.png",intern=TRUE)) character(0) > try(system("convert tmp/7o4ht1438251385.ps tmp/7o4ht1438251385.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.462 0.435 2.936