R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 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(-12,-12,-8,-6,-2,4,3,5,8,5,3,6,15,12,11,12,14,18,15,16,-1,-5,-6,-5,-2,-9,-9,-12,-16,-19,-30,-26,-22,-31,-33,-31,-27,-29,-33,-27,-22,-23,-23,-15,-15,-24,-18,-14,-7,-12,-12,-15,-16,-17,-13,-8,-13,-13,-11,-16,-34,-35,-38,-32,-37,-39,-31,-30,-29,-36,-41,-42,-33,-43,-41,-34,-32,-36,-37,-30,-32,-30,-21,-19,-6,-11,-11) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (n <- length(x)) [1] 87 > (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] 8 8 8 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -12 15 -2 -27 -7 -34 -33 -6 [2,] -12 12 -9 -29 -12 -35 -43 -11 [3,] -8 11 -9 -33 -12 -38 -41 -11 [4,] -6 12 -12 -27 -15 -32 -34 NA [5,] -2 14 -16 -22 -16 -37 -32 NA [6,] 4 18 -19 -23 -17 -39 -36 NA [7,] 3 15 -30 -23 -13 -31 -37 NA [8,] 5 16 -26 -15 -8 -30 -30 NA [9,] 8 -1 -22 -15 -13 -29 -32 NA [10,] 5 -5 -31 -24 -13 -36 -30 NA [11,] 3 -6 -33 -18 -11 -41 -21 NA [12,] 6 -5 -31 -14 -16 -42 -19 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0 -3 -7 -2 -5 -1 -10 -5 [2,] 4 -1 0 -4 0 -3 2 0 [3,] 2 1 -3 6 -3 6 7 NA [4,] 4 2 -4 5 -1 -5 2 NA [5,] 6 4 -3 -1 -1 -2 -4 NA [6,] -1 -3 -11 0 4 8 -1 NA [7,] 2 1 4 8 5 1 7 NA [8,] 3 -17 4 0 -5 1 -2 NA [9,] -3 -4 -9 -9 0 -7 2 NA [10,] -2 -1 -2 6 2 -5 9 NA [11,] 3 1 2 4 -5 -1 2 NA [12,] 9 3 4 7 -18 9 13 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/10t6z1452527198.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/2zdw81452527198.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/3mxia1452527198.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/4909v1452527198.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,] -34.0 -43 -41.0 -34.0 -37 -39.0 -37.0 -30.0 -32.0 -36.0 -41.0 -42.0 [2,] -30.0 -32 -35.5 -29.5 -27 -29.5 -30.5 -28.0 -25.5 -30.5 -27.0 -25.0 [3,] -9.5 -12 -11.5 -15.0 -16 -19.0 -23.0 -15.0 -15.0 -24.0 -18.0 -16.0 [4,] -4.0 -10 -8.5 -9.0 -9 -6.5 -5.0 -1.5 -7.0 -9.0 -8.5 -9.5 [5,] 15.0 12 11.0 12.0 14 18.0 15.0 16.0 8.0 5.0 3.0 6.0 $n [1] 8 8 8 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -24.023973 -24.2895159 -26.582588 -27.242269 -26.74931 -32.735229 [2,] 5.023973 0.2895159 3.582588 -2.757731 -5.25069 -5.264771 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -38.228189 -30.8253725 -26.047902 -36.83945 -29.047902 -25.25635 [2,] -7.771811 0.8253725 -3.952098 -11.16055 -6.952098 -6.74365 $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(-34, -30, -9.5, -4, 15, -43, -32, -12, -10, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59rep1452527198.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,] -10.0 -4 -3 -5.0 -4.0 -3 1.0 -5.0 -9.0 -5 -1.0 3.0 [2,] -6.0 -2 -1 -2.5 -2.5 -2 1.5 -3.5 -8.0 -2 0.0 3.5 [3,] -4.0 0 2 2.0 -1.0 -1 4.0 0.0 -4.0 -1 2.0 7.0 [4,] -1.5 1 6 3.0 1.5 2 6.0 2.0 -1.5 4 2.5 9.0 [5,] 0.0 4 7 5.0 6.0 8 8.0 4.0 2.0 9 4.0 13.0 $n [1] 8 8 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -6.513765 -1.675843 -2.180287 -1.284511 -3.388735 -3.388735 1.312673 [2,] -1.486235 1.675843 6.180287 5.284511 1.388735 1.388735 6.687327 [,8] [,9] [,10] [,11] [,12] [1,] -3.284511 -7.8816951 -4.583103 0.5070403 3.715489 [2,] 3.284511 -0.1183049 2.583103 3.4929597 10.284511 $out [1] -11 -17 -5 -18 $group [1] 6 8 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-10, -6, -4, -1.5, 0, -4, -2, 0, 1, 4, -3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68oz51452527198.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,] -12 -6 -33.0 -33.0 -17.0 -42.0 -43.0 -11.0 [2,] -7 -3 -30.5 -27.0 -15.5 -38.5 -36.5 -11.0 [3,] 3 12 -20.5 -23.0 -13.0 -35.5 -32.5 -11.0 [4,] 5 15 -10.5 -16.5 -11.5 -31.5 -30.0 -8.5 [5,] 8 18 -2.0 -14.0 -7.0 -29.0 -21.0 -6.0 $n [1] 12 12 12 12 12 12 12 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.473281 3.790079 -29.62213 -27.78912 -14.82443 -38.69275 -35.46469 [2,] 8.473281 20.209921 -11.37787 -18.21088 -11.17557 -32.30725 -29.53531 [,8] [1,] -13.280534 [2,] -8.719466 $out [1] -19 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(-12, -7, 3, 5, 8, -6, -3, 12, 15, 18, -33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qrxt1452527198.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,] -19.14286 -24.0 -21.500 [2,] -17.50000 -18.5 -19.500 [3,] -16.42857 -15.5 -17.875 [4,] -15.35714 -13.5 -17.000 [5,] -12.57143 -9.5 -14.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] -17.40594 -17.78053 -19.01527 [2,] -15.45120 -13.21947 -16.73473 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(-19.1428571428571, -17.5, -16.4285714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10t6z1452527198.ps tmp/10t6z1452527198.png",intern=TRUE)) character(0) > try(system("convert tmp/2zdw81452527198.ps tmp/2zdw81452527198.png",intern=TRUE)) character(0) > try(system("convert tmp/3mxia1452527198.ps tmp/3mxia1452527198.png",intern=TRUE)) character(0) > try(system("convert tmp/4909v1452527198.ps tmp/4909v1452527198.png",intern=TRUE)) character(0) > try(system("convert tmp/59rep1452527198.ps tmp/59rep1452527198.png",intern=TRUE)) character(0) > try(system("convert tmp/68oz51452527198.ps tmp/68oz51452527198.png",intern=TRUE)) character(0) > try(system("convert tmp/7qrxt1452527198.ps tmp/7qrxt1452527198.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.458 0.429 2.905