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(48600,46800,49500,39600,51300,50400,54000,55800,62100,54000,51300,63900,54000,40500,47700,36000,50400,41400,54900,49500,52200,58500,57600,68400,49500,41400,45900,33300,47700,36900,52200,49500,44100,63000,56700,64800,48600,45000,40500,33300,44100,39600,54000,52200,45000,60300,55800,72000,57600,35100,35100,35100,41400,41400,55800,51300,45900,57600,53100,76500,60300,35100,36900,30600,42300,48600,61200,60300,48600,56700,50400,72000,54900,44100,39600,29700,44100,53100,62100,58500,43200,62100,48600,74700,62100,45000,41400,27900,44100,42300,63900,63900,48600,63000,46800,72900,62100,45900,35100,24300,47700,45900,60300,69300,51300,57600,43200,74700) > 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,] 48600 54000 49500 48600 57600 60300 54900 62100 62100 NA [2,] 46800 40500 41400 45000 35100 35100 44100 45000 45900 NA [3,] 49500 47700 45900 40500 35100 36900 39600 41400 35100 NA [4,] 39600 36000 33300 33300 35100 30600 29700 27900 24300 NA [5,] 51300 50400 47700 44100 41400 42300 44100 44100 47700 NA [6,] 50400 41400 36900 39600 41400 48600 53100 42300 45900 NA [7,] 54000 54900 52200 54000 55800 61200 62100 63900 60300 NA [8,] 55800 49500 49500 52200 51300 60300 58500 63900 69300 NA [9,] 62100 52200 44100 45000 45900 48600 43200 48600 51300 NA [10,] 54000 58500 63000 60300 57600 56700 62100 63000 57600 NA [11,] 51300 57600 56700 55800 53100 50400 48600 46800 43200 NA [12,] 63900 68400 64800 72000 76500 72000 74700 72900 74700 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -1800 -13500 -8100 -3600 -22500 -25200 -10800 -17100 -16200 NA [2,] 2700 7200 4500 -4500 0 1800 -4500 -3600 -10800 NA [3,] -9900 -11700 -12600 -7200 0 -6300 -9900 -13500 -10800 NA [4,] 11700 14400 14400 10800 6300 11700 14400 16200 23400 NA [5,] -900 -9000 -10800 -4500 0 6300 9000 -1800 -1800 NA [6,] 3600 13500 15300 14400 14400 12600 9000 21600 14400 NA [7,] 1800 -5400 -2700 -1800 -4500 -900 -3600 0 9000 NA [8,] 6300 2700 -5400 -7200 -5400 -11700 -15300 -15300 -18000 NA [9,] -8100 6300 18900 15300 11700 8100 18900 14400 6300 NA [10,] -2700 -900 -6300 -4500 -4500 -6300 -13500 -16200 -14400 NA [11,] 12600 10800 8100 16200 23400 21600 26100 26100 31500 NA [12,] -9900 -18900 -16200 -14400 -16200 -17100 -12600 -10800 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/1tugq1439326632.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/2xs6h1439326632.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/3m1gu1439326632.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/4rfuq1439326632.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,] 48600 35100 35100 24300 41400 36900 52200 49500 43200 54000 43200 63900 [2,] 49500 40500 36900 29700 44100 41400 54000 51300 45000 57600 48600 68400 [3,] 54900 44100 40500 33300 44100 42300 55800 55800 48600 58500 51300 72000 [4,] 60300 45000 45900 35100 47700 48600 61200 60300 51300 62100 55800 74700 [5,] 62100 46800 49500 39600 51300 53100 63900 69300 52200 63000 57600 76500 $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] [,11] [,12] [1,] 49212 41730 35760 30456 42204 38508 52008 51060 45282 56130 47508 68682 [2,] 60588 46470 45240 36144 45996 46092 59592 60540 51918 60870 55092 75318 $out [1] 62100 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(48600, 49500, 54900, 60300, 62100, 35100, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5k59g1439326632.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,] -25200 -10800 -13500 10800 -10800 12600 -5400 -18000 6300 -16200 8100 [2,] -17100 -4500 -11700 11700 -4500 12600 -3600 -15300 6300 -13500 12600 [3,] -13500 0 -9900 14400 -1800 14400 -1800 -7200 11700 -6300 21600 [4,] -8100 2700 -7200 14400 0 14400 0 -5400 15300 -4500 26100 [5,] -1800 7200 -6300 16200 6300 15300 1800 6300 18900 -900 31500 [,12] [1,] -18900 [2,] -16650 [3,] -15300 [4,] -11700 [5,] -9900 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -18240 -3792 -12270 12978 -4170 13452 -3696 -12414 6960 -11040 14490 [2,] -8760 3792 -7530 15822 570 15348 96 -1986 16440 -1560 28710 [,12] [1,] -18065.14 [2,] -12534.86 $out [1] 0 6300 23400 9000 3600 9000 21600 9000 -8100 $group [1] 3 4 4 5 6 6 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-25200, -17100, -13500, -8100, -1800, -10800, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/603961439326632.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,] 46800 36000 33300 33300 35100 30600 29700 27900 24300 NA [2,] 49050 44550 42750 42300 38250 39600 43650 43200 44550 NA [3,] 51300 51300 48600 46800 48600 49500 50850 47700 49500 NA [4,] 54900 56250 54450 54900 56700 60300 60300 63450 61200 NA [5,] 62100 68400 64800 72000 76500 72000 74700 72900 74700 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 48631.78 45963.55 43263.55 41053.06 40184.83 40058.59 43255.82 38463.84 [2,] 53968.22 56636.45 53936.45 52546.94 57015.17 58941.41 58444.18 56936.16 [,9] [,10] [1,] 41905.82 NA [2,] 57094.18 NA $out [1] 39600 63900 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(46800, 49050, 51300, 54900, 62100, 36000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/75jm01439326632.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,] 32200 33300 32400 [2,] 43250 43200 43875 [3,] 50250 49950 50175 [4,] 57150 55800 56700 [5,] 71100 72000 71550 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 43910.12 44203.06 44325.43 [2,] 56589.88 55696.94 56024.57 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1tugq1439326632.ps tmp/1tugq1439326632.png",intern=TRUE)) character(0) > try(system("convert tmp/2xs6h1439326632.ps tmp/2xs6h1439326632.png",intern=TRUE)) character(0) > try(system("convert tmp/3m1gu1439326632.ps tmp/3m1gu1439326632.png",intern=TRUE)) character(0) > try(system("convert tmp/4rfuq1439326632.ps tmp/4rfuq1439326632.png",intern=TRUE)) character(0) > try(system("convert tmp/5k59g1439326632.ps tmp/5k59g1439326632.png",intern=TRUE)) character(0) > try(system("convert tmp/603961439326632.ps tmp/603961439326632.png",intern=TRUE)) character(0) > try(system("convert tmp/75jm01439326632.ps tmp/75jm01439326632.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.425 0.516 2.965