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(5119676,4737614,5425255,5195396,5779583,6298652,6175944,6217653,6086619,5060250,3950207,3096398,3287215,2970037,3436547,3339099,3661160,3675026,3917675,3942501,3848079,3993974,3977059,4406890,4827736,4507189,5249062,5009908,5195771,5079423,5531062,5109363,4773753,5347125,5379543,6114549,6346091,5900935,7265533,6115096,7062343,7027841,6644644,7359822,7192534,7065705,7788175,6934803,7492202,8478866,8748316,8382956,8414863,7501787,8031203,9198243,8500998,9260617,9494903,8791918,8568871,8570003,8066695,7800532,8136832,7713840,7986953,7479868,7917564,8055845,7490221,7648110) > 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,] 5119676 3287215 4827736 6346091 7492202 8568871 NA [2,] 4737614 2970037 4507189 5900935 8478866 8570003 NA [3,] 5425255 3436547 5249062 7265533 8748316 8066695 NA [4,] 5195396 3339099 5009908 6115096 8382956 7800532 NA [5,] 5779583 3661160 5195771 7062343 8414863 8136832 NA [6,] 6298652 3675026 5079423 7027841 7501787 7713840 NA [7,] 6175944 3917675 5531062 6644644 8031203 7986953 NA [8,] 6217653 3942501 5109363 7359822 9198243 7479868 NA [9,] 6086619 3848079 4773753 7192534 8500998 7917564 NA [10,] 5060250 3993974 5347125 7065705 9260617 8055845 NA [11,] 3950207 3977059 5379543 7788175 9494903 7490221 NA [12,] 3096398 4406890 6114549 6934803 8791918 7648110 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -382062 -317178 -320547 -445156 986664 1132 NA [2,] 687641 466510 741873 1364598 269450 -503308 NA [3,] -229859 -97448 -239154 -1150437 -365360 -266163 NA [4,] 584187 322061 185863 947247 31907 336300 NA [5,] 519069 13866 -116348 -34502 -913076 -422992 NA [6,] -122708 242649 451639 -383197 529416 273113 NA [7,] 41709 24826 -421699 715178 1167040 -507085 NA [8,] -131034 -94422 -335610 -167288 -697245 437696 NA [9,] -1026369 145895 573372 -126829 759619 138281 NA [10,] -1110043 -16915 32418 722470 234286 -565624 NA [11,] -853809 429831 735006 -853372 -702985 157889 NA [12,] 190817 420846 231542 557399 -223047 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/1brog1425590688.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/2tag01425590688.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/3hbts1425590688.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/4yk101425590688.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,] 3287215 2970037 3436547 3339099 3661160 3675026 3917675 3942501 3848079 [2,] 4827736 4507189 5249062 5009908 5195771 5079423 5531062 5109363 4773753 [3,] 5732884 5319274 6345394 5655246 6420963 6663246 6410294 6788738 6639576 [4,] 7492202 8478866 8066695 7800532 8136832 7501787 7986953 7479868 7917564 [5,] 8568871 8570003 8748316 8382956 8414863 7713840 8031203 9198243 8500998 [,10] [,11] [,12] [1,] 3993974 3950207 3096398 [2,] 5060250 3977059 4406890 [3,] 6206415 6434882 6524676 [4,] 8055845 7788175 7648110 [5,] 9260617 9494903 8791918 $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,] 4014217 2757415 4527930 3855203 4523884 5100743 4826165 5259685 4611717 [2,] 7451550 7881134 8162858 7455289 8318042 8225750 7994423 8317790 8667436 [,10] [,11] [,12] [1,] 4274159 3976589 4433984 [2,] 8138671 8893175 8615368 $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(3287215, 4827736, 5732883.5, 7492202, 8568871, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56cau1425590688.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] [1,] -445156.0 269450.0 -365360.0 31907.0 -913076 -383197 -507085.0 -697245 [2,] -382062.0 269450.0 -365360.0 185863.0 -422992 -122708 -421699.0 -335610 [3,] -318862.5 577075.5 -252658.5 329180.5 -75425 257881 33267.5 -149161 [4,] 1132.0 741873.0 -229859.0 584187.0 13866 451639 715178.0 -94422 [5,] 1132.0 1364598.0 -97448.0 947247.0 519069 529416 1167040.0 -94422 [,9] [,10] [,11] [,12] [1,] -1026369 -1110043.0 -853809 190817 [2,] -126829 -565624.0 -853372 190817 [3,] 142088 7751.5 -272548 231542 [4,] 573372 234286.0 429831 420846 [5,] 759619 722470.0 735006 557399 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -566035.01 272347.4 -340061 72248.65 -357212.5 -112591.4 -700054.9 [2,] -71689.99 881803.6 -165256 586112.35 206362.5 628353.4 766589.9 [,8] [,9] [,10] [,11] [,12] [1,] -304735.05 -309564.3 -508216.3 -1100255.4 69004.09 [2,] 6413.05 593740.3 523719.3 555159.4 394079.91 $out [1] 986664 -503308 -1150437 437696 -223047 $group [1] 1 2 3 8 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-445156, -382062, -318862.5, 1132, 1132, 269450, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6otcr1425590688.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,] 3096398 2970037 4507189 5900935 7492202 7479868 NA [2,] 4898932 3387823 4918822 6495368 8207080 7680975 NA [3,] 5310326 3761552 5152567 7045092 8489932 7952258 NA [4,] 6131282 3959780 5363334 7229034 8995080 8101764 NA [5,] 6298652 4406890 5531062 7788175 9494903 8570003 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4748243 3500679 4949822 6710462 8130519 7760334 NA [2,] 5872408 4022426 5355312 7379722 8849345 8144183 NA $out [1] 6114549 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(3096398, 4898932, 5310325.5, 6131281.5, 6298652, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/733h91425590688.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,] 5860774 5319274 6020683 [2,] 6069638 5969649 6175692 [3,] 6355960 6415628 6400956 [4,] 6383919 6582126 6524948 [5,] 6551242 6788738 6671829 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6212614 6136274 6241657 [2,] 6499305 6694983 6560254 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(5860774, 6069637.91666667, 6355959.66666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1brog1425590688.ps tmp/1brog1425590688.png",intern=TRUE)) character(0) > try(system("convert tmp/2tag01425590688.ps tmp/2tag01425590688.png",intern=TRUE)) character(0) > try(system("convert tmp/3hbts1425590688.ps tmp/3hbts1425590688.png",intern=TRUE)) character(0) > try(system("convert tmp/4yk101425590688.ps tmp/4yk101425590688.png",intern=TRUE)) character(0) > try(system("convert tmp/56cau1425590688.ps tmp/56cau1425590688.png",intern=TRUE)) character(0) > try(system("convert tmp/6otcr1425590688.ps tmp/6otcr1425590688.png",intern=TRUE)) character(0) > try(system("convert tmp/733h91425590688.ps tmp/733h91425590688.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.516 0.422 2.968