R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(11,13,15,29,31,22,36,39,30,20,18,13,11,16,20,29,31,24,40,41,25,19,19,18,10,17,25,30,32,24,38,36,26,25,26,16,12,15,21,33,32,24,41,38,28,24,30,18) > 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] 48 > (np <- floor(n / par1)) [1] 4 > 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] 4 4 4 4 4 4 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 11 11 10 12 NA [2,] 13 16 17 15 NA [3,] 15 20 25 21 NA [4,] 29 29 30 33 NA [5,] 31 31 32 32 NA [6,] 22 24 24 24 NA [7,] 36 40 38 41 NA [8,] 39 41 36 38 NA [9,] 30 25 26 28 NA [10,] 20 19 25 24 NA [11,] 18 19 26 30 NA [12,] 13 18 16 18 NA > darr [,1] [,2] [,3] [,4] [,5] [1,] 2 5 7 3 NA [2,] 2 4 8 6 NA [3,] 14 9 5 12 NA [4,] 2 2 2 -1 NA [5,] -9 -7 -8 -8 NA [6,] 14 16 14 17 NA [7,] 3 1 -2 -3 NA [8,] -9 -16 -10 -10 NA [9,] -10 -6 -1 -4 NA [10,] -2 0 1 6 NA [11,] -5 -1 -10 -12 NA [12,] -2 -8 -4 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/1fkxb1476789999.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/2ei5d1476789999.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/35jv41476789999.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/4gm9a1476789999.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,] 10.0 13.0 15.0 29.0 31.0 22 36.0 36.0 25.0 19.0 18.0 13.0 [2,] 10.5 14.0 17.5 29.0 31.0 23 37.0 37.0 25.5 19.5 18.5 14.5 [3,] 11.0 15.5 20.5 29.5 31.5 24 39.0 38.5 27.0 22.0 22.5 17.0 [4,] 11.5 16.5 23.0 31.5 32.0 24 40.5 40.0 29.0 24.5 28.0 18.0 [5,] 12.0 17.0 25.0 33.0 32.0 24 41.0 41.0 30.0 25.0 30.0 18.0 $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 10.21 13.525 16.155 27.525 30.71 23.21 36.235 36.13 24.235 18.05 14.995 [2,] 11.79 17.475 24.845 31.475 32.29 24.79 41.765 40.87 29.765 25.95 30.005 [,12] [1,] 14.235 [2,] 19.765 $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(10, 10.5, 11, 11.5, 12, 13, 14, 15.5, 16.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5fmzx1476789999.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,] 2.0 2 5.0 -1.0 -9.0 14.0 -3.0 -16.0 -10.0 -2.0 -12.0 -8 [2,] 2.5 3 7.0 0.5 -8.5 14.0 -2.5 -13.0 -8.0 -1.0 -11.0 -6 [3,] 4.0 5 10.5 2.0 -8.0 15.0 -0.5 -10.0 -5.0 0.5 -7.5 -4 [4,] 6.0 7 13.0 2.0 -7.5 16.5 2.0 -9.5 -2.5 3.5 -3.0 -3 [5,] 7.0 8 14.0 2.0 -7.0 17.0 3.0 -9.0 -1.0 6.0 -1.0 -2 $n [1] 4 4 4 4 4 4 4 4 4 4 4 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 1.235 1.84 5.76 0.815 -8.79 13.025 -4.055 -12.765 -9.345 -3.055 -13.82 [2,] 6.765 8.16 15.24 3.185 -7.21 16.975 3.055 -7.235 -0.655 4.055 -1.18 [,12] [1,] -6.73664 [2,] -1.26336 $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(2, 2.5, 4, 6, 7, 2, 3, 5, 7, 8, 5, 7, 10.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64wdf1476789999.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] [1,] 11.0 11.0 10.0 12.0 NA [2,] 14.0 18.5 20.5 19.5 NA [3,] 21.0 22.0 25.5 26.0 NA [4,] 30.5 30.0 31.0 32.5 NA [5,] 39.0 41.0 38.0 41.0 NA $n [1] 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [1,] 13.47424 16.75477 20.71088 20.07061 NA [2,] 28.52576 27.24523 30.28912 31.92939 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(11, 14, 21, 30.5, 39, 11, 18.5, 22, 30, 41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/71d0a1476789999.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,] 11.000 11.00 11.0000 [2,] 18.250 18.75 18.5000 [3,] 23.375 23.25 23.3125 [4,] 30.875 30.50 30.6875 [5,] 38.750 39.00 38.8750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 17.61665 17.89075 17.7537 [2,] 29.13335 28.60925 28.8713 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(11, 18.25, 23.375, 30.875, 38.75, 11, 18.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fkxb1476789999.ps tmp/1fkxb1476789999.png",intern=TRUE)) character(0) > try(system("convert tmp/2ei5d1476789999.ps tmp/2ei5d1476789999.png",intern=TRUE)) character(0) > try(system("convert tmp/35jv41476789999.ps tmp/35jv41476789999.png",intern=TRUE)) character(0) > try(system("convert tmp/4gm9a1476789999.ps tmp/4gm9a1476789999.png",intern=TRUE)) character(0) > try(system("convert tmp/5fmzx1476789999.ps tmp/5fmzx1476789999.png",intern=TRUE)) character(0) > try(system("convert tmp/64wdf1476789999.ps tmp/64wdf1476789999.png",intern=TRUE)) character(0) > try(system("convert tmp/71d0a1476789999.ps tmp/71d0a1476789999.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.405 0.212 2.664