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(103.71,103.07,103.93,102.9,101.54,102.13,101.08,101.33,101.24,100.58,99.87,99.1,98.98,98.77,98.05,97.94,97.65,97.2,97.39,97.35,98.01,97.81,97.56,98.05,97.82,99.05,98.86,97.64,97.77,98.07,98.36,100,99.52,98.82,98.98,98.6,98.8,99.62,99.35,99.87,99.53,99.88,99.26,99.51,100.64,100.85,101.44,101.26,101.67,102.93,103.81,106.19,106.94,108.51,108.41,108.97,109.25,109.97,108.92,109.01,108.86,107.36,107.99,107.94,108.54,108.37,108.77,107.15,108.61,109.02,109.16,109.55) > par1 = '5' > par1 <- '5' > #'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] 72 > (np <- floor(n / par1)) [1] 14 > 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] 15 15 14 14 14 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 103.71 102.13 99.87 97.94 98.01 99.05 98.36 98.60 99.53 100.85 103.81 [2,] 103.07 101.08 99.10 97.65 97.81 98.86 100.00 98.80 99.88 101.44 106.19 [3,] 103.93 101.33 98.98 97.20 97.56 97.64 99.52 99.62 99.26 101.26 106.94 [4,] 102.90 101.24 98.77 97.39 98.05 97.77 98.82 99.35 99.51 101.67 108.51 [5,] 101.54 100.58 98.05 97.35 97.82 98.07 98.98 99.87 100.64 102.93 108.41 [,12] [,13] [,14] [,15] [1,] 108.97 108.86 108.37 109.16 [2,] 109.25 107.36 108.77 109.55 [3,] 109.97 107.99 107.15 NA [4,] 108.92 107.94 108.61 NA [5,] 109.01 108.54 109.02 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.64 -1.05 -0.77 -0.29 -0.20 -0.19 1.64 0.20 0.35 0.59 2.38 0.28 [2,] 0.86 0.25 -0.12 -0.45 -0.25 -1.22 -0.48 0.82 -0.62 -0.18 0.75 0.72 [3,] -1.03 -0.09 -0.21 0.19 0.49 0.13 -0.70 -0.27 0.25 0.41 1.57 -1.05 [4,] -1.36 -0.66 -0.72 -0.04 -0.23 0.30 0.16 0.52 1.13 1.26 -0.10 0.09 [5,] 0.59 -0.71 -0.11 0.66 1.23 0.29 -0.38 -0.34 0.21 0.88 0.56 -0.15 [,13] [,14] [,15] [1,] -1.50 0.40 0.39 [2,] 0.63 -1.62 NA [3,] -0.05 1.46 NA [4,] 0.60 0.41 NA [5,] -0.17 0.14 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/1yg571457085574.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/22l3r1457085574.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/347fd1457085574.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/40bcq1457085574.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] [1,] 97.940 97.650 97.20 97.390 97.35 [2,] 98.825 98.980 98.98 98.770 98.07 [3,] 100.850 101.080 100.44 100.375 100.61 [4,] 106.090 106.775 106.94 107.940 108.41 [5,] 109.160 109.550 109.97 108.920 109.02 $n [1] 15 15 14 14 14 $conf [,1] [,2] [,3] [,4] [,5] [1,] 97.88621 97.90 97.07871 96.50276 96.2437 [2,] 103.81379 104.26 103.80129 104.24724 104.9763 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" Warning message: In bxp(list(stats = c(97.94, 98.825, 100.85, 106.09, 109.16, 97.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50ghv1457085574.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] [1,] -1.500 -1.62 -1.05 -0.720 -0.710 [2,] -0.465 -0.48 -0.27 -0.230 -0.170 [3,] 0.200 -0.15 0.04 0.125 0.175 [4,] 0.395 0.72 0.41 0.520 0.590 [5,] 1.640 0.86 0.49 1.260 1.230 $n [1] 15 14 14 14 14 $conf [,1] [,2] [,3] [,4] [,5] [1,] -0.1508407 -0.6567273 -0.2471455 -0.1917046 -0.1459273 [2,] 0.5508407 0.3567273 0.3271455 0.4417046 0.4959273 $out [1] 2.38 1.57 1.46 -1.36 $group [1] 1 3 3 4 $names [1] "1" "2" "3" "4" "5" Warning message: In bxp(list(stats = c(-1.5, -0.464999999999996, 0.200000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64akt1457085574.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] [,8] [,9] [,10] [,11] [1,] 102.90 101.08 98.77 97.20 97.56 97.64 98.36 98.60 99.26 100.85 103.81 [2,] 102.90 101.08 98.77 97.35 97.81 97.77 98.82 98.80 99.51 101.26 106.19 [3,] 103.07 101.24 98.98 97.39 97.82 98.07 98.98 99.35 99.53 101.44 106.94 [4,] 103.71 101.33 99.10 97.65 98.01 98.86 99.52 99.62 99.88 101.67 108.41 [5,] 103.93 101.33 99.10 97.94 98.05 99.05 100.00 99.87 99.88 101.67 108.51 [,12] [,13] [,14] [,15] [1,] 108.92 107.36 108.37 109.160 [2,] 108.97 107.94 108.37 109.160 [3,] 109.01 107.99 108.61 109.355 [4,] 109.25 108.54 108.77 109.550 [5,] 109.25 108.86 109.02 109.550 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.4977 101.0634 98.74682 97.17802 97.67868 97.29981 98.48538 98.77059 [2,] 103.6423 101.4166 99.21318 97.60198 97.96132 98.84019 99.47462 99.92941 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [1,] 99.26856 101.1503 105.3714 108.8122 107.566 108.3274 108.9193 [2,] 99.79144 101.7297 108.5086 109.2078 108.414 108.8926 109.7907 $out [1] 101.54 102.13 100.58 99.87 98.05 100.64 102.93 109.97 107.15 $group [1] 1 2 2 3 3 9 10 12 14 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" NA Warning message: In bxp(list(stats = c(102.9, 102.9, 103.07, 103.71, 103.93, 101.08, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7apwa1457085574.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,] 102.0250 100.375 102.4575 [2,] 102.1036 100.440 102.6188 [3,] 102.2007 100.610 102.6688 [4,] 102.4813 100.850 102.7313 [5,] 102.5873 101.080 102.8775 $n [1] 5 5 5 $conf [,1] [,2] [,3] [1,] 101.9338 100.3203 102.5893 [2,] 102.4676 100.8997 102.7482 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(102.025, 102.103571428571, 102.200714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yg571457085574.ps tmp/1yg571457085574.png",intern=TRUE)) character(0) > try(system("convert tmp/22l3r1457085574.ps tmp/22l3r1457085574.png",intern=TRUE)) character(0) > try(system("convert tmp/347fd1457085574.ps tmp/347fd1457085574.png",intern=TRUE)) character(0) > try(system("convert tmp/40bcq1457085574.ps tmp/40bcq1457085574.png",intern=TRUE)) character(0) > try(system("convert tmp/50ghv1457085574.ps tmp/50ghv1457085574.png",intern=TRUE)) character(0) > try(system("convert tmp/64akt1457085574.ps tmp/64akt1457085574.png",intern=TRUE)) character(0) > try(system("convert tmp/7apwa1457085574.ps tmp/7apwa1457085574.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.139 0.425 2.584