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.26,1.26,1.28,1.34,1.39,1.47,1.57,1.63,1.72,1.43,1.35,1.41,1.44,1.43,1.43,1.42,1.45,1.51,1.48,1.48,1.45,1.38,1.46,1.45,1.41,1.45,1.47,1.47,1.53,1.56,1.66,1.79,1.78,1.46,1.41,1.43,1.43,1.45,1.35,1.35,1.29,1.29,1.26,1.3,1.3,1.16,1.24,1.15,1.21,1.22,1.17,1.13,1.15,1.2,1.23,1.25,1.38,1.28,1.26,1.25,1.26,1.28,1.31,1.22,1.23,1.36,1.54,1.58,1.44,1.29,1.28,1.23,1.2,1.22,1.19,1.17,1.22,1.29,1.39,1.53,1.82,1.77,1.63,1.57) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.26 1.44 1.41 1.43 1.21 1.26 1.20 NA [2,] 1.26 1.43 1.45 1.45 1.22 1.28 1.22 NA [3,] 1.28 1.43 1.47 1.35 1.17 1.31 1.19 NA [4,] 1.34 1.42 1.47 1.35 1.13 1.22 1.17 NA [5,] 1.39 1.45 1.53 1.29 1.15 1.23 1.22 NA [6,] 1.47 1.51 1.56 1.29 1.20 1.36 1.29 NA [7,] 1.57 1.48 1.66 1.26 1.23 1.54 1.39 NA [8,] 1.63 1.48 1.79 1.30 1.25 1.58 1.53 NA [9,] 1.72 1.45 1.78 1.30 1.38 1.44 1.82 NA [10,] 1.43 1.38 1.46 1.16 1.28 1.29 1.77 NA [11,] 1.35 1.46 1.41 1.24 1.26 1.28 1.63 NA [12,] 1.41 1.45 1.43 1.15 1.25 1.23 1.57 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.00 -0.01 0.04 0.02 0.01 0.02 0.02 NA [2,] 0.02 0.00 0.02 -0.10 -0.05 0.03 -0.03 NA [3,] 0.06 -0.01 0.00 0.00 -0.04 -0.09 -0.02 NA [4,] 0.05 0.03 0.06 -0.06 0.02 0.01 0.05 NA [5,] 0.08 0.06 0.03 0.00 0.05 0.13 0.07 NA [6,] 0.10 -0.03 0.10 -0.03 0.03 0.18 0.10 NA [7,] 0.06 0.00 0.13 0.04 0.02 0.04 0.14 NA [8,] 0.09 -0.03 -0.01 0.00 0.13 -0.14 0.29 NA [9,] -0.29 -0.07 -0.32 -0.14 -0.10 -0.15 -0.05 NA [10,] -0.08 0.08 -0.05 0.08 -0.02 -0.01 -0.14 NA [11,] 0.06 -0.01 0.02 -0.09 -0.01 -0.05 -0.06 NA [12,] 0.03 -0.04 0.00 0.06 0.01 -0.03 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/15bag1389041015.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/28pwi1389041015.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/3i4r71389041015.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/4bpdb1389041015.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.200 1.22 1.170 1.130 1.150 1.20 1.230 1.250 1.30 1.160 1.240 1.15 [2,] 1.235 1.24 1.235 1.195 1.225 1.29 1.325 1.390 1.41 1.285 1.270 1.24 [3,] 1.260 1.28 1.310 1.340 1.290 1.36 1.480 1.530 1.45 1.380 1.350 1.41 [4,] 1.420 1.44 1.390 1.385 1.420 1.49 1.555 1.605 1.75 1.445 1.435 1.44 [5,] 1.440 1.45 1.470 1.470 1.530 1.56 1.660 1.790 1.82 1.460 1.630 1.57 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.149521 1.160563 1.217437 1.226535 1.173549 1.240563 1.342648 1.401605 [2,] 1.370479 1.399437 1.402563 1.453465 1.406451 1.479437 1.617352 1.658395 [,9] [,10] [,11] [,12] [1,] 1.246957 1.284451 1.251465 1.290563 [2,] 1.653043 1.475549 1.448535 1.529437 $out [1] 1.77 $group [1] 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.2, 1.235, 1.26, 1.42, 1.44, 1.22, 1.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yow31389041015.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,] -0.010 -0.10 -0.04 0.010 0.000 -0.03 0.000 -0.14 -0.320 -0.140 -0.090 [2,] 0.005 -0.04 -0.03 0.015 0.040 0.00 0.030 -0.02 -0.220 -0.065 -0.055 [3,] 0.020 0.00 -0.01 0.030 0.060 0.10 0.040 0.00 -0.140 -0.020 -0.010 [4,] 0.020 0.02 0.00 0.050 0.075 0.10 0.095 0.11 -0.085 0.035 0.005 [5,] 0.040 0.03 0.00 0.060 0.080 0.18 0.140 0.29 -0.050 0.080 0.060 [,12] [1,] -0.040 [2,] -0.030 [3,] 0.005 [4,] 0.030 [5,] 0.060 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.01104224 -0.03583103 -0.027915516 0.009098565 0.03909856 0.04028161 [2,] 0.02895776 0.03583103 0.007915516 0.050901435 0.08090144 0.15971839 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.001183049 -0.0776339 -0.22061982 -0.07971839 -0.04583103 -0.03370194 [2,] 0.078816951 0.0776339 -0.05938018 0.03971839 0.02583103 0.04370194 $out [1] 0.06 -0.09 -0.06 0.13 $group [1] 3 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.01, 0.005, 0.02, 0.02, 0.04, -0.0999999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66afn1389041015.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] [1,] 1.26 1.38 1.41 1.150 1.130 1.220 1.17 NA [2,] 1.31 1.43 1.44 1.250 1.185 1.245 1.21 NA [3,] 1.40 1.45 1.47 1.295 1.225 1.285 1.34 NA [4,] 1.52 1.47 1.61 1.350 1.255 1.400 1.60 NA [5,] 1.72 1.51 1.79 1.450 1.280 1.580 1.82 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.304218 1.431756 1.392462 1.249389 1.193073 1.214303 1.162118 NA [2,] 1.495782 1.468244 1.547538 1.340611 1.256927 1.355697 1.517882 NA $out [1] 1.38 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.26, 1.31, 1.4, 1.52, 1.72, 1.38, 1.43, 1.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7azxj1389041015.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,] 1.300000 1.260 1.29000 [2,] 1.319286 1.300 1.32500 [3,] 1.365714 1.355 1.34625 [4,] 1.421429 1.430 1.41500 [5,] 1.555714 1.530 1.49750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.319126 1.295706 1.3052 [2,] 1.412302 1.414294 1.3873 $out [1] 1.58 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.3, 1.31928571428571, 1.36571428571429, 1.42142857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15bag1389041015.ps tmp/15bag1389041015.png",intern=TRUE)) character(0) > try(system("convert tmp/28pwi1389041015.ps tmp/28pwi1389041015.png",intern=TRUE)) character(0) > try(system("convert tmp/3i4r71389041015.ps tmp/3i4r71389041015.png",intern=TRUE)) character(0) > try(system("convert tmp/4bpdb1389041015.ps tmp/4bpdb1389041015.png",intern=TRUE)) character(0) > try(system("convert tmp/5yow31389041015.ps tmp/5yow31389041015.png",intern=TRUE)) character(0) > try(system("convert tmp/66afn1389041015.ps tmp/66afn1389041015.png",intern=TRUE)) character(0) > try(system("convert tmp/7azxj1389041015.ps tmp/7azxj1389041015.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.101 1.020 6.119