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(27.88,28.06,28.08,28.12,28.11,28.18,28.2,28.37,28.64,28.75,28.97,29.08,29.16,29.24,29.36,29.35,29.43,29.49,29.61,29.66,29.75,29.74,29.97,30.02,30.09,30.16,30.33,30.41,30.44,30.45,30.46,30.51,30.54,30.82,30.88,30.89,31.13,31.41,31.47,31.56,31.62,31.65,31.79,31.98,32.14,32.32,32.5,32.55,32.66,32.68,32.72,32.8,32.93,32.96,32.98,33.09,33.46,33.65,33.82,33.83,33.92,33.87,34.03,34.11,34.29,34.44,34.64,34.77,35.01,35.19,35.32,35.35) > 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,] 27.88 29.16 30.09 31.13 32.66 33.92 NA [2,] 28.06 29.24 30.16 31.41 32.68 33.87 NA [3,] 28.08 29.36 30.33 31.47 32.72 34.03 NA [4,] 28.12 29.35 30.41 31.56 32.80 34.11 NA [5,] 28.11 29.43 30.44 31.62 32.93 34.29 NA [6,] 28.18 29.49 30.45 31.65 32.96 34.44 NA [7,] 28.20 29.61 30.46 31.79 32.98 34.64 NA [8,] 28.37 29.66 30.51 31.98 33.09 34.77 NA [9,] 28.64 29.75 30.54 32.14 33.46 35.01 NA [10,] 28.75 29.74 30.82 32.32 33.65 35.19 NA [11,] 28.97 29.97 30.88 32.50 33.82 35.32 NA [12,] 29.08 30.02 30.89 32.55 33.83 35.35 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.18 0.08 0.07 0.28 0.02 -0.05 NA [2,] 0.02 0.12 0.17 0.06 0.04 0.16 NA [3,] 0.04 -0.01 0.08 0.09 0.08 0.08 NA [4,] -0.01 0.08 0.03 0.06 0.13 0.18 NA [5,] 0.07 0.06 0.01 0.03 0.03 0.15 NA [6,] 0.02 0.12 0.01 0.14 0.02 0.20 NA [7,] 0.17 0.05 0.05 0.19 0.11 0.13 NA [8,] 0.27 0.09 0.03 0.16 0.37 0.24 NA [9,] 0.11 -0.01 0.28 0.18 0.19 0.18 NA [10,] 0.22 0.23 0.06 0.18 0.17 0.13 NA [11,] 0.11 0.05 0.01 0.05 0.01 0.03 NA [12,] 0.08 0.07 0.24 0.11 0.09 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/1xl451413825477.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/2zh7x1413825477.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/3e36x1413825477.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/4elt71413825477.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] [1,] 27.88 28.060 28.08 28.120 28.11 28.18 28.200 28.370 28.64 28.75 28.97 [2,] 29.16 29.240 29.36 29.350 29.43 29.49 29.610 29.660 29.75 29.74 29.97 [3,] 30.61 30.785 30.90 30.985 31.03 31.05 31.125 31.245 31.34 31.57 31.69 [4,] 32.66 32.680 32.72 32.800 32.93 32.96 32.980 33.090 33.46 33.65 33.82 [5,] 33.92 33.870 34.03 34.110 34.29 34.44 34.640 34.770 35.01 35.19 35.32 [,12] [1,] 29.08 [2,] 30.02 [3,] 31.72 [4,] 33.83 [5,] 35.35 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 28.35239 28.56609 28.73269 28.75964 28.77239 28.81174 28.95124 29.03254 [2,] 32.86761 33.00391 33.06731 33.21036 33.28761 33.28826 33.29876 33.45746 [,9] [,10] [,11] [,12] [1,] 28.94693 29.04792 29.20663 29.26243 [2,] 33.73307 34.09208 34.17337 34.17757 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(27.88, 29.16, 30.61, 32.66, 33.92, 28.06, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5fb4i1413825477.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.050 0.02 -0.01 -0.01 0.010 0.01 0.05 0.03 0.11 0.060 0.01 0.07 [2,] 0.020 0.04 0.04 0.03 0.030 0.02 0.05 0.09 0.11 0.130 0.01 0.08 [3,] 0.075 0.09 0.08 0.07 0.045 0.07 0.12 0.20 0.18 0.175 0.04 0.09 [4,] 0.180 0.16 0.08 0.13 0.070 0.14 0.17 0.27 0.19 0.220 0.05 0.11 [5,] 0.280 0.17 0.09 0.18 0.070 0.20 0.19 0.37 0.28 0.230 0.11 0.11 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.02820517 0.01259612 0.05419871 0.00549677 0.01919871 -0.007403876 [2,] 0.17820517 0.16740388 0.10580129 0.13450323 0.07080129 0.147403876 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.04259612 0.08389419 0.1283974 0.1169471 0.01419871 0.06880208 [2,] 0.19740388 0.31610581 0.2316026 0.2330529 0.06580129 0.11119792 $out [1] 0.15 -0.01 0.24 $group [1] 5 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0500000000000043, 0.0200000000000031, 0.0749999999999993, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dtvk1413825477.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,] 27.880 29.160 30.090 31.130 32.660 33.87 NA [2,] 28.095 29.355 30.370 31.515 32.760 34.07 NA [3,] 28.190 29.550 30.455 31.720 32.970 34.54 NA [4,] 28.695 29.745 30.680 32.230 33.555 35.10 NA [5,] 29.080 30.020 30.890 32.550 33.830 35.35 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 27.91634 29.37212 30.31361 31.39388 32.6074 34.07021 NA [2,] 28.46366 29.72788 30.59639 32.04612 33.3326 35.00979 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(27.88, 28.095, 28.19, 28.695, 29.08, 29.16, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7l5s61413825477.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,] 30.80667 30.6100 30.83500 [2,] 31.02833 30.9425 31.02875 [3,] 31.23750 31.0875 31.21687 [4,] 31.66750 31.4550 31.60125 [5,] 31.95333 31.7200 31.87375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 30.94597 30.85375 30.95575 [2,] 31.52903 31.32125 31.47800 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(30.8066666666667, 31.0283333333333, 31.2375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1xl451413825477.ps tmp/1xl451413825477.png",intern=TRUE)) character(0) > try(system("convert tmp/2zh7x1413825477.ps tmp/2zh7x1413825477.png",intern=TRUE)) character(0) > try(system("convert tmp/3e36x1413825477.ps tmp/3e36x1413825477.png",intern=TRUE)) character(0) > try(system("convert tmp/4elt71413825477.ps tmp/4elt71413825477.png",intern=TRUE)) character(0) > try(system("convert tmp/5fb4i1413825477.ps tmp/5fb4i1413825477.png",intern=TRUE)) character(0) > try(system("convert tmp/6dtvk1413825477.ps tmp/6dtvk1413825477.png",intern=TRUE)) character(0) > try(system("convert tmp/7l5s61413825477.ps tmp/7l5s61413825477.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.505 0.405 2.933