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(102.8,103.3,103.3,104,104.3,104.1,103.9,103.8,103.7,103.6,103.6,103.8,104.9,106.2,106.8,107.3,106.9,107.1,106.6,106.8,107.1,107.5,107.6,107.7,108.4,108.8,108.9,109.2,110.1,110.4,110.7,111,111,111.2,111.5,111.4,111.1,110.6,110.8,110.9,110.8,110.9,110.6,110.3,109.7,109.4,109,109.5,109.8,108.5,108.4,108.4,107.9,106.7,106.9,106.9,106.7,106.7,106.6,107.1) > 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,] 102.8 104.9 108.4 111.1 109.8 NA [2,] 103.3 106.2 108.8 110.6 108.5 NA [3,] 103.3 106.8 108.9 110.8 108.4 NA [4,] 104.0 107.3 109.2 110.9 108.4 NA [5,] 104.3 106.9 110.1 110.8 107.9 NA [6,] 104.1 107.1 110.4 110.9 106.7 NA [7,] 103.9 106.6 110.7 110.6 106.9 NA [8,] 103.8 106.8 111.0 110.3 106.9 NA [9,] 103.7 107.1 111.0 109.7 106.7 NA [10,] 103.6 107.5 111.2 109.4 106.7 NA [11,] 103.6 107.6 111.5 109.0 106.6 NA [12,] 103.8 107.7 111.4 109.5 107.1 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.5 1.3 0.4 -0.5 -1.3 NA [2,] 0.0 0.6 0.1 0.2 -0.1 NA [3,] 0.7 0.5 0.3 0.1 0.0 NA [4,] 0.3 -0.4 0.9 -0.1 -0.5 NA [5,] -0.2 0.2 0.3 0.1 -1.2 NA [6,] -0.2 -0.5 0.3 -0.3 0.2 NA [7,] -0.1 0.2 0.3 -0.3 0.0 NA [8,] -0.1 0.3 0.0 -0.6 -0.2 NA [9,] -0.1 0.4 0.2 -0.3 0.0 NA [10,] 0.0 0.1 0.3 -0.4 -0.1 NA [11,] 0.2 0.1 -0.1 0.5 0.5 NA [12,] 1.1 0.7 -0.3 0.3 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/1i6om1489659198.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/21pyf1489659198.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/3j75y1489659198.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/4t8hv1489659198.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,] 102.8 103.3 106.8 107.3 104.3 104.1 103.9 103.8 103.7 103.6 103.6 103.8 [2,] 104.9 106.2 106.8 107.3 106.9 106.7 106.6 106.8 106.7 106.7 106.6 107.1 [3,] 108.4 108.5 108.4 108.4 107.9 107.1 106.9 106.9 107.1 107.5 107.6 107.7 [4,] 109.8 108.8 108.9 109.2 110.1 110.4 110.6 110.3 109.7 109.4 109.0 109.5 [5,] 111.1 110.6 110.8 110.9 110.8 110.9 110.7 111.0 111.0 111.2 111.5 111.4 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.9377 106.6628 106.9161 107.0575 105.6389 104.4856 104.0736 104.4269 [2,] 111.8623 110.3372 109.8839 109.7425 110.1611 109.7144 109.7264 109.3731 [,9] [,10] [,11] [,12] [1,] 104.9802 105.5922 105.9042 106.0042 [2,] 109.2198 109.4078 109.2958 109.3958 $out [1] 103.3 104.0 $group [1] 3 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(102.8, 104.9, 108.4, 109.8, 111.1, 103.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5t6ch1489659198.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,] -1.3 -0.1 0.0 -0.5 -0.2 -0.5 -0.3 -0.2 -0.3 -0.4 -0.1 -3.000000e-01 [2,] -0.5 0.0 0.1 -0.4 -0.2 -0.3 -0.1 -0.2 -0.1 -0.1 0.1 -7.105427e-15 [3,] 0.4 0.1 0.3 -0.1 0.1 -0.2 0.0 -0.1 0.0 0.0 0.2 5.000000e-01 [4,] 0.5 0.2 0.5 0.3 0.2 0.2 0.2 0.0 0.2 0.1 0.5 9.000000e-01 [5,] 1.3 0.2 0.7 0.9 0.3 0.3 0.3 0.3 0.4 0.3 0.5 1.100000e+00 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.3065975 -0.0413195 0.01736101 -0.5946182 -0.182639 -0.5532987 [2,] 1.1065975 0.2413195 0.58263899 0.3946182 0.382639 0.1532987 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.2119792 -0.2413195 -0.2119792 -0.1413195 -0.08263899 -0.211 [2,] 0.2119792 0.0413195 0.2119792 0.1413195 0.48263899 1.211 $out [1] 0.6 -1.2 -0.6 $group [1] 2 5 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.3, -0.5, 0.399999999999991, 0.5, 1.3, -0.0999999999999943, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mem61489659198.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,] 102.80 106.2 108.40 109.00 106.6 NA [2,] 103.45 106.7 109.05 109.60 106.7 NA [3,] 103.75 107.0 110.55 110.60 107.0 NA [4,] 103.95 107.4 111.10 110.85 108.4 NA [5,] 104.30 107.7 111.50 111.10 109.8 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 103.5219 106.6807 109.615 110.0299 106.2246 NA [2,] 103.9781 107.3193 111.485 111.1701 107.7754 NA $out [1] 104.9 $group [1] 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(102.8, 103.45, 103.75, 103.95, 104.3, 106.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73fbs1489659198.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,] 107.40 106.90 107.350 [2,] 107.64 107.10 107.825 [3,] 107.71 107.65 108.225 [4,] 107.87 108.40 108.525 [5,] 108.00 108.50 108.600 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 107.6051 107.0571 107.9057 [2,] 107.8149 108.2429 108.5443 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(107.4, 107.64, 107.71, 107.87, 108, 106.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1i6om1489659198.ps tmp/1i6om1489659198.png",intern=TRUE)) character(0) > try(system("convert tmp/21pyf1489659198.ps tmp/21pyf1489659198.png",intern=TRUE)) character(0) > try(system("convert tmp/3j75y1489659198.ps tmp/3j75y1489659198.png",intern=TRUE)) character(0) > try(system("convert tmp/4t8hv1489659198.ps tmp/4t8hv1489659198.png",intern=TRUE)) character(0) > try(system("convert tmp/5t6ch1489659198.ps tmp/5t6ch1489659198.png",intern=TRUE)) character(0) > try(system("convert tmp/6mem61489659198.ps tmp/6mem61489659198.png",intern=TRUE)) character(0) > try(system("convert tmp/73fbs1489659198.ps tmp/73fbs1489659198.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.529 0.182 2.751