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(1.94,1.82,1.8,1.79,1.79,1.78,1.81,1.84,1.87,1.87,1.87,1.84,1.82,1.83,1.83,1.82,1.83,1.87,1.88,1.9,1.98,2.03,2.14,2.42,2.73,2.84,2.85,2.94,3.06,3.24,3.18,3.01,2.87,2.73,2.63,2.39,2.26,2.11,2.01,1.99,1.96,1.93) > 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] 42 > (np <- floor(n / par1)) [1] 3 > 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] 4 4 4 4 4 4 3 3 3 3 3 3 > arr [,1] [,2] [,3] [,4] [1,] 1.94 1.82 2.73 2.26 [2,] 1.82 1.83 2.84 2.11 [3,] 1.80 1.83 2.85 2.01 [4,] 1.79 1.82 2.94 1.99 [5,] 1.79 1.83 3.06 1.96 [6,] 1.78 1.87 3.24 1.93 [7,] 1.81 1.88 3.18 NA [8,] 1.84 1.90 3.01 NA [9,] 1.87 1.98 2.87 NA [10,] 1.87 2.03 2.73 NA [11,] 1.87 2.14 2.63 NA [12,] 1.84 2.42 2.39 NA > darr [,1] [,2] [,3] [,4] [1,] -0.12 0.01 0.11 -0.15 [2,] -0.02 0.00 0.01 -0.10 [3,] -0.01 -0.01 0.09 -0.02 [4,] 0.00 0.01 0.12 -0.03 [5,] -0.01 0.04 0.18 -0.03 [6,] 0.03 0.01 -0.06 NA [7,] 0.03 0.02 -0.17 NA [8,] 0.03 0.08 -0.14 NA [9,] 0.00 0.05 -0.14 NA [10,] 0.00 0.11 -0.10 NA [11,] -0.03 0.28 -0.24 NA [12,] -0.02 0.31 -0.13 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/fisher/rcomp/tmp/1jw841381955416.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/fisher/rcomp/tmp/2z3lx1381955416.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/fisher/rcomp/tmp/3miv81381955416.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/fisher/rcomp/tmp/48umf1381955416.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,] 1.820 1.820 1.800 1.790 1.790 1.780 1.810 1.840 1.870 1.87 1.870 1.840 [2,] 1.880 1.825 1.815 1.805 1.810 1.825 1.845 1.870 1.925 1.95 2.005 2.115 [3,] 2.100 1.970 1.920 1.905 1.895 1.900 1.880 1.900 1.980 2.03 2.140 2.390 [4,] 2.495 2.475 2.430 2.465 2.510 2.585 2.530 2.455 2.425 2.38 2.385 2.405 [5,] 2.730 2.840 2.850 2.940 3.060 3.240 3.180 3.010 2.870 2.73 2.630 2.420 $n [1] 4 4 4 4 4 4 3 3 3 3 3 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1.61415 1.4565 1.43415 1.3836 1.342 1.2996 1.255134 1.366355 1.523893 [2,] 2.58585 2.4835 2.40585 2.4264 2.448 2.5004 2.504866 2.433645 2.436107 [,10] [,11] [,12] [1,] 1.637748 1.793359 2.125458 [2,] 2.422252 2.486641 2.654542 $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(1.82, 1.88, 2.1, 2.495, 2.73, 1.82, 1.825, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5vy1f1381955416.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] [1,] -0.150 -0.100 -0.020 -0.030 -0.030 -0.060 -0.170 -0.140 -0.140 -0.100 [2,] -0.135 -0.060 -0.015 -0.015 -0.020 -0.025 -0.075 -0.055 -0.070 -0.050 [3,] -0.055 -0.010 -0.010 0.005 0.015 0.010 0.020 0.030 0.000 0.000 [4,] 0.060 0.005 0.040 0.065 0.110 0.020 0.025 0.055 0.025 0.055 [5,] 0.110 0.010 0.090 0.120 0.180 0.030 0.030 0.080 0.050 0.110 [,11] [,12] [1,] -0.240 -0.130 [2,] -0.135 -0.075 [3,] -0.030 -0.020 [4,] 0.125 0.145 [5,] 0.280 0.310 $n [1] 4 4 4 4 4 3 3 3 3 3 3 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.20905 -0.06135 -0.05345 -0.0582 -0.0877 -0.0310496 -0.07122134 [2,] 0.09905 0.04135 0.03345 0.0682 0.1177 0.0510496 0.11122134 [,8] [,9] [,10] [,11] [,12] [1,] -0.07034348 -0.08666028 -0.09578241 -0.2671755 -0.220687 [2,] 0.13034348 0.08666028 0.09578241 0.2071755 0.180687 $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(-0.15, -0.135, -0.0549999999999999, 0.0599999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/66jpu1381955416.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] [1,] 1.780 1.820 2.390 1.93 [2,] 1.795 1.830 2.730 1.96 [3,] 1.830 1.875 2.860 2.00 [4,] 1.870 2.005 3.035 2.11 [5,] 1.940 2.140 3.240 2.26 $n [1] 12 12 12 6 $conf [,1] [,2] [,3] [,4] [1,] 1.795792 1.795181 2.720887 1.903245 [2,] 1.864208 1.954819 2.999113 2.096755 $out [1] 2.42 $group [1] 2 $names [1] "1" "2" "3" NA Warning message: In bxp(list(stats = c(1.78, 1.795, 1.83, 1.87, 1.94, 1.82, 1.83, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/77m101381955416.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,] 2.122500 1.880 2.020000 [2,] 2.155000 1.900 2.040000 [3,] 2.207500 1.945 2.153125 [4,] 2.228333 2.065 2.181250 [5,] 2.290000 2.140 2.260000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.174052 1.869742 2.08870 [2,] 2.240948 2.020258 2.21755 $out [1] 2.39 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2.1225, 2.155, 2.2075, 2.22833333333333, 2.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jw841381955416.ps tmp/1jw841381955416.png",intern=TRUE)) character(0) > try(system("convert tmp/2z3lx1381955416.ps tmp/2z3lx1381955416.png",intern=TRUE)) character(0) > try(system("convert tmp/3miv81381955416.ps tmp/3miv81381955416.png",intern=TRUE)) character(0) > try(system("convert tmp/48umf1381955416.ps tmp/48umf1381955416.png",intern=TRUE)) character(0) > try(system("convert tmp/5vy1f1381955416.ps tmp/5vy1f1381955416.png",intern=TRUE)) character(0) > try(system("convert tmp/66jpu1381955416.ps tmp/66jpu1381955416.png",intern=TRUE)) character(0) > try(system("convert tmp/77m101381955416.ps tmp/77m101381955416.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.430 0.593 4.009