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(6,6.7,-0.6,5.8,16.4,1.5,5.1,14.7,4.3,1.5,9.1,4.3,5.7,13,14.5,9.7,-4.7,7.3,5.2,-2.5,11.5,4.9,-2.4,-0.3,4.4,7.9,-9.7,-4.1,16.4,-4.9,3.5,3.8,-0.2,3.1,0.7,-2.8,5.9,-5.3,-2.9,6.6,-8.1,1.3,6.9,-7.2,-1.9,4,-5.7,3.9,-7.6,-0.9,7.3,-3.7,-2.5,9.3,1.3,9.5,11.3,-1.7,8,-4.8,1.6,1.9,-0.9,5.5,1.7,-5.4,1.9,0.2,-13.3,-8.2,0.2,5.7,-1.2,-2.8,5.5,-17.3,1.4,-2.2,-8.6,-5,4.1,0.7,-4.2,-2.3) > 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,] 6.0 5.7 4.4 5.9 -7.6 1.6 -1.2 NA [2,] 6.7 13.0 7.9 -5.3 -0.9 1.9 -2.8 NA [3,] -0.6 14.5 -9.7 -2.9 7.3 -0.9 5.5 NA [4,] 5.8 9.7 -4.1 6.6 -3.7 5.5 -17.3 NA [5,] 16.4 -4.7 16.4 -8.1 -2.5 1.7 1.4 NA [6,] 1.5 7.3 -4.9 1.3 9.3 -5.4 -2.2 NA [7,] 5.1 5.2 3.5 6.9 1.3 1.9 -8.6 NA [8,] 14.7 -2.5 3.8 -7.2 9.5 0.2 -5.0 NA [9,] 4.3 11.5 -0.2 -1.9 11.3 -13.3 4.1 NA [10,] 1.5 4.9 3.1 4.0 -1.7 -8.2 0.7 NA [11,] 9.1 -2.4 0.7 -5.7 8.0 0.2 -4.2 NA [12,] 4.3 -0.3 -2.8 3.9 -4.8 5.7 -2.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.7 7.3 3.5 -11.2 6.7 0.3 -1.6 NA [2,] -7.3 1.5 -17.6 2.4 8.2 -2.8 8.3 NA [3,] 6.4 -4.8 5.6 9.5 -11.0 6.4 -22.8 NA [4,] 10.6 -14.4 20.5 -14.7 1.2 -3.8 18.7 NA [5,] -14.9 12.0 -21.3 9.4 11.8 -7.1 -3.6 NA [6,] 3.6 -2.1 8.4 5.6 -8.0 7.3 -6.4 NA [7,] 9.6 -7.7 0.3 -14.1 8.2 -1.7 3.6 NA [8,] -10.4 14.0 -4.0 5.3 1.8 -13.5 9.1 NA [9,] -2.8 -6.6 3.3 5.9 -13.0 5.1 -3.4 NA [10,] 7.6 -7.3 -2.4 -9.7 9.7 8.4 -4.9 NA [11,] -4.8 2.1 -3.5 9.6 -12.8 5.5 1.9 NA [12,] 1.4 4.7 8.7 -11.5 6.4 -6.9 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/1tald1393506028.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/2a3r21393506028.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/3kvef1393506028.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/41iwo1393506028.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,] -7.6 -5.30 -9.7 -17.3 -8.10 -5.40 1.30 -7.20 -13.30 -1.70 -5.70 -4.80 [2,] 0.2 -1.85 -1.9 -3.9 -3.60 -3.55 1.60 -3.75 -1.05 -0.50 -3.30 -2.55 [3,] 4.4 1.90 -0.6 5.5 1.40 1.30 3.50 0.20 4.10 1.50 0.20 -0.30 [4,] 5.8 7.30 6.4 6.2 9.05 4.40 5.15 6.65 7.80 3.55 4.35 4.10 [5,] 6.0 13.00 14.5 9.7 16.40 9.30 6.90 14.70 11.50 4.90 9.10 5.70 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.05577 -3.564232 -5.556626 -0.5315571 -6.154376 -3.447612 1.379997 [2,] 7.74423 7.364232 4.356626 11.5315571 8.954376 6.047612 5.620003 [,8] [,9] [,10] [,11] [,12] [1,] -6.010712 -1.185077 -0.9185947 -4.368457 -4.271273 [2,] 6.410712 9.385077 3.9185947 4.768457 3.671273 $out [1] -8.6 -8.2 $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(-7.6, 0.2, 4.4, 5.8, 6, -5.3, -1.85, 1.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5frrh1393506028.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,] -1.60 -17.60 -22.8 -14.70 -21.3 -8.00 -14.1 -13.5 -13.0 -9.7 -12.80 [2,] -0.65 -5.05 -7.9 -9.10 -11.0 -4.25 -4.7 -7.2 -5.0 -6.1 -4.15 [3,] 0.70 1.50 5.6 1.20 -3.6 3.60 0.3 1.8 -2.8 -2.4 1.90 [4,] 5.10 5.30 6.4 14.65 10.6 6.45 5.9 7.2 4.2 8.0 3.80 [5,] 7.30 8.30 9.5 20.50 12.0 8.40 9.6 14.0 5.9 9.7 9.60 [,12] [1,] -11.50 [2,] -6.90 [3,] 3.05 [4,] 6.40 [5,] 8.70 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.733807 -4.680853 -2.939729 -12.98312 -16.499172 -2.789867 -6.030149 [2,] 4.133807 7.680853 14.139729 15.38312 9.299172 9.989867 6.630149 [,8] [,9] [,10] [,11] [,12] [1,] -6.799448 -8.294092 -10.820293 -2.847612 -5.52893 [2,] 10.399448 2.694092 6.020293 6.647612 11.62893 $out [1] -11.2 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.6, -0.65, 0.7, 5.1, 7.3, -17.6, -5.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63z7q1393506028.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,] -0.60 -4.70 -9.70 -8.10 -7.60 -8.20 -8.60 NA [2,] 2.90 -1.35 -3.45 -5.50 -3.10 -3.15 -4.60 NA [3,] 5.45 5.45 1.90 -0.30 0.20 0.90 -2.25 NA [4,] 7.90 10.60 4.10 4.95 8.65 1.90 1.05 NA [5,] 14.70 14.50 7.90 6.90 11.30 5.70 5.50 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.169466 -0.0004752163 -1.543606 -5.066315 -5.159254 -1.403339 -4.8270029 [2,] 7.730534 10.9004752163 5.343606 4.466315 5.559254 3.203339 0.3270029 [,8] [1,] NA [2,] NA $out [1] 16.4 16.4 -13.3 -17.3 $group [1] 1 3 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(-0.6, 2.9, 5.45, 7.9, 14.7, -4.7, -1.35, 5.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/77ck81393506028.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,] 0.3571429 -0.60 0.4250 [2,] 0.7142857 0.20 0.9625 [3,] 1.9071429 1.45 1.8875 [4,] 2.2214286 3.80 2.8625 [5,] 2.9428571 5.50 3.3750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.219725 -0.1919842 1.020897 [2,] 2.594561 3.0919842 2.754103 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(0.357142857142857, 0.714285714285714, 1.90714285714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tald1393506028.ps tmp/1tald1393506028.png",intern=TRUE)) character(0) > try(system("convert tmp/2a3r21393506028.ps tmp/2a3r21393506028.png",intern=TRUE)) character(0) > try(system("convert tmp/3kvef1393506028.ps tmp/3kvef1393506028.png",intern=TRUE)) character(0) > try(system("convert tmp/41iwo1393506028.ps tmp/41iwo1393506028.png",intern=TRUE)) character(0) > try(system("convert tmp/5frrh1393506028.ps tmp/5frrh1393506028.png",intern=TRUE)) character(0) > try(system("convert tmp/63z7q1393506028.ps tmp/63z7q1393506028.png",intern=TRUE)) character(0) > try(system("convert tmp/77ck81393506028.ps tmp/77ck81393506028.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.898 0.762 4.711