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(70,65,62,58,55,67,64,60,71,71,73,69,81,84,84,80,76,87,83,78,87,85,81,78,87,89,88,84,82,91,93,90,100,98,95,89,99,100,99,94,86,90,86,82,86,84,82,80,86,80,79,78,73,80,79,74,82,81,76,69) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 70 81 87 99 86 NA [2,] 65 84 89 100 80 NA [3,] 62 84 88 99 79 NA [4,] 58 80 84 94 78 NA [5,] 55 76 82 86 73 NA [6,] 67 87 91 90 80 NA [7,] 64 83 93 86 79 NA [8,] 60 78 90 82 74 NA [9,] 71 87 100 86 82 NA [10,] 71 85 98 84 81 NA [11,] 73 81 95 82 76 NA [12,] 69 78 89 80 69 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -5 3 2 1 -6 NA [2,] -3 0 -1 -1 -1 NA [3,] -4 -4 -4 -5 -1 NA [4,] -3 -4 -2 -8 -5 NA [5,] 12 11 9 4 7 NA [6,] -3 -4 2 -4 -1 NA [7,] -4 -5 -3 -4 -5 NA [8,] 11 9 10 4 8 NA [9,] 0 -2 -2 -2 -1 NA [10,] 2 -4 -3 -2 -5 NA [11,] -4 -3 -6 -2 -7 NA [12,] 12 9 10 6 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/1bxoh1476186185.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/2ihq51476186185.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/3n7fc1476186185.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/4poem1476186185.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,] 81 80 79 78 73 67 79 74 82 81 73 69 [2,] 81 80 79 78 73 80 79 74 82 81 76 69 [3,] 86 84 84 80 76 87 83 78 86 84 81 78 [4,] 87 89 88 84 82 90 86 82 87 85 82 80 [5,] 87 100 99 84 86 91 93 90 87 85 82 89 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 81.76042 77.64062 77.64062 75.76042 69.64062 79.93403 78.05382 72.34722 [2,] 90.23958 90.35938 90.35938 84.23958 82.35938 94.06597 87.94618 83.65278 [,9] [,10] [,11] [,12] [1,] 82.46701 81.17361 76.76042 70.22743 [2,] 89.53299 86.82639 85.23958 85.77257 $out [1] 70 99 65 62 58 94 55 64 60 71 100 71 98 95 $group [1] 1 1 2 3 4 4 5 7 8 9 9 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(81, 81, 86, 87, 87, 80, 80, 84, 89, 100, 79, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5l81t1476186185.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,] -6 -1 -4 -8 4 -4 -5 8 -2 -5 -7 6.0 [2,] -5 -1 -4 -5 7 -4 -5 8 -2 -4 -6 7.5 [3,] 1 -1 -4 -4 9 -3 -4 9 -2 -3 -4 9.5 [4,] 2 -1 -4 -3 11 -1 -4 10 -1 -2 -3 11.0 [5,] 3 -1 -4 -2 12 2 -3 11 0 -2 -2 12.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -3.946182 -1 -4 -5.413195 6.17361 -5.1197924 -4.706597 7.586805 [2,] 5.946182 -1 -4 -2.586805 11.82639 -0.8802076 -3.293403 10.413195 [,9] [,10] [,11] [,12] [1,] -2.706597 -4.413195 -6.119792 6.735 [2,] -1.293403 -1.586805 -1.880208 12.265 $out [1] -3 0 -5 -1 4 2 $group [1] 2 2 3 3 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-6, -5, 1, 2, 3, -1, -1, -1, -1, -1, -4, -4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tgdy1476186185.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] [1,] 55.0 76.0 82.0 80.0 69.0 NA [2,] 61.0 79.0 87.5 83.0 75.0 NA [3,] 66.0 82.0 89.5 86.0 79.0 NA [4,] 70.5 84.5 94.0 96.5 80.5 NA [5,] 73.0 87.0 100.0 100.0 86.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 61.66699 79.49141 86.53531 79.84256 76.49141 NA [2,] 70.33301 84.50859 92.46469 92.15744 81.50859 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(55, 61, 66, 70.5, 73, 76, 79, 82, 84.5, 87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/77qx61476186185.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,] 74.4 76.0 74.50 [2,] 77.9 79.0 78.50 [3,] 81.9 83.5 82.75 [4,] 83.7 85.0 84.25 [5,] 85.2 87.0 85.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 79.25458 80.76336 80.12739 [2,] 84.54542 86.23664 85.37261 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(74.4, 77.9, 81.9, 83.7, 85.2, 76, 79, 83.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bxoh1476186185.ps tmp/1bxoh1476186185.png",intern=TRUE)) character(0) > try(system("convert tmp/2ihq51476186185.ps tmp/2ihq51476186185.png",intern=TRUE)) character(0) > try(system("convert tmp/3n7fc1476186185.ps tmp/3n7fc1476186185.png",intern=TRUE)) character(0) > try(system("convert tmp/4poem1476186185.ps tmp/4poem1476186185.png",intern=TRUE)) character(0) > try(system("convert tmp/5l81t1476186185.ps tmp/5l81t1476186185.png",intern=TRUE)) character(0) > try(system("convert tmp/6tgdy1476186185.ps tmp/6tgdy1476186185.png",intern=TRUE)) character(0) > try(system("convert tmp/77qx61476186185.ps tmp/77qx61476186185.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.492 0.212 2.745