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(-5,-6,-6,-7,-12,-16,-18,-19,-20,-24,-17,-23,-25,-24,-17,-14,-16,-13,-10,-10,-12,-12,-20,-16,-12,-14,-7,-9,-9,-4,-3,1,-1,-2,1,-3,-2,0,-2,-4,-4,-7,-9,-13,-8,-13,-15,-15,-15,-10,-12,-11,-11,-17,-18,-19,-22,-24,-24,-20,-25,-22,-17,-9,-11,-13,-11,-9,-7,-3,-3,-6,-4,-8,-1,-2,-2,-1,1,2,2,-1,1,-1,-8,1,2,-2,-2,-2,-2,-6,-4,-5,-2,-1) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -5 -25 -12 -2 -15 -25 -4 -8 NA [2,] -6 -24 -14 0 -10 -22 -8 1 NA [3,] -6 -17 -7 -2 -12 -17 -1 2 NA [4,] -7 -14 -9 -4 -11 -9 -2 -2 NA [5,] -12 -16 -9 -4 -11 -11 -2 -2 NA [6,] -16 -13 -4 -7 -17 -13 -1 -2 NA [7,] -18 -10 -3 -9 -18 -11 1 -2 NA [8,] -19 -10 1 -13 -19 -9 2 -6 NA [9,] -20 -12 -1 -8 -22 -7 2 -4 NA [10,] -24 -12 -2 -13 -24 -3 -1 -5 NA [11,] -17 -20 1 -15 -24 -3 1 -2 NA [12,] -23 -16 -3 -15 -20 -6 -1 -1 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -1 1 -2 2 5 3 -4 9 NA [2,] 0 7 7 -2 -2 5 7 1 NA [3,] -1 3 -2 -2 1 8 -1 -4 NA [4,] -5 -2 0 0 0 -2 0 0 NA [5,] -4 3 5 -3 -6 -2 1 0 NA [6,] -2 3 1 -2 -1 2 2 0 NA [7,] -1 0 4 -4 -1 2 1 -4 NA [8,] -1 -2 -2 5 -3 2 0 2 NA [9,] -4 0 -1 -5 -2 4 -3 -1 NA [10,] 7 -8 3 -2 0 0 2 3 NA [11,] -6 4 -4 0 4 -3 -2 1 NA [12,] -2 4 1 0 -5 2 -7 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/114da1425471389.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/25ohc1425471389.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/3re391425471389.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/4gfjb1425471389.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,] -25.0 -24 -17.0 -14 -16.0 -17.0 -18.0 -19.0 -22.0 -24.0 -24.0 -23.0 [2,] -20.0 -18 -14.5 -10 -11.5 -14.5 -14.5 -16.0 -16.0 -18.5 -18.5 -18.0 [3,] -10.0 -9 -6.5 -8 -10.0 -10.0 -9.5 -9.5 -7.5 -8.5 -9.0 -10.5 [4,] -4.5 -3 -1.5 -3 -3.0 -3.0 -2.5 -2.5 -2.5 -2.5 -0.5 -2.0 [5,] -2.0 1 2.0 -2 -2.0 -1.0 1.0 2.0 2.0 -1.0 1.0 -1.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -18.658523 -17.3792154 -13.7619866 -11.9103 -14.748222 -16.424065 [2,] -1.341477 -0.6207846 0.7619866 -4.0897 -5.251778 -3.575935 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -16.203372 -17.041294 -15.04129382 -17.4378297 -19.055058 -19.43783 [2,] -2.796628 -1.958706 0.04129382 0.4378297 1.055058 -1.56217 $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(-25, -20, -10, -4.5, -2, -24, -18, -9, -3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yeig1425471389.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.0 -2 -4 -5 -6.0 -2.0 -4.0 -3.0 -5.0 -2 -6.0 -7.0 [2,] -1.5 -1 -2 -2 -3.5 -1.5 -2.5 -2.0 -3.5 -1 -3.5 -3.5 [3,] 1.5 3 -1 0 -1.0 0.5 -0.5 -0.5 -1.5 1 -1.0 0.0 [4,] 4.0 7 2 0 2.0 2.0 1.5 2.0 -0.5 3 2.5 1.5 [5,] 9.0 7 8 0 5.0 3.0 4.0 5.0 4.0 7 4.0 4.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.572379 -1.468915 -3.234457 -1.117229 -4.072379 -1.45515 -2.734457 [2,] 4.572379 7.468915 1.234457 1.117229 2.072379 2.45515 1.734457 [,8] [,9] [,10] [,11] [,12] [1,] -2.734457 -3.1758431 -1.234457 -4.351686 -2.985919 [2,] 1.734457 0.1758431 3.234457 2.351686 2.985919 $out [1] -8 $group [1] 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4, -1.5, 1.5, 4, 9, -2, -1, 3, 7, 7, -4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6w8mx1425471389.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] [,9] [1,] -24.0 -25.0 -14.0 -15.0 -24.0 -25.0 -4 -8.0 NA [2,] -19.5 -18.5 -9.0 -13.0 -21.0 -15.0 -2 -4.5 NA [3,] -16.5 -15.0 -3.5 -7.5 -17.5 -10.0 -1 -2.0 NA [4,] -6.5 -12.0 -1.5 -3.0 -11.5 -6.5 1 -1.5 NA [5,] -5.0 -10.0 1.0 0.0 -10.0 -3.0 2 2.0 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -22.42939 -17.96469 -6.92080034 -12.061067 -21.83301 -13.876907 -2.3683201 [2,] -10.57061 -12.03531 -0.07919966 -2.938933 -13.16699 -6.123093 0.3683201 [,8] [,9] [1,] -3.3683201 NA [2,] -0.6316799 NA $out [1] -8 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(-24, -19.5, -16.5, -6.5, -5, -25, -18.5, -15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72duz1425471389.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,] -12.0000 -10.50 -11.1250 [2,] -10.4375 -10.00 -9.6250 [3,] -9.1250 -9.25 -8.9375 [4,] -8.5625 -8.25 -7.6250 [5,] -7.2500 -6.50 -6.5000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] -9.9802 -10.048187 -9.849713 [2,] -8.2698 -8.451813 -8.025287 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(-12, -10.4375, -9.125, -8.5625, -7.25, -10.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/114da1425471389.ps tmp/114da1425471389.png",intern=TRUE)) character(0) > try(system("convert tmp/25ohc1425471389.ps tmp/25ohc1425471389.png",intern=TRUE)) character(0) > try(system("convert tmp/3re391425471389.ps tmp/3re391425471389.png",intern=TRUE)) character(0) > try(system("convert tmp/4gfjb1425471389.ps tmp/4gfjb1425471389.png",intern=TRUE)) character(0) > try(system("convert tmp/5yeig1425471389.ps tmp/5yeig1425471389.png",intern=TRUE)) character(0) > try(system("convert tmp/6w8mx1425471389.ps tmp/6w8mx1425471389.png",intern=TRUE)) character(0) > try(system("convert tmp/72duz1425471389.ps tmp/72duz1425471389.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.499 0.465 2.995