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(101.1,101.35,101.45,101.49,101.68,101.92,102.04,102.55,104.02,105.41,105.48,105.54,105.16,105.16,105.16,105.16,105.16,105.17,105.17,105.54,106.9,107.27,107.31,107.39,107.41,107.46,113.14,117,119.28,119.39,119.5,119.67,119.67,119.73,119.77,119.77,119.78,119.78,119.78,121.28,122.44,122.72,122.75,122.8,122.81,122.83,122.83,122.83,122.84,122.85,123.61,124.74,125.1,125.29,125.45,125.51,125.55,125.57,125.81,127.41,127.75,127.76,127.8,128.23,130.01,130.07,130.17,130.21,130.22,130.23,130.23,130.23,130.23,130.24,130.13,130.14,130.79,131.38,131.61,131.72,131.89,131.89,131.96,131.99,132,132.06,132.11,132.88,135.48,136.56,136.96,137.4,138.32,138.82,138.96,138.94,139,139.19,139.22,139.37,140.74,141.17,141.51,142.94,144.81,145.41,146.11,146.23) > 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,] 101.10 105.16 107.41 119.78 122.84 127.75 130.23 132.00 139.00 NA [2,] 101.35 105.16 107.46 119.78 122.85 127.76 130.24 132.06 139.19 NA [3,] 101.45 105.16 113.14 119.78 123.61 127.80 130.13 132.11 139.22 NA [4,] 101.49 105.16 117.00 121.28 124.74 128.23 130.14 132.88 139.37 NA [5,] 101.68 105.16 119.28 122.44 125.10 130.01 130.79 135.48 140.74 NA [6,] 101.92 105.17 119.39 122.72 125.29 130.07 131.38 136.56 141.17 NA [7,] 102.04 105.17 119.50 122.75 125.45 130.17 131.61 136.96 141.51 NA [8,] 102.55 105.54 119.67 122.80 125.51 130.21 131.72 137.40 142.94 NA [9,] 104.02 106.90 119.67 122.81 125.55 130.22 131.89 138.32 144.81 NA [10,] 105.41 107.27 119.73 122.83 125.57 130.23 131.89 138.82 145.41 NA [11,] 105.48 107.31 119.77 122.83 125.81 130.23 131.96 138.96 146.11 NA [12,] 105.54 107.39 119.77 122.83 127.41 130.23 131.99 138.94 146.23 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.25 0.00 0.05 0.00 0.01 0.01 0.01 0.06 0.19 NA [2,] 0.10 0.00 5.68 0.00 0.76 0.04 -0.11 0.05 0.03 NA [3,] 0.04 0.00 3.86 1.50 1.13 0.43 0.01 0.77 0.15 NA [4,] 0.19 0.00 2.28 1.16 0.36 1.78 0.65 2.60 1.37 NA [5,] 0.24 0.01 0.11 0.28 0.19 0.06 0.59 1.08 0.43 NA [6,] 0.12 0.00 0.11 0.03 0.16 0.10 0.23 0.40 0.34 NA [7,] 0.51 0.37 0.17 0.05 0.06 0.04 0.11 0.44 1.43 NA [8,] 1.47 1.36 0.00 0.01 0.04 0.01 0.17 0.92 1.87 NA [9,] 1.39 0.37 0.06 0.02 0.02 0.01 0.00 0.50 0.60 NA [10,] 0.07 0.04 0.04 0.00 0.24 0.00 0.07 0.14 0.70 NA [11,] 0.06 0.08 0.00 0.00 1.60 0.00 0.03 -0.02 0.12 NA [12,] -0.38 0.02 0.01 0.01 0.34 0.00 0.01 0.06 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/1782k1413643749.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/2plox1413643749.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/3bz001413643749.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/46ifs1413643749.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] [1,] 101.10 101.35 101.45 101.49 105.16 101.92 102.04 102.55 104.02 105.41 [2,] 107.41 107.46 113.14 117.00 119.28 119.39 119.50 119.67 119.67 119.73 [3,] 122.84 122.85 123.61 124.74 125.10 125.29 125.45 125.51 125.55 125.57 [4,] 130.23 130.24 130.13 130.14 130.79 131.38 131.61 131.72 131.89 131.89 [5,] 139.00 139.19 139.22 139.37 140.74 141.17 141.51 142.94 144.81 145.41 [,11] [,12] [1,] 105.48 105.54 [2,] 119.77 119.77 [3,] 125.81 127.41 [4,] 131.96 131.99 [5,] 146.11 146.23 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 110.8215 110.8525 114.6619 117.8196 119.0381 118.9753 119.0721 119.1637 [2,] 134.8585 134.8475 132.5581 131.6604 131.1619 131.6047 131.8279 131.8563 [,9] [,10] [,11] [,12] [1,] 119.1141 119.1657 119.3899 120.9741 [2,] 131.9859 131.9743 132.2301 133.8459 $out [1] 101.68 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(101.1, 107.41, 122.84, 130.23, 139, 101.35, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/525gn1413643749.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,] 0.00 -0.11 0.00 0.00 0.01 0.00 0.04 0.00 0.00 0.00 -0.02 0.000 [2,] 0.01 0.00 0.04 0.36 0.11 0.10 0.06 0.01 0.02 0.04 0.00 0.005 [3,] 0.01 0.04 0.43 1.16 0.24 0.12 0.17 0.17 0.06 0.07 0.03 0.010 [4,] 0.06 0.10 1.13 1.78 0.43 0.23 0.44 1.36 0.50 0.14 0.08 0.040 [5,] 0.06 0.10 1.50 2.60 0.59 0.40 0.51 1.87 0.60 0.24 0.12 0.060 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.01633333 -0.01266667 -0.1440667 0.4121333 0.07146667 0.05153333 [2,] 0.03633333 0.09266667 1.0040667 1.9078667 0.40853333 0.18846667 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.03013333 -0.541 -0.1928 0.01733333 -0.01213333 -0.009551502 [2,] 0.37013333 0.881 0.3128 0.12266667 0.07213333 0.029551502 $out [1] 0.25 0.19 5.68 0.76 3.86 1.08 1.43 1.39 0.70 1.60 -0.38 0.34 $group [1] 1 1 2 2 3 5 7 9 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0.00999999999999091, 0.0100000000000193, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60zkn1413643749.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] [1,] 101.100 105.160 113.140 119.780 122.840 127.750 130.130 132.000 139.000 [2,] 101.470 105.160 115.070 120.530 124.175 128.015 130.235 132.495 139.295 [3,] 101.980 105.170 119.445 122.735 125.370 130.120 131.495 136.760 141.340 [4,] 104.715 107.085 119.700 122.820 125.560 130.225 131.890 138.570 145.110 [5,] 105.540 107.390 119.770 122.830 127.410 130.230 131.990 138.960 146.230 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.4999 104.292 117.3332 121.6905 124.7383 129.112 130.7401 133.9892 [2,] 103.4601 106.048 121.5568 123.7795 126.0017 131.128 132.2499 139.5308 [,9] [,10] [1,] 138.6877 NA [2,] 143.9923 NA $out [1] 107.41 107.46 $group [1] 3 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(101.1, 101.47, 101.98, 104.715, 105.54, 105.16, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7oql61413643749.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,] 120.5856 122.840 118.8200 [2,] 121.8161 124.175 122.6025 [3,] 123.8239 125.370 125.4700 [4,] 125.0750 125.560 125.7950 [5,] 125.5922 127.410 125.8800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 122.3375 124.7383 124.0139 [2,] 125.3103 126.0017 126.9261 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(120.585555555556, 121.816111111111, 123.823888888889, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1782k1413643749.ps tmp/1782k1413643749.png",intern=TRUE)) character(0) > try(system("convert tmp/2plox1413643749.ps tmp/2plox1413643749.png",intern=TRUE)) character(0) > try(system("convert tmp/3bz001413643749.ps tmp/3bz001413643749.png",intern=TRUE)) character(0) > try(system("convert tmp/46ifs1413643749.ps tmp/46ifs1413643749.png",intern=TRUE)) character(0) > try(system("convert tmp/525gn1413643749.ps tmp/525gn1413643749.png",intern=TRUE)) character(0) > try(system("convert tmp/60zkn1413643749.ps tmp/60zkn1413643749.png",intern=TRUE)) character(0) > try(system("convert tmp/7oql61413643749.ps tmp/7oql61413643749.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.598 0.375 3.012