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(13396,13637,15467,13722,14727,14961,14026,13895,14474,15759,15995,14119,15342,15796,15435,16195,15572,16223,15921,14143,16290,16579,14314,13318,11938,12574,13298,12124,11757,12803,12800,11293,12992,13426,13174,13648,12801,13183,15703,14859,14350,16444,14207,13329,14795,15248,16081,15670,14805,15779,17945,15280,16773,16362,15774,15505,16397,16060,16748,16137,15523,16267,18066,16105,16883,17034,16452,16234,16658,18133,17488,15853,17198,16719,17635,16726,17503,17074,17054,15451,16374,17242,16684,16489) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 13396 15342 11938 12801 14805 15523 17198 NA [2,] 13637 15796 12574 13183 15779 16267 16719 NA [3,] 15467 15435 13298 15703 17945 18066 17635 NA [4,] 13722 16195 12124 14859 15280 16105 16726 NA [5,] 14727 15572 11757 14350 16773 16883 17503 NA [6,] 14961 16223 12803 16444 16362 17034 17074 NA [7,] 14026 15921 12800 14207 15774 16452 17054 NA [8,] 13895 14143 11293 13329 15505 16234 15451 NA [9,] 14474 16290 12992 14795 16397 16658 16374 NA [10,] 15759 16579 13426 15248 16060 18133 17242 NA [11,] 15995 14314 13174 16081 16748 17488 16684 NA [12,] 14119 13318 13648 15670 16137 15853 16489 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 241 454 636 382 974 744 -479 NA [2,] 1830 -361 724 2520 2166 1799 916 NA [3,] -1745 760 -1174 -844 -2665 -1961 -909 NA [4,] 1005 -623 -367 -509 1493 778 777 NA [5,] 234 651 1046 2094 -411 151 -429 NA [6,] -935 -302 -3 -2237 -588 -582 -20 NA [7,] -131 -1778 -1507 -878 -269 -218 -1603 NA [8,] 579 2147 1699 1466 892 424 923 NA [9,] 1285 289 434 453 -337 1475 868 NA [10,] 236 -2265 -252 833 688 -645 -558 NA [11,] -1876 -996 474 -411 -611 -1635 -195 NA [12,] 1223 -1380 -847 -865 -614 1345 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/1b2ip1413740748.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/236qk1413740748.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/3n42y1413740748.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/4t59p1413740748.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,] 11938.0 12574.0 13298 12124.0 11757.0 14961 12800.0 11293 12992.0 13426.0 [2,] 13098.5 13410.0 15451 14290.5 14538.5 15592 14116.5 13612 14634.5 15503.5 [3,] 14805.0 15779.0 15703 15280.0 15572.0 16362 15774.0 14143 16290.0 16060.0 [4,] 15432.5 16031.5 17790 16150.0 16828.0 16739 16186.5 15478 16385.5 16910.5 [5,] 17198.0 16719.0 18066 16726.0 17503.0 17074 17054.0 16234 16658.0 18133.0 [,11] [,12] [1,] 13174.0 13318.0 [2,] 15154.5 13883.5 [3,] 16081.0 15670.0 [4,] 16716.0 15995.0 [5,] 17488.0 16489.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 13411.17 14213.48 14306.19 14169.54 14204.75 15677.03 14537.83 13028.65 [2,] 16198.83 17344.52 17099.81 16390.46 16939.25 17046.97 17010.17 15257.35 [,9] [,10] [,11] [,12] [1,] 15244.33 15219.76 15148.5 14409.05 [2,] 17335.67 16900.24 17013.5 16930.95 $out [1] 12803 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(11938, 13098.5, 14805, 15432.5, 17198, 12574, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5p8x21413740748.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,] 241.0 -361 -2665.0 -623.0 -429.0 -935.0 -1778.0 424.0 -337.0 -645.0 [2,] 311.5 820 -1853.0 -438.0 -130.0 -761.5 -1555.0 735.5 361.5 -601.5 [3,] 454.0 1799 -1174.0 777.0 234.0 -582.0 -878.0 923.0 453.0 -252.0 [4,] 690.0 1998 -876.5 891.5 848.5 -161.0 -243.5 1582.5 1076.5 462.0 [5,] 974.0 2520 -844.0 1493.0 2094.0 -3.0 -131.0 2147.0 1475.0 833.0 [,11] [,12] [1,] -1876.0 -1380.0 [2,] -1315.5 -865.0 [3,] -611.0 -730.5 [4,] -303.0 1223.0 [5,] 474.0 1345.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 227.9659 1095.517 -1757.15 -16.95595 -350.3444 -940.6089 -1661.20664 [2,] 680.0341 2502.483 -590.85 1570.95595 818.3444 -223.3911 -94.79336 [,8] [,9] [,10] [,11] [,12] [1,] 417.1853 26.01353 -887.105 -1215.648666 -2077.3274 [2,] 1428.8147 879.98647 383.105 -6.351334 616.3274 $out [1] -479 760 -2237 -2265 $group [1] 1 3 6 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(241, 311.5, 454, 690, 974, -361, 820, 1799, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6r6cq1413740748.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] [1,] 13396.0 13318 11293.0 12801.0 14805.0 15523.0 16374.0 NA [2,] 13808.5 14828 12031.0 13768.0 15639.5 16169.5 16586.5 NA [3,] 14296.5 15684 12801.5 14827.0 16098.5 16555.0 16890.0 NA [4,] 15214.0 16209 13236.0 15686.5 16572.5 17261.0 17220.0 NA [5,] 15995.0 16579 13648.0 16444.0 17945.0 18133.0 17635.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 13655.44 15054.12 12251.89 13951.96 15672.95 16057.16 16601.06 NA [2,] 14937.56 16313.88 13351.11 15702.04 16524.05 17052.84 17178.94 NA $out [1] 15451 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(13396, 13808.5, 14296.5, 15214, 15995, 13318, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72ikg1413740748.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,] 14264.29 14805.0 14265.50 [2,] 14926.14 15426.0 14830.00 [3,] 15271.36 15738.5 15365.12 [4,] 15813.21 16070.5 16050.38 [5,] 16221.29 16362.0 16620.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 14866.76 15444.54 14808.50 [2,] 15675.96 16032.46 15921.75 $out [1] 14143 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(14264.2857142857, 14926.1428571429, 15271.3571428571, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1b2ip1413740748.ps tmp/1b2ip1413740748.png",intern=TRUE)) character(0) > try(system("convert tmp/236qk1413740748.ps tmp/236qk1413740748.png",intern=TRUE)) character(0) > try(system("convert tmp/3n42y1413740748.ps tmp/3n42y1413740748.png",intern=TRUE)) character(0) > try(system("convert tmp/4t59p1413740748.ps tmp/4t59p1413740748.png",intern=TRUE)) character(0) > try(system("convert tmp/5p8x21413740748.ps tmp/5p8x21413740748.png",intern=TRUE)) character(0) > try(system("convert tmp/6r6cq1413740748.ps tmp/6r6cq1413740748.png",intern=TRUE)) character(0) > try(system("convert tmp/72ikg1413740748.ps tmp/72ikg1413740748.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.545 0.362 2.943