R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 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(10,11,11,12,13,13,15,15,16,16,17,18,18,18,19,19,20,20,21,22,24,24,24,24,25,25,25,26,26,28,29,29,30,30,30,31,31,32,32,33,36,36,38,38,39,40,41,41) > 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,] 10 18 25 31 NA [2,] 11 18 25 32 NA [3,] 11 19 25 32 NA [4,] 12 19 26 33 NA [5,] 13 20 26 36 NA [6,] 13 20 28 36 NA [7,] 15 21 29 38 NA [8,] 15 22 29 38 NA [9,] 16 24 30 39 NA [10,] 16 24 30 40 NA [11,] 17 24 30 41 NA [12,] 18 24 31 41 NA > darr [,1] [,2] [,3] [,4] [,5] [1,] 1 0 0 1 NA [2,] 0 1 0 0 NA [3,] 1 0 1 1 NA [4,] 1 1 0 3 NA [5,] 0 0 2 0 NA [6,] 2 1 1 2 NA [7,] 0 1 0 0 NA [8,] 1 2 1 1 NA [9,] 0 0 0 1 NA [10,] 1 0 0 1 NA [11,] 1 0 1 0 NA [12,] 0 1 0 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/132oe1489495071.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/2lhww1489495071.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/3un0e1489495071.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/4kkud1489495071.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 11.0 11.0 12.0 13.0 13.0 15.0 15.0 16.0 16 17.0 18.0 [2,] 14.0 14.5 15.0 15.5 16.5 16.5 18.0 18.5 20.0 20 20.5 21.0 [3,] 21.5 21.5 22.0 22.5 23.0 24.0 25.0 25.5 27.0 27 27.0 27.5 [4,] 28.0 28.5 28.5 29.5 31.0 32.0 33.5 33.5 34.5 35 35.5 36.0 [5,] 31.0 32.0 32.0 33.0 36.0 36.0 38.0 38.0 39.0 40 41.0 41.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.44 10.44 11.335 11.44 11.545 11.755 12.755 13.65 15.545 15.15 15.15 [2,] 32.56 32.56 32.665 33.56 34.455 36.245 37.245 37.35 38.455 38.85 38.85 [,12] [1,] 15.65 [2,] 39.35 $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, 14, 21.5, 28, 31, 11, 14.5, 21.5, 28.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58wo51489495071.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,] 0.0 0.0 0.0 0.0 0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 [2,] 0.0 0.0 0.5 0.5 0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 [3,] 0.5 0.0 1.0 1.0 0 1.5 0.0 1.0 0.0 0.5 0.5 0.0 [4,] 1.0 0.5 1.0 2.0 1 2.0 0.5 1.5 0.5 1.0 1.0 0.5 [5,] 1.0 1.0 1.0 3.0 2 2.0 1.0 2.0 1.0 1.0 1.0 1.0 $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,] -0.29 -0.395 0.605 -0.185 -0.79 0.71 -0.395 0.605 -0.395 -0.29 -0.29 [2,] 1.29 0.395 1.395 2.185 0.79 2.29 0.395 1.395 0.395 1.29 1.29 [,12] [1,] -0.4561067 [2,] 0.4561067 $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(0, 0, 0.5, 1, 1, 0, 0, 0, 0.5, 1, 0, 0.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dtse1489495071.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,] 10.0 18.0 25.0 31.0 NA [2,] 11.5 19.0 25.5 32.5 NA [3,] 14.0 20.5 28.5 37.0 NA [4,] 16.0 24.0 30.0 39.5 NA [5,] 18.0 24.0 31.0 41.0 NA $n [1] 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [1,] 11.94752 18.21947 26.44752 33.80725 NA [2,] 16.05248 22.78053 30.55248 40.19275 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(10, 11.5, 14, 16, 18, 18, 19, 20.5, 24, 24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7q6hc1489495071.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,] 21.000 21.50 21.2500 [2,] 22.125 22.25 22.1875 [3,] 25.000 24.50 24.7500 [4,] 27.375 27.00 27.1875 [5,] 28.500 27.50 28.0000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 22.60544 22.33349 22.46947 [2,] 27.39456 26.66651 27.03053 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(21, 22.125, 25, 27.375, 28.5, 21.5, 22.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/132oe1489495071.ps tmp/132oe1489495071.png",intern=TRUE)) character(0) > try(system("convert tmp/2lhww1489495071.ps tmp/2lhww1489495071.png",intern=TRUE)) character(0) > try(system("convert tmp/3un0e1489495071.ps tmp/3un0e1489495071.png",intern=TRUE)) character(0) > try(system("convert tmp/4kkud1489495071.ps tmp/4kkud1489495071.png",intern=TRUE)) character(0) > try(system("convert tmp/58wo51489495071.ps tmp/58wo51489495071.png",intern=TRUE)) character(0) > try(system("convert tmp/6dtse1489495071.ps tmp/6dtse1489495071.png",intern=TRUE)) character(0) > try(system("convert tmp/7q6hc1489495071.ps tmp/7q6hc1489495071.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.675 0.188 2.932