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(24,24,31,25,28,24,25,16,17,11,12,39,19,14,15,7,12,12,14,9,8,4,7,3,5,0,-2,6,11,9,17,21,21,41,57,65,68,73,71,71,70,69,65,57,57,57,55,65,65,64,60,43,47,40,31,27,24,23,17,16,15,8,5,6,5,12,8,17,22,24,36,31,34,47,33,35,31,35,39,46,40,50,62,57,59,52,63,56,55,54,48,39,40,38,34,32) > 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,] 24 19 5 68 65 15 34 59 NA [2,] 24 14 0 73 64 8 47 52 NA [3,] 31 15 -2 71 60 5 33 63 NA [4,] 25 7 6 71 43 6 35 56 NA [5,] 28 12 11 70 47 5 31 55 NA [6,] 24 12 9 69 40 12 35 54 NA [7,] 25 14 17 65 31 8 39 48 NA [8,] 16 9 21 57 27 17 46 39 NA [9,] 17 8 21 57 24 22 40 40 NA [10,] 11 4 41 57 23 24 50 38 NA [11,] 12 7 57 55 17 36 62 34 NA [12,] 39 3 65 65 16 31 57 32 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0 -5 -5 5 -1 -7 13 -7 NA [2,] 7 1 -2 -2 -4 -3 -14 11 NA [3,] -6 -8 8 0 -17 1 2 -7 NA [4,] 3 5 5 -1 4 -1 -4 -1 NA [5,] -4 0 -2 -1 -7 7 4 -1 NA [6,] 1 2 8 -4 -9 -4 4 -6 NA [7,] -9 -5 4 -8 -4 9 7 -9 NA [8,] 1 -1 0 0 -3 5 -6 1 NA [9,] -6 -4 20 0 -1 2 10 -2 NA [10,] 1 3 16 -2 -6 12 12 -4 NA [11,] 27 -4 8 10 -1 -5 -5 -2 NA [12,] -20 2 3 0 -1 3 2 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/1al3v1425564890.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/25lrl1425564890.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/3f0ft1425564890.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/47pdo1425564890.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,] 5 0.0 -2.0 6.0 5.0 9.0 8.0 9.0 8 4.0 7.0 3.0 [2,] 17 11.0 10.0 6.5 11.5 12.0 15.5 16.5 19 17.0 14.5 23.5 [3,] 29 35.5 32.0 30.0 29.5 29.5 28.0 24.0 23 31.0 35.0 35.5 [4,] 62 58.0 61.5 49.5 51.0 47.0 43.5 42.5 40 45.5 56.0 61.0 [5,] 68 73.0 71.0 71.0 70.0 69.0 65.0 57.0 57 57.0 62.0 65.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.862354 9.245125 3.231361 5.979583 7.434733 9.948498 12.3588 [2,] 54.137646 61.754875 60.768639 54.020417 51.565267 49.051502 43.6412 [,8] [,9] [,10] [,11] [,12] [1,] 9.476027 11.2691 15.07949 11.8175 14.55196 [2,] 38.523973 34.7309 46.92051 58.1825 56.44804 $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(5, 17, 29, 62, 68, 0, 11, 35.5, 58, 73, -2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5e1is1425564890.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,] -7.0 -14.0 -17.0 -4.0 -7 -9.0 -9.0 -6 -6.0 -6 -5.0 -1.0 [2,] -6.0 -3.5 -7.5 -1.0 -3 -5.0 -8.5 -2 -3.0 -3 -4.5 -0.5 [3,] -3.0 -2.0 -3.0 1.0 -1 -1.5 -4.5 0 -0.5 2 -1.5 2.0 [4,] 2.5 4.0 1.5 4.5 2 3.0 5.5 1 6.0 12 9.0 2.5 [5,] 13.0 11.0 8.0 5.0 7 8.0 9.0 5 10.0 16 27.0 3.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -7.748222 -6.189608 -8.027529 -2.072379 -3.793072 -5.968915 -12.320601 [2,] 1.748222 2.189608 2.027529 4.072379 1.793072 2.968915 3.320601 [,8] [,9] [,10] [,11] [,12] [1,] -1.675843 -5.527529 -6.379215 -9.041294 0.2084484 [2,] 1.675843 4.527529 10.379215 6.041294 3.7915516 $out [1] 20 -20 $group [1] 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-7, -6, -3, 2.5, 13, -14, -3.5, -2, 4, 11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62gwj1425564890.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,] 11.0 3.0 -2.0 55.0 16.0 5.0 31.0 32.0 NA [2,] 16.5 7.0 5.5 57.0 23.5 7.0 34.5 38.5 NA [3,] 24.0 10.5 14.0 66.5 35.5 13.5 39.5 50.0 NA [4,] 26.5 14.0 31.0 70.5 53.5 23.0 48.5 55.5 NA [5,] 39.0 19.0 65.0 73.0 65.0 36.0 62.0 63.0 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 19.43893 7.307253 2.369279 60.34256 21.8168 6.202293 33.11451 42.24619 [2,] 28.56107 13.692747 25.630721 72.65744 49.1832 20.797707 45.88549 57.75381 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(11, 16.5, 24, 26.5, 39, 3, 7, 10.5, 14, 19, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/76esz1425564890.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,] 28.6250 23.00 26.500 [2,] 30.9375 28.50 28.750 [3,] 32.1250 29.75 31.000 [4,] 35.1250 33.50 36.125 [5,] 38.5000 35.50 43.125 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 30.21505 27.46947 27.63621 [2,] 34.03495 32.03053 34.36379 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(28.625, 30.9375, 32.125, 35.125, 38.5, 23, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1al3v1425564890.ps tmp/1al3v1425564890.png",intern=TRUE)) character(0) > try(system("convert tmp/25lrl1425564890.ps tmp/25lrl1425564890.png",intern=TRUE)) character(0) > try(system("convert tmp/3f0ft1425564890.ps tmp/3f0ft1425564890.png",intern=TRUE)) character(0) > try(system("convert tmp/47pdo1425564890.ps tmp/47pdo1425564890.png",intern=TRUE)) character(0) > try(system("convert tmp/5e1is1425564890.ps tmp/5e1is1425564890.png",intern=TRUE)) character(0) > try(system("convert tmp/62gwj1425564890.ps tmp/62gwj1425564890.png",intern=TRUE)) character(0) > try(system("convert tmp/76esz1425564890.ps tmp/76esz1425564890.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.475 0.439 2.941