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(660,770,792,693,726,814,770,737,792,693,770,847,627,704,792,693,770,770,737,836,957,737,891,891,671,660,803,693,825,847,726,869,979,748,880,946,737,671,759,748,814,836,737,825,979,803,825,1034,814,704,704,825,847,858,704,803,1067,858,792,1155,869,671,583,825,803,957,737,825,1199,913,814,1111,858,704,649,847,715,968,770,869,1254,946,693,1166,924,792,627,869,627,880,869,858,1232,935,660,1155,891,825,605,814,550,825,902,891,1199,902,693,1188) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 660 627 671 737 814 869 858 924 891 NA [2,] 770 704 660 671 704 671 704 792 825 NA [3,] 792 792 803 759 704 583 649 627 605 NA [4,] 693 693 693 748 825 825 847 869 814 NA [5,] 726 770 825 814 847 803 715 627 550 NA [6,] 814 770 847 836 858 957 968 880 825 NA [7,] 770 737 726 737 704 737 770 869 902 NA [8,] 737 836 869 825 803 825 869 858 891 NA [9,] 792 957 979 979 1067 1199 1254 1232 1199 NA [10,] 693 737 748 803 858 913 946 935 902 NA [11,] 770 891 880 825 792 814 693 660 693 NA [12,] 847 891 946 1034 1155 1111 1166 1155 1188 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 110 77 -11 -66 -110 -198 -154 -132 -66 NA [2,] 22 88 143 88 0 -88 -55 -165 -220 NA [3,] -99 -99 -110 -11 121 242 198 242 209 NA [4,] 33 77 132 66 22 -22 -132 -242 -264 NA [5,] 88 0 22 22 11 154 253 253 275 NA [6,] -44 -33 -121 -99 -154 -220 -198 -11 77 NA [7,] -33 99 143 88 99 88 99 -11 -11 NA [8,] 55 121 110 154 264 374 385 374 308 NA [9,] -99 -220 -231 -176 -209 -286 -308 -297 -297 NA [10,] 77 154 132 22 -66 -99 -253 -275 -209 NA [11,] 77 0 66 209 363 297 473 495 495 NA [12,] -220 -220 -209 -220 -286 -253 -242 -264 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/147lo1408117622.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/2rvn91408117622.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/3wqk11408117622.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/4x3th1408117622.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] [,12] [1,] 627 660 583 693 627 770 704 803 792 693 660 847 [2,] 671 671 627 693 715 825 737 825 979 748 693 946 [3,] 814 704 704 814 770 847 737 836 1067 858 792 1111 [4,] 869 770 792 825 814 880 770 869 1199 913 825 1155 [5,] 924 825 803 869 847 957 770 891 1254 946 891 1188 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 709.72 651.86 617.1 744.48 717.86 818.0333 719.62 812.8267 951.1333 771.1 [2,] 918.28 756.14 790.9 883.52 822.14 875.9667 754.38 859.1733 1182.8667 944.9 [,11] [,12] [1,] 722.48 1000.927 [2,] 861.52 1221.073 $out [1] 550 968 869 902 737 $group [1] 5 6 7 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(627, 671, 814, 869, 924, 660, 671, 704, 770, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5a3kg1408117622.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,] -198 -220 -110 -264 0 -220 -33 55 -308 -275 0 -286.0 [2,] -132 -88 -99 -132 22 -154 -11 121 -297 -209 77 -258.5 [3,] -66 0 121 22 88 -99 88 264 -231 -66 297 -231.0 [4,] -11 88 209 66 253 -33 99 374 -209 77 473 -220.0 [5,] 110 143 242 132 275 77 143 385 -99 154 495 -209.0 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -129.726667 -92.69333 -41.21333 -82.28 -33.66 -162.72667 30.06667 [2,] -2.273333 92.69333 283.21333 126.28 209.66 -35.27333 145.93333 [,8] [,9] [,10] [,11] [,12] [1,] 130.7533 -277.3467 -216.62667 88.44 -252.5067 [2,] 397.2467 -184.6533 84.62667 505.56 -209.4933 $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(-198, -132, -66, -11, 110, -220, -88, 0, 88, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jmhe1408117622.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] [1,] 660.0 627.0 660.0 671.0 704.0 583 649.0 627.0 550.0 NA [2,] 709.5 720.5 709.5 742.5 748.0 770 709.5 726.0 753.5 NA [3,] 770.0 770.0 814.0 808.5 819.5 825 852.5 869.0 858.0 NA [4,] 792.0 863.5 874.5 830.5 858.0 935 957.0 929.5 902.0 NA [5,] 847.0 957.0 979.0 836.0 858.0 1111 1254.0 1232.0 902.0 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 732.3712 704.7767 738.7424 768.3626 769.3283 749.7424 739.6136 776.1823 [2,] 807.6288 835.2233 889.2576 848.6374 869.6717 900.2576 965.3864 961.8177 [,9] [,10] [1,] 790.2682 NA [2,] 925.7318 NA $out [1] 979 1034 1067 1155 1199 1199 1188 $group [1] 4 4 5 5 6 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(660, 709.5, 770, 792, 847, 627, 720.5, 770, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7zea51408117622.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,] 701.5556 704.0 709.50 [2,] 757.1667 753.5 756.25 [3,] 781.6111 814.0 767.25 [4,] 849.4444 852.5 849.75 [5,] 861.6667 858.0 852.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 739.5226 768.8454 724.604 [2,] 823.6996 859.1546 809.896 $out [1] 1073.111 1054.778 1067.000 1111.000 1089.000 1050.500 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(701.555555555556, 757.166666666667, 781.611111111111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/147lo1408117622.ps tmp/147lo1408117622.png",intern=TRUE)) character(0) > try(system("convert tmp/2rvn91408117622.ps tmp/2rvn91408117622.png",intern=TRUE)) character(0) > try(system("convert tmp/3wqk11408117622.ps tmp/3wqk11408117622.png",intern=TRUE)) character(0) > try(system("convert tmp/4x3th1408117622.ps tmp/4x3th1408117622.png",intern=TRUE)) character(0) > try(system("convert tmp/5a3kg1408117622.ps tmp/5a3kg1408117622.png",intern=TRUE)) character(0) > try(system("convert tmp/6jmhe1408117622.ps tmp/6jmhe1408117622.png",intern=TRUE)) character(0) > try(system("convert tmp/7zea51408117622.ps tmp/7zea51408117622.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.459 0.385 2.878