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(11798,8378,8131,7676,7505,8168,6455,6141,6554,6888,5339,1624,9187,5047,5289,4169,3862,4253,3768,3066,4108,3890,3420,1221,5984,4064,5151,4027,3530,4819,3855,3584,4322,4154,4656,1464,7780,5060,6084,4778,4989,4903,4142,4101,4595,5034,5407,1782,8395,5291,6116,4210,4621,5299,4293,4542,3831,4360,4088,1508,6743,4159,5105,4283,4019,4206,3948,3407,3701,4159,4208,2622) > 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,] 11798 9187 5984 7780 8395 6743 NA [2,] 8378 5047 4064 5060 5291 4159 NA [3,] 8131 5289 5151 6084 6116 5105 NA [4,] 7676 4169 4027 4778 4210 4283 NA [5,] 7505 3862 3530 4989 4621 4019 NA [6,] 8168 4253 4819 4903 5299 4206 NA [7,] 6455 3768 3855 4142 4293 3948 NA [8,] 6141 3066 3584 4101 4542 3407 NA [9,] 6554 4108 4322 4595 3831 3701 NA [10,] 6888 3890 4154 5034 4360 4159 NA [11,] 5339 3420 4656 5407 4088 4208 NA [12,] 1624 1221 1464 1782 1508 2622 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3420 -4140 -1920 -2720 -3104 -2584 NA [2,] -247 242 1087 1024 825 946 NA [3,] -455 -1120 -1124 -1306 -1906 -822 NA [4,] -171 -307 -497 211 411 -264 NA [5,] 663 391 1289 -86 678 187 NA [6,] -1713 -485 -964 -761 -1006 -258 NA [7,] -314 -702 -271 -41 249 -541 NA [8,] 413 1042 738 494 -711 294 NA [9,] 334 -218 -168 439 529 458 NA [10,] -1549 -470 502 373 -272 49 NA [11,] -3715 -2199 -3192 -3625 -2580 -1586 NA [12,] 7563 4763 6316 6613 5235 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/1do3p1413034928.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/2vlc61413034928.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/3t1ep1413034928.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/4ccrf1413034928.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,] 5984.0 4064.0 5105.0 4027.0 3530 4206 3768 3066.0 3701 3890.0 3420 1221 [2,] 6743.0 4159.0 5151.0 4169.0 3862 4253 3855 3407.0 3831 4154.0 4088 1464 [3,] 8087.5 5053.5 5686.5 4246.5 4320 4861 4045 3842.5 4215 4259.5 4432 1566 [4,] 9187.0 5291.0 6116.0 4778.0 4989 5299 4293 4542.0 4595 5034.0 5339 1782 [5,] 11798.0 5291.0 6116.0 4778.0 4989 5299 4293 6141.0 4595 5034.0 5407 1782 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6511.041 4323.323 5064.044 3853.675 3593.049 4186.296 3762.476 3110.388 [2,] 9663.959 5783.677 6308.956 4639.325 5046.951 5535.704 4327.524 4574.612 [,9] [,10] [,11] [,12] [1,] 3722.195 3691.872 3625.065 1360.88 [2,] 4707.805 4827.128 5238.935 1771.12 $out [1] 8378 8131 7676 7505 8168 6455 6554 6888 2622 $group [1] 2 3 4 5 6 7 9 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(5984, 6743, 8087.5, 9187, 11798, 4064, 4159, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50e621413034928.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,] -4140 -247.0 -1906 -497.0 -86 -1713.0 -702.0 294.0 -218.0 -1549.0 -3715 [2,] -3420 242.0 -1306 -307.0 187 -1006.0 -541.0 294.0 -168.0 -470.0 -3625 [3,] -2912 885.5 -1122 -217.5 527 -862.5 -292.5 453.5 386.5 -111.5 -2886 [4,] -2584 1024.0 -822 211.0 678 -485.0 -41.0 738.0 458.0 373.0 -2199 [5,] -1920 1087.0 -455 411.0 1289 -258.0 249.0 1042.0 529.0 502.0 -1586 [,12] [1,] 4763 [2,] 5235 [3,] 6316 [4,] 6613 [5,] 7563 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3451.247 381.0847 -1434.1956 -551.6267 210.2891 -1198.5618 -615.01615 [2,] -2372.753 1389.9153 -809.8044 116.6267 843.7109 -526.4382 30.01615 [,8] [,9] [,10] [,11] [,12] [1,] 167.1057 -17.29022 -655.2622 -3805.816 5342.309 [2,] 739.8943 790.29022 432.2622 -1966.184 7289.691 $out [1] -711 $group [1] 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4140, -3420, -2912, -2584, -1920, -247, 242, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tn6n1413034928.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,] 5339.0 3066 3530.0 4101.0 3831 3407.0 NA [2,] 6298.0 3594 3719.5 4368.5 4149 3824.5 NA [3,] 7196.5 3999 4109.0 4946.0 4451 4159.0 NA [4,] 8149.5 4650 4737.5 5233.5 5295 4245.5 NA [5,] 8378.0 5289 5984.0 6084.0 6116 4283.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 6352.018 3517.351 3644.683 4551.468 3928.302 3966.979 NA [2,] 8040.982 4480.649 4573.317 5340.532 4973.698 4351.021 NA $out [1] 11798 1624 9187 1221 1464 7780 1782 8395 1508 6743 5105 2622 $group [1] 1 1 2 2 3 4 4 5 5 6 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(5339, 6298, 7196.5, 8149.5, 8378, 3066, 3594, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7xhr31413034928.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,] 4140.167 3842.50 3941.500 [2,] 4464.333 4130.00 4140.125 [3,] 4750.917 4289.75 4463.562 [4,] 5303.917 4957.25 4802.188 [5,] 5979.333 5686.50 5646.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4367.977 3912.436 4161.591 [2,] 5133.856 4667.064 4765.534 $out [1] 8314.500 1703.500 8087.500 1566.000 7995.625 1608.750 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(4140.16666666667, 4464.33333333333, 4750.91666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1do3p1413034928.ps tmp/1do3p1413034928.png",intern=TRUE)) character(0) > try(system("convert tmp/2vlc61413034928.ps tmp/2vlc61413034928.png",intern=TRUE)) character(0) > try(system("convert tmp/3t1ep1413034928.ps tmp/3t1ep1413034928.png",intern=TRUE)) character(0) > try(system("convert tmp/4ccrf1413034928.ps tmp/4ccrf1413034928.png",intern=TRUE)) character(0) > try(system("convert tmp/50e621413034928.ps tmp/50e621413034928.png",intern=TRUE)) character(0) > try(system("convert tmp/6tn6n1413034928.ps tmp/6tn6n1413034928.png",intern=TRUE)) character(0) > try(system("convert tmp/7xhr31413034928.ps tmp/7xhr31413034928.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.429 0.415 2.857