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(16.8,17.2,17.4,17.6,17.7,17.7,17.6,17.6,17.5,17.5,17.6,17.6,17.9,18.2,18.4,18.5,19,19.5,19.7,19.9,19.7,19.5,19.7,19.7,19.7,19.9,20.1,20.1,20.1,20.1,20.2,20.3,20.8,21.1,21.2,21.3,21.6,21.7,21.8,22,21.9,21.9,22,22.1,21,19.7,19.8,19.9,19.8,20,20.2,20.3,20.7,20.9,21,21.2,23.7,23.7,23.7,23.8,24,24,24.1,24.3,24.4,24.4,24.5,24.6,24.7,24.6,24.6,24.6,24.7,24.7,24.8,24.9,25,25.1,25.2,25.3) > 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] 80 > (np <- floor(n / par1)) [1] 6 > 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] 7 7 7 7 7 7 7 7 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 16.8 17.9 19.7 21.6 19.8 24.0 24.7 [2,] 17.2 18.2 19.9 21.7 20.0 24.0 24.7 [3,] 17.4 18.4 20.1 21.8 20.2 24.1 24.8 [4,] 17.6 18.5 20.1 22.0 20.3 24.3 24.9 [5,] 17.7 19.0 20.1 21.9 20.7 24.4 25.0 [6,] 17.7 19.5 20.1 21.9 20.9 24.4 25.1 [7,] 17.6 19.7 20.2 22.0 21.0 24.5 25.2 [8,] 17.6 19.9 20.3 22.1 21.2 24.6 25.3 [9,] 17.5 19.7 20.8 21.0 23.7 24.7 NA [10,] 17.5 19.5 21.1 19.7 23.7 24.6 NA [11,] 17.6 19.7 21.2 19.8 23.7 24.6 NA [12,] 17.6 19.7 21.3 19.9 23.8 24.6 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.4 0.3 0.2 0.1 0.2 0.0 0.0 [2,] 0.2 0.2 0.2 0.1 0.2 0.1 0.1 [3,] 0.2 0.1 0.0 0.2 0.1 0.2 0.1 [4,] 0.1 0.5 0.0 -0.1 0.4 0.1 0.1 [5,] 0.0 0.5 0.0 0.0 0.2 0.0 0.1 [6,] -0.1 0.2 0.1 0.1 0.1 0.1 0.1 [7,] 0.0 0.2 0.1 0.1 0.2 0.1 0.1 [8,] -0.1 -0.2 0.5 -1.1 2.5 0.1 NA [9,] 0.0 -0.2 0.3 -1.3 0.0 -0.1 NA [10,] 0.1 0.2 0.1 0.1 0.0 0.0 NA [11,] 0.0 0.0 0.1 0.1 0.1 0.0 NA [12,] 0.3 0.0 0.3 -0.1 0.2 0.1 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/1e6l51457465602.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/2bu941457465602.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/3fq8r1457465602.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/4j1qx1457465602.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,] 16.8 17.20 17.40 17.60 17.70 17.70 17.60 17.60 17.5 17.5 17.6 17.6 [2,] 18.8 19.05 19.25 19.30 19.55 19.80 19.95 20.10 19.7 19.5 19.7 19.7 [3,] 19.8 20.00 20.20 20.30 20.70 20.90 21.00 21.20 20.9 20.4 20.5 20.6 [4,] 22.8 22.85 22.95 23.15 23.15 23.15 23.25 23.35 23.7 23.7 23.7 23.8 [5,] 24.7 24.70 24.80 24.90 25.00 25.10 25.20 25.30 24.7 24.6 24.6 24.6 $n [1] 7 7 7 7 7 7 7 7 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 17.41126 17.7307 17.99042 18.00084 18.55014 18.89943 19.02929 19.25915 [2,] 22.18874 22.2693 22.40958 22.59916 22.84986 22.90057 22.97071 23.14085 [,9] [,10] [,11] [,12] [1,] 18.31987 17.69086 17.91987 17.95537 [2,] 23.48013 23.10914 23.08013 23.24463 $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(16.8, 18.8, 19.8, 22.8, 24.7, 17.2, 19.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/508zl1457465602.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.00 0.1 0.0 -0.10 0.00 0.1 0.10 -1.100000e+00 -0.20 0.0 0.00 -0.10 [2,] 0.05 0.1 0.1 0.05 0.00 0.1 0.10 -2.000000e-01 -0.20 0.0 0.00 0.00 [3,] 0.20 0.2 0.1 0.10 0.00 0.1 0.10 -1.776357e-15 -0.05 0.1 0.05 0.15 [4,] 0.25 0.2 0.2 0.25 0.15 0.1 0.15 5.000000e-01 0.00 0.1 0.10 0.30 [5,] 0.40 0.2 0.2 0.50 0.20 0.1 0.20 5.000000e-01 0.00 0.2 0.10 0.30 $n [1] 7 7 7 7 7 7 7 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.08056323 0.1402816 0.04028161 -0.01943677 -0.08957758 0.1 0.07014081 [2,] 0.31943677 0.2597184 0.15971839 0.21943677 0.08957758 0.1 0.12985919 [,8] [,9] [,10] [,11] [,12] [1,] -0.4515226 -0.17900646 0.03549677 -0.01450323 -0.04350969 [2,] 0.4515226 0.07900646 0.16450323 0.11450323 0.34350969 $out [1] 0.5 -0.1 0.2 0.0 2.5 0.3 -1.3 $group [1] 5 6 6 7 8 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0.0499999999999989, 0.199999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67p0z1457465602.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] [1,] 17.40 17.90 19.70 19.70 19.80 24.00 24.70 [2,] 17.45 18.45 20.10 20.45 20.25 24.20 24.75 [3,] 17.60 19.50 20.15 21.75 20.95 24.45 24.95 [4,] 17.60 19.70 20.95 21.95 23.70 24.60 25.15 [5,] 17.70 19.90 21.30 22.10 23.80 24.70 25.30 $n [1] 12 12 12 12 12 12 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 17.53158 18.92987 19.76231 21.06584 19.37643 24.26756 24.72655 [2,] 17.66842 20.07013 20.53769 22.43416 22.52357 24.63244 25.17345 $out [1] 16.8 17.2 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(17.4, 17.45, 17.6, 17.6, 17.7, 17.9, 18.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7jdec1457465602.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,] 20.64286 19.80 20.8000 [2,] 20.99405 20.25 21.1625 [3,] 21.12500 20.55 21.3750 [4,] 21.31429 20.90 21.4875 [5,] 21.57143 21.20 21.7250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 20.97894 20.25353 21.22677 [2,] 21.27106 20.84647 21.52323 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(20.6428571428571, 20.9940476190476, 21.125, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1e6l51457465602.ps tmp/1e6l51457465602.png",intern=TRUE)) character(0) > try(system("convert tmp/2bu941457465602.ps tmp/2bu941457465602.png",intern=TRUE)) character(0) > try(system("convert tmp/3fq8r1457465602.ps tmp/3fq8r1457465602.png",intern=TRUE)) character(0) > try(system("convert tmp/4j1qx1457465602.ps tmp/4j1qx1457465602.png",intern=TRUE)) character(0) > try(system("convert tmp/508zl1457465602.ps tmp/508zl1457465602.png",intern=TRUE)) character(0) > try(system("convert tmp/67p0z1457465602.ps tmp/67p0z1457465602.png",intern=TRUE)) character(0) > try(system("convert tmp/7jdec1457465602.ps tmp/7jdec1457465602.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.518 0.448 3.003