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(-2.5,4.4,13.7,12.3,13.4,2.2,1.7,-7.2,-4.8,-2.9,-2.4,-2.5,-5.3,-7.1,-8,-8.9,-7.7,-1.1,4,9.6,10.9,13,14.9,20.1,10.8,11,3.8,10.8,7.6,10.2,2.2,-0.1,-1.7,-4.8,-9.9,-13.5,-18.1,-18,-15.7,-15.2,-15.1,-17.9,-14.5,-9.4,-4.2,-2.2,4.5,12.4,15.8,11.5,14.1,18.8,26.1,27.9,25.4,23.4,11.5,9.9,8.1,12.6,8.2,5.4,1,-2.9,-3.7,-7,-7.2,-11.8,-2.1,1.2,2.5,4.8,-6.6,-16,-22.7,-17.7,-18.2,-18.9,-16,-12.2,-17.1,-18.6,-17.5,-24.9) > 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,] -2.5 -5.3 10.8 -18.1 15.8 8.2 -6.6 NA [2,] 4.4 -7.1 11.0 -18.0 11.5 5.4 -16.0 NA [3,] 13.7 -8.0 3.8 -15.7 14.1 1.0 -22.7 NA [4,] 12.3 -8.9 10.8 -15.2 18.8 -2.9 -17.7 NA [5,] 13.4 -7.7 7.6 -15.1 26.1 -3.7 -18.2 NA [6,] 2.2 -1.1 10.2 -17.9 27.9 -7.0 -18.9 NA [7,] 1.7 4.0 2.2 -14.5 25.4 -7.2 -16.0 NA [8,] -7.2 9.6 -0.1 -9.4 23.4 -11.8 -12.2 NA [9,] -4.8 10.9 -1.7 -4.2 11.5 -2.1 -17.1 NA [10,] -2.9 13.0 -4.8 -2.2 9.9 1.2 -18.6 NA [11,] -2.4 14.9 -9.9 4.5 8.1 2.5 -17.5 NA [12,] -2.5 20.1 -13.5 12.4 12.6 4.8 -24.9 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6.9 -1.8 0.2 0.1 -4.3 -2.8 -9.4 NA [2,] 9.3 -0.9 -7.2 2.3 2.6 -4.4 -6.7 NA [3,] -1.4 -0.9 7.0 0.5 4.7 -3.9 5.0 NA [4,] 1.1 1.2 -3.2 0.1 7.3 -0.8 -0.5 NA [5,] -11.2 6.6 2.6 -2.8 1.8 -3.3 -0.7 NA [6,] -0.5 5.1 -8.0 3.4 -2.5 -0.2 2.9 NA [7,] -8.9 5.6 -2.3 5.1 -2.0 -4.6 3.8 NA [8,] 2.4 1.3 -1.6 5.2 -11.9 9.7 -4.9 NA [9,] 1.9 2.1 -3.1 2.0 -1.6 3.3 -1.5 NA [10,] 0.5 1.9 -5.1 6.7 -1.8 1.3 1.1 NA [11,] -0.1 5.2 -3.6 7.9 4.5 2.3 -7.4 NA [12,] -2.8 -9.3 -4.6 3.4 -4.4 -11.4 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/1jslt1382097514.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/2veuh1382097514.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/3jee21382097514.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/4tzcw1382097514.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,] -18.10 -18.00 -22.70 -17.70 -18.2 -18.90 -16.00 -12.20 -17.1 -4.80 -17.50 [2,] -5.95 -11.55 -11.85 -12.05 -11.4 -12.45 -10.85 -10.60 -4.5 -3.85 -6.15 [3,] -2.50 4.40 1.00 -2.90 -3.7 -1.10 1.70 -7.20 -2.1 -2.20 2.50 [4,] 9.50 8.20 8.75 11.55 10.5 6.20 3.10 4.75 4.6 5.55 6.30 [5,] 15.80 11.50 14.10 18.80 26.1 27.90 4.00 23.40 11.5 13.00 14.90 [,12] [1,] -24.9 [2,] -8.0 [3,] 4.8 [4,] 12.5 [5,] 20.1 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -11.726491 -7.394381 -11.30199 -16.99354 -16.778327 -12.23748 -6.630715 [2,] 6.726491 16.194381 13.30199 11.19354 9.378327 10.03748 10.030715 [,8] [,9] [,10] [,11] [,12] [1,] -16.366772 -7.534373 -7.813528 -4.934939 -7.442269 [2,] 1.966772 3.334373 3.413528 9.934939 17.042269 $out [1] 25.4 -18.6 $group [1] 7 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-18.1, -5.95, -2.5, 9.5, 15.8, -18, -11.55, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gwjn1382097514.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,] -4.30 -7.20 -3.90 -3.20 -3.30 -8.00 -8.90 -11.90 -3.10 -1.80 -7.40 -11.4 [2,] -3.55 -5.55 -1.15 -0.65 -3.05 -1.50 -3.45 -3.25 -1.55 -0.65 -1.85 -9.3 [3,] -1.80 -0.90 0.50 0.10 -0.70 -0.20 -2.00 1.30 1.90 1.10 2.30 -4.5 [4,] 0.15 2.45 4.85 1.15 2.20 3.15 4.45 3.80 2.05 1.60 4.85 -2.8 [5,] 0.20 9.30 7.00 1.20 6.60 5.10 5.60 9.70 3.30 1.90 7.90 3.4 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -4.0095803 -5.677471 -3.083103 -0.974931 -3.835215 -2.976905 -6.717753 [2,] 0.4095803 3.877471 4.083103 1.174931 2.435215 2.576905 2.717753 [,8] [,9] [,10] [,11] [,12] [1,] -2.910146 -0.2498619 -0.2436637 -1.701132 -8.6927099 [2,] 5.510146 4.0498619 2.4436637 6.301132 -0.3072901 $out [1] 6.9 -9.4 7.3 -11.2 -5.1 6.7 $group [1] 1 1 4 5 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4.3, -3.55, -1.8, 0.15, 0.199999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6irgr1382097515.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,] -7.20 -8.90 -13.50 -18.1 8.10 -11.80 -22.70 NA [2,] -2.70 -7.40 -3.25 -16.8 11.50 -5.35 -18.75 NA [3,] -0.35 1.45 3.00 -14.8 14.95 -0.55 -17.60 NA [4,] 8.35 11.95 10.50 -3.2 24.40 3.65 -16.00 NA [5,] 13.70 20.10 11.00 12.4 27.90 8.20 -12.20 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -5.389979 -7.375665 -3.271467 -21.003051 9.066223 -4.65496 -18.85429 NA [2,] 4.689979 10.275665 9.271467 -8.596949 20.833777 3.55496 -16.34571 NA $out [1] -6.6 -24.9 $group [1] 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(-7.2, -2.7, -0.35, 8.35, 13.7, -8.9, -7.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7nmm11382097515.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.9714286 -7.2 -3.8750 [2,] -1.0857143 -2.7 -2.3000 [3,] -0.6285714 -1.6 -0.3500 [4,] 0.1785714 2.1 0.4625 [5,] 1.2857143 4.8 2.2500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] -1.20522063 -3.7893122 -1.6099948 [2,] -0.05192223 0.5893122 0.9099948 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(-1.97142857142857, -1.08571428571429, -0.628571428571429, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jslt1382097514.ps tmp/1jslt1382097514.png",intern=TRUE)) character(0) > try(system("convert tmp/2veuh1382097514.ps tmp/2veuh1382097514.png",intern=TRUE)) character(0) > try(system("convert tmp/3jee21382097514.ps tmp/3jee21382097514.png",intern=TRUE)) character(0) > try(system("convert tmp/4tzcw1382097514.ps tmp/4tzcw1382097514.png",intern=TRUE)) character(0) > try(system("convert tmp/5gwjn1382097514.ps tmp/5gwjn1382097514.png",intern=TRUE)) character(0) > try(system("convert tmp/6irgr1382097515.ps tmp/6irgr1382097515.png",intern=TRUE)) character(0) > try(system("convert tmp/7nmm11382097515.ps tmp/7nmm11382097515.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.244 1.149 6.377