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(53,47,49,44,48,51,47,44,33,47,41,36,46,24,17,22,30,24,18,24,24,28,19,22,26,14,16,21,15,23,29,17,24,18,22,8,26,22,34,25,20,35,38,24,14,25,31,17,32,27,30,19,36,27,28,38,26,25,30,27,30,50,48,34,41,26,39,33,38,28,36,20,39,22,32,32,31,28,44,40,32,35,32,31,41,23,36,36,42,36,64,30,25,51,38,27) > 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,] 53 46 26 26 32 30 39 41 NA [2,] 47 24 14 22 27 50 22 23 NA [3,] 49 17 16 34 30 48 32 36 NA [4,] 44 22 21 25 19 34 32 36 NA [5,] 48 30 15 20 36 41 31 42 NA [6,] 51 24 23 35 27 26 28 36 NA [7,] 47 18 29 38 28 39 44 64 NA [8,] 44 24 17 24 38 33 40 30 NA [9,] 33 24 24 14 26 38 32 25 NA [10,] 47 28 18 25 25 28 35 51 NA [11,] 41 19 22 31 30 36 32 38 NA [12,] 36 22 8 17 27 20 31 27 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -6 -22 -12 -4 -5 20 -17 -18 NA [2,] 2 -7 2 12 3 -2 10 13 NA [3,] -5 5 5 -9 -11 -14 0 0 NA [4,] 4 8 -6 -5 17 7 -1 6 NA [5,] 3 -6 8 15 -9 -15 -3 -6 NA [6,] -4 -6 6 3 1 13 16 28 NA [7,] -3 6 -12 -14 10 -6 -4 -34 NA [8,] -11 0 7 -10 -12 5 -8 -5 NA [9,] 14 4 -6 11 -1 -10 3 26 NA [10,] -6 -9 4 6 5 8 -3 -13 NA [11,] -5 3 -14 -14 -3 -16 -1 -11 NA [12,] 10 4 18 15 3 19 10 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/1jwa81419868289.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/2bd1u1419868289.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/3qd051419868289.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/4d7bk1419868289.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,] 26.0 14.0 16.0 19.0 15.0 23.0 18.0 17.0 14.0 18 19.0 8.0 [2,] 28.0 22.0 23.5 21.5 25.0 25.0 28.5 24.0 24.0 25 26.0 18.5 [3,] 35.5 23.5 33.0 28.5 33.5 27.5 38.5 31.5 25.5 28 31.5 24.5 [4,] 43.5 37.0 42.0 35.0 41.5 35.5 45.5 39.0 32.5 41 37.0 29.0 [5,] 53.0 50.0 49.0 44.0 48.0 51.0 64.0 44.0 38.0 51 41.0 36.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 26.84148 15.12078 22.66563 20.95871 24.28286 21.63455 29.00356 23.12078 [2,] 44.15852 31.87922 43.33437 36.04129 42.71714 33.36545 47.99644 39.87922 [,9] [,10] [,11] [,12] [1,] 20.75178 19.06217 25.35524 18.63455 [2,] 30.24822 36.93783 37.64476 30.36545 $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(26, 28, 35.5, 43.5, 53, 14, 22, 23.5, 37, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5g5pi1419868289.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,] -22.0 -7.0 -14.0 -6.0 -15.0 -6.0 -34.0 -12.0 -10.0 -13.0 -16 3.0 [2,] -17.5 0.0 -10.0 -3.0 -7.5 -1.5 -13.0 -10.5 -3.5 -7.5 -14 7.0 [3,] -9.0 2.5 -2.5 5.0 -4.5 4.5 -5.0 -6.5 3.5 0.5 -8 10.0 [4,] -4.5 11.0 2.5 7.5 5.5 14.5 1.5 2.5 12.5 5.5 -2 16.5 [5,] -4.0 13.0 5.0 17.0 15.0 28.0 10.0 7.0 26.0 8.0 3 19.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -16.261987 -3.644758 -9.482679 -0.8654507 -11.761987 -4.43783 -13.099908 [2,] -1.738013 8.644758 4.482679 10.8654507 2.761987 13.43783 3.099908 [,8] [,9] [,10] [,11] [,12] [1,] -13.7619866 -5.43783 -6.761987 -14.703372 4.326753 [2,] 0.7619866 12.43783 7.761987 -1.296628 15.673247 $out [1] 20 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-22, -17.5, -9, -4.5, -4, -7, 0, 2.5, 11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6w1po1419868289.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,] 36.0 17.0 8.0 14.0 25.0 20 22 23.0 NA [2,] 42.5 20.5 15.5 21.0 26.5 29 31 28.5 NA [3,] 47.0 24.0 19.5 25.0 27.5 35 32 36.0 NA [4,] 48.5 26.0 23.5 32.5 31.0 40 37 41.5 NA [5,] 53.0 30.0 29.0 38.0 36.0 50 44 51.0 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 44.26336 21.49141 15.85115 19.75477 25.44752 29.98283 29.26336 30.07061 [2,] 49.73664 26.50859 23.14885 30.24523 29.55248 40.01717 34.73664 41.92939 [,9] [1,] NA [2,] NA $out [1] 33 46 19 38 64 $group [1] 1 2 5 5 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(36, 42.5, 47, 48.5, 53, 17, 20.5, 24, 26, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7e2u31419868289.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,] 23.5000 23.50 23.625 [2,] 28.8750 26.50 28.125 [3,] 31.2500 30.00 31.375 [4,] 32.8125 33.25 33.625 [5,] 38.3750 38.50 36.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 29.45408 26.92128 28.86641 [2,] 33.04592 33.07872 33.88359 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(23.5, 28.875, 31.25, 32.8125, 38.375, 23.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jwa81419868289.ps tmp/1jwa81419868289.png",intern=TRUE)) character(0) > try(system("convert tmp/2bd1u1419868289.ps tmp/2bd1u1419868289.png",intern=TRUE)) character(0) > try(system("convert tmp/3qd051419868289.ps tmp/3qd051419868289.png",intern=TRUE)) character(0) > try(system("convert tmp/4d7bk1419868289.ps tmp/4d7bk1419868289.png",intern=TRUE)) character(0) > try(system("convert tmp/5g5pi1419868289.ps tmp/5g5pi1419868289.png",intern=TRUE)) character(0) > try(system("convert tmp/6w1po1419868289.ps tmp/6w1po1419868289.png",intern=TRUE)) character(0) > try(system("convert tmp/7e2u31419868289.ps tmp/7e2u31419868289.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.742 0.505 3.280