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(64800,62400,66000,52800,68400,67200,72000,74400,82800,72000,68400,85200,72000,54000,63600,48000,67200,55200,73200,66000,69600,78000,76800,91200,66000,55200,61200,44400,63600,49200,69600,66000,58800,84000,75600,86400,64800,60000,54000,44400,58800,52800,72000,69600,60000,80400,74400,96000,76800,46800,46800,46800,55200,55200,74400,68400,61200,76800,70800,102000,80400,46800,49200,40800,56400,64800,81600,80400,64800,75600,67200,96000,73200,58800,52800,39600,58800,70800,82800,78000,57600,82800,64800,99600,82800,60000,55200,37200,58800,56400,85200,85200,64800,84000,62400,97200,82800,61200,46800,32400,63600,61200,80400,92400,68400,76800,57600,99600) > 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,] 64800 72000 66000 64800 76800 80400 73200 82800 82800 NA [2,] 62400 54000 55200 60000 46800 46800 58800 60000 61200 NA [3,] 66000 63600 61200 54000 46800 49200 52800 55200 46800 NA [4,] 52800 48000 44400 44400 46800 40800 39600 37200 32400 NA [5,] 68400 67200 63600 58800 55200 56400 58800 58800 63600 NA [6,] 67200 55200 49200 52800 55200 64800 70800 56400 61200 NA [7,] 72000 73200 69600 72000 74400 81600 82800 85200 80400 NA [8,] 74400 66000 66000 69600 68400 80400 78000 85200 92400 NA [9,] 82800 69600 58800 60000 61200 64800 57600 64800 68400 NA [10,] 72000 78000 84000 80400 76800 75600 82800 84000 76800 NA [11,] 68400 76800 75600 74400 70800 67200 64800 62400 57600 NA [12,] 85200 91200 86400 96000 102000 96000 99600 97200 99600 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -2400 -18000 -10800 -4800 -30000 -33600 -14400 -22800 -21600 NA [2,] 3600 9600 6000 -6000 0 2400 -6000 -4800 -14400 NA [3,] -13200 -15600 -16800 -9600 0 -8400 -13200 -18000 -14400 NA [4,] 15600 19200 19200 14400 8400 15600 19200 21600 31200 NA [5,] -1200 -12000 -14400 -6000 0 8400 12000 -2400 -2400 NA [6,] 4800 18000 20400 19200 19200 16800 12000 28800 19200 NA [7,] 2400 -7200 -3600 -2400 -6000 -1200 -4800 0 12000 NA [8,] 8400 3600 -7200 -9600 -7200 -15600 -20400 -20400 -24000 NA [9,] -10800 8400 25200 20400 15600 10800 25200 19200 8400 NA [10,] -3600 -1200 -8400 -6000 -6000 -8400 -18000 -21600 -19200 NA [11,] 16800 14400 10800 21600 31200 28800 34800 34800 42000 NA [12,] -13200 -25200 -21600 -19200 -21600 -22800 -16800 -14400 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/16l8a1438196035.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/27uoq1438196035.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/31sjj1438196035.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/4n2el1438196035.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,] 64800 46800 46800 32400 55200 49200 69600 66000 57600 72000 57600 85200 [2,] 66000 54000 49200 39600 58800 55200 72000 68400 60000 76800 64800 91200 [3,] 73200 58800 54000 44400 58800 56400 74400 74400 64800 78000 68400 96000 [4,] 80400 60000 61200 46800 63600 64800 81600 80400 68400 82800 74400 99600 [5,] 82800 62400 66000 52800 68400 70800 85200 92400 69600 84000 76800 102000 $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,] 65616 55640 47680 40608 56272 51344 69344 68080 60376 74840 63344 91576 [2,] 80784 61960 60320 48192 61328 61456 79456 80720 69224 81160 73456 100424 $out [1] 82800 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(64800, 66000, 73200, 80400, 82800, 46800, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58h7q1438196035.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,] -33600 -14400 -18000 14400 -14400 16800 -7200 -24000 8400 -21600 10800 [2,] -22800 -6000 -15600 15600 -6000 16800 -4800 -20400 8400 -18000 16800 [3,] -18000 0 -13200 19200 -2400 19200 -2400 -9600 15600 -8400 28800 [4,] -10800 3600 -9600 19200 0 19200 0 -7200 20400 -6000 34800 [5,] -2400 9600 -8400 21600 8400 20400 2400 8400 25200 -1200 42000 [,12] [1,] -25200 [2,] -22200 [3,] -20400 [4,] -15600 [5,] -13200 $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,] -24320 -5056 -16360 17304 -5560 17936 -4928 -16552 9280 -14720 19320 [2,] -11680 5056 -10040 21096 760 20464 128 -2648 21920 -2080 38280 [,12] [1,] -24086.85 [2,] -16713.15 $out [1] 0 8400 31200 12000 4800 12000 28800 12000 -10800 $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(-33600, -22800, -18000, -10800, -2400, -14400, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ocw01438196035.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,] 62400 48000 44400 44400 46800 40800 39600 37200 32400 NA [2,] 65400 59400 57000 56400 51000 52800 58200 57600 59400 NA [3,] 68400 68400 64800 62400 64800 66000 67800 63600 66000 NA [4,] 73200 75000 72600 73200 75600 80400 80400 84600 81600 NA [5,] 82800 91200 86400 96000 102000 96000 99600 97200 99600 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 64842.37 61284.74 57684.74 54737.41 53579.77 53411.45 57674.43 51285.12 [2,] 71957.63 75515.26 71915.26 70062.59 76020.23 78588.55 77925.57 75914.88 [,9] [,10] [1,] 55874.43 NA [2,] 76125.57 NA $out [1] 52800 85200 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(62400, 65400, 68400, 73200, 82800, 48000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/77fhp1438196035.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,] 42933.33 44400 43200 [2,] 57666.67 57600 58500 [3,] 67000.00 66600 66900 [4,] 76200.00 74400 75600 [5,] 94800.00 96000 95400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 58546.82 58937.41 59100.58 [2,] 75453.18 74262.59 74699.42 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/16l8a1438196035.ps tmp/16l8a1438196035.png",intern=TRUE)) character(0) > try(system("convert tmp/27uoq1438196035.ps tmp/27uoq1438196035.png",intern=TRUE)) character(0) > try(system("convert tmp/31sjj1438196035.ps tmp/31sjj1438196035.png",intern=TRUE)) character(0) > try(system("convert tmp/4n2el1438196035.ps tmp/4n2el1438196035.png",intern=TRUE)) character(0) > try(system("convert tmp/58h7q1438196035.ps tmp/58h7q1438196035.png",intern=TRUE)) character(0) > try(system("convert tmp/6ocw01438196035.ps tmp/6ocw01438196035.png",intern=TRUE)) character(0) > try(system("convert tmp/77fhp1438196035.ps tmp/77fhp1438196035.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.592 0.422 3.041