R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(293.6,103.5,127,117.5,111.5,137.6,103.2,86.9,124.4,113.6,101.6,148.5,108.3,117.2,128.7,116.5,131.7,139.9,107.4,96.1,126.5,116.4,109.8,148,111.4,117,141.7,120,132.1,146.7,122.5,99.6,122.7,139,117.8,125.5,134.5,121.3,126.7,117.7,123,132.1,113.1,89.2,121.7,105.3,85.3,105.3,72.2,92.1,97.2,78.6,78.1,93,81,65.9,88.6,85.7,76.3,96.8,76.8,85.6,119.2,91.4,95.7,112.3,95.2,82.8,111.3,108.2,97,124.4,99.3,117.6,131.5,114.2,116.8,116.5,105.4,89.2,115.8,111.4,106.4,128.4,107.7,111,129.8,130.5,142.9,159.9,84.1,75,100.7,106.8,97.4,113,76.9,87.3,103.7,92.1,92.9,112.2,88.7,74.6,101.5,119.7,120.7,153.5) > 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,] 293.6 108.3 111.4 134.5 72.2 76.8 99.3 107.7 76.9 NA [2,] 103.5 117.2 117.0 121.3 92.1 85.6 117.6 111.0 87.3 NA [3,] 127.0 128.7 141.7 126.7 97.2 119.2 131.5 129.8 103.7 NA [4,] 117.5 116.5 120.0 117.7 78.6 91.4 114.2 130.5 92.1 NA [5,] 111.5 131.7 132.1 123.0 78.1 95.7 116.8 142.9 92.9 NA [6,] 137.6 139.9 146.7 132.1 93.0 112.3 116.5 159.9 112.2 NA [7,] 103.2 107.4 122.5 113.1 81.0 95.2 105.4 84.1 88.7 NA [8,] 86.9 96.1 99.6 89.2 65.9 82.8 89.2 75.0 74.6 NA [9,] 124.4 126.5 122.7 121.7 88.6 111.3 115.8 100.7 101.5 NA [10,] 113.6 116.4 139.0 105.3 85.7 108.2 111.4 106.8 119.7 NA [11,] 101.6 109.8 117.8 85.3 76.3 97.0 106.4 97.4 120.7 NA [12,] 148.5 148.0 125.5 105.3 96.8 124.4 128.4 113.0 153.5 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -190.1 8.9 5.6 -13.2 19.9 8.8 18.3 3.3 10.4 NA [2,] 23.5 11.5 24.7 5.4 5.1 33.6 13.9 18.8 16.4 NA [3,] -9.5 -12.2 -21.7 -9.0 -18.6 -27.8 -17.3 0.7 -11.6 NA [4,] -6.0 15.2 12.1 5.3 -0.5 4.3 2.6 12.4 0.8 NA [5,] 26.1 8.2 14.6 9.1 14.9 16.6 -0.3 17.0 19.3 NA [6,] -34.4 -32.5 -24.2 -19.0 -12.0 -17.1 -11.1 -75.8 -23.5 NA [7,] -16.3 -11.3 -22.9 -23.9 -15.1 -12.4 -16.2 -9.1 -14.1 NA [8,] 37.5 30.4 23.1 32.5 22.7 28.5 26.6 25.7 26.9 NA [9,] -10.8 -10.1 16.3 -16.4 -2.9 -3.1 -4.4 6.1 18.2 NA [10,] -12.0 -6.6 -21.2 -20.0 -9.4 -11.2 -5.0 -9.4 1.0 NA [11,] 46.9 38.2 7.7 20.0 20.5 27.4 22.0 15.6 32.8 NA [12,] -40.2 -36.6 9.0 -33.1 -20.0 -25.1 -20.7 -36.1 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/1botw1393885614.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/2xh3p1393885614.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/33ij41393885614.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/4y4jl1393885614.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,] 72.2 85.6 103.7 78.6 78.1 93.0 81.0 65.9 88.6 105.3 85.3 96.8 [2,] 76.9 92.1 119.2 92.1 95.7 112.3 88.7 75.0 101.5 106.8 97.0 113.0 [3,] 107.7 111.0 127.0 116.5 116.8 132.1 103.2 86.9 115.8 111.4 101.6 125.5 [4,] 111.4 117.2 129.8 117.7 131.7 139.9 107.4 89.2 122.7 116.4 109.8 148.0 [5,] 134.5 121.3 141.7 130.5 142.9 159.9 122.5 99.6 126.5 119.7 120.7 153.5 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 89.53 97.78067 121.4173 103.0173 97.84 117.564 93.35133 79.42133 [2,] 125.87 124.21933 132.5827 129.9827 135.76 146.636 113.04867 94.37867 [,9] [,10] [,11] [,12] [1,] 104.6347 106.344 94.85867 107.0667 [2,] 126.9653 116.456 108.34133 143.9333 $out [1] 293.6 97.2 139.0 85.7 76.3 $group [1] 1 3 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(72.2, 76.9, 107.7, 111.4, 134.5, 85.6, 92.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ihh51393885614.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,] 3.3 5.1 -27.8 -6.0 -0.3 -34.4 -16.3 22.7 -16.4 -20.0 7.7 -40.20 [2,] 3.3 11.5 -18.6 0.8 9.1 -32.5 -16.3 25.7 -10.1 -12.0 20.0 -36.35 [3,] 8.8 16.4 -12.2 4.3 14.9 -23.5 -15.1 26.9 -3.1 -9.4 22.0 -29.10 [4,] 10.4 23.5 -9.5 12.1 17.0 -17.1 -12.4 30.4 6.1 -6.6 32.8 -20.35 [5,] 19.9 33.6 0.7 15.2 26.1 -11.1 -9.1 32.5 18.2 1.0 46.9 -20.00 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5.060667 10.08 -16.992667 -1.651333 10.73933 -31.61067 -17.154 24.42467 [2,] 12.539333 22.72 -7.407333 10.251333 19.06067 -15.38933 -13.046 29.37533 [,9] [,10] [,11] [,12] [1,] -11.632 -12.244 15.25867 -38.03783 [2,] 5.432 -6.556 28.74133 -20.16217 $out [1] -190.1 -13.2 -75.8 -22.9 -23.9 37.5 -21.2 9.0 $group [1] 1 1 6 7 7 8 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3.3, 3.3, 8.8, 10.4, 19.9, 5.10000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61m6w1393885614.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,] 86.90 96.10 99.60 85.30 65.90 76.80 89.2 75.00 74.60 NA [2,] 103.35 109.05 117.40 105.30 77.20 88.50 105.9 99.05 88.00 NA [3,] 115.55 116.85 122.60 119.50 83.35 96.35 115.0 109.35 97.20 NA [4,] 132.30 130.20 135.55 124.85 92.55 111.80 117.2 130.15 115.95 NA [5,] 148.50 148.00 146.70 134.50 97.20 124.40 131.5 159.90 153.50 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.3457 107.2033 114.3217 110.5831 76.34876 85.72271 109.846 95.16508 [2,] 128.7543 126.4967 130.8783 128.4169 90.35124 106.97729 120.154 123.53492 [,9] [,10] [1,] 84.45182 NA [2,] 109.94818 NA $out [1] 293.6 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(86.9, 103.35, 115.55, 132.3, 148.5, 96.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/76cnu1393885614.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,] 84.36667 86.90 82.100 [2,] 103.60556 105.45 100.725 [3,] 112.18333 113.60 108.250 [4,] 121.45556 121.15 119.100 [5,] 127.80000 132.10 130.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 104.0418 106.4391 99.86904 [2,] 120.3248 120.7609 116.63096 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(84.3666666666667, 103.605555555556, 112.183333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1botw1393885614.ps tmp/1botw1393885614.png",intern=TRUE)) character(0) > try(system("convert tmp/2xh3p1393885614.ps tmp/2xh3p1393885614.png",intern=TRUE)) character(0) > try(system("convert tmp/33ij41393885614.ps tmp/33ij41393885614.png",intern=TRUE)) character(0) > try(system("convert tmp/4y4jl1393885614.ps tmp/4y4jl1393885614.png",intern=TRUE)) character(0) > try(system("convert tmp/5ihh51393885614.ps tmp/5ihh51393885614.png",intern=TRUE)) character(0) > try(system("convert tmp/61m6w1393885614.ps tmp/61m6w1393885614.png",intern=TRUE)) character(0) > try(system("convert tmp/76cnu1393885614.ps tmp/76cnu1393885614.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.875 0.992 5.873