R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(71.83,71.39,73.71,74.13,74.45,74.95,75.09,75.23,76.11,76.64,76.97,78.23,77.15,76.33,70.19,68.42,66.49,63.41,62.92,65.53,65.26,68.25,74.39,78.71,82.15,86.05,89.46,89.32,88.94,93.35,94.72,96.11,104.06,104.11,103.9,110.75,110.82,107.59,96.03,95.69,90.63,75.87,75.57,78.78,74.93,75.85,75.49,76.87,78.18,79.37,80.59,81.18,81.02,82.75,83.63,85.35,90.52,90.66,90.69,92.56,92.87,93.82,96.32,96.03,96.53,102.96,102.38,102.66,106.83,106.5,106.78,108.49,108.77,110.43,110.84,110.52,110.11,109.42,109.06,108.98,108.36,108.11,108.44,107.76,106.27,101.07,100.79,100.97,99.33,99.35,99.23,98.14,98.17,98.48,99,99.19,99.1,100.13,100.07,95.26,94.72,94.25,89.46,88.38,88.57,93.82,93.94,93.92) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 71.83 77.15 82.15 110.82 78.18 92.87 108.77 106.27 99.10 NA [2,] 71.39 76.33 86.05 107.59 79.37 93.82 110.43 101.07 100.13 NA [3,] 73.71 70.19 89.46 96.03 80.59 96.32 110.84 100.79 100.07 NA [4,] 74.13 68.42 89.32 95.69 81.18 96.03 110.52 100.97 95.26 NA [5,] 74.45 66.49 88.94 90.63 81.02 96.53 110.11 99.33 94.72 NA [6,] 74.95 63.41 93.35 75.87 82.75 102.96 109.42 99.35 94.25 NA [7,] 75.09 62.92 94.72 75.57 83.63 102.38 109.06 99.23 89.46 NA [8,] 75.23 65.53 96.11 78.78 85.35 102.66 108.98 98.14 88.38 NA [9,] 76.11 65.26 104.06 74.93 90.52 106.83 108.36 98.17 88.57 NA [10,] 76.64 68.25 104.11 75.85 90.66 106.50 108.11 98.48 93.82 NA [11,] 76.97 74.39 103.90 75.49 90.69 106.78 108.44 99.00 93.94 NA [12,] 78.23 78.71 110.75 76.87 92.56 108.49 107.76 99.19 93.92 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -0.44 -0.82 3.90 -3.23 1.19 0.95 1.66 -5.20 1.03 NA [2,] 2.32 -6.14 3.41 -11.56 1.22 2.50 0.41 -0.28 -0.06 NA [3,] 0.42 -1.77 -0.14 -0.34 0.59 -0.29 -0.32 0.18 -4.81 NA [4,] 0.32 -1.93 -0.38 -5.06 -0.16 0.50 -0.41 -1.64 -0.54 NA [5,] 0.50 -3.08 4.41 -14.76 1.73 6.43 -0.69 0.02 -0.47 NA [6,] 0.14 -0.49 1.37 -0.30 0.88 -0.58 -0.36 -0.12 -4.79 NA [7,] 0.14 2.61 1.39 3.21 1.72 0.28 -0.08 -1.09 -1.08 NA [8,] 0.88 -0.27 7.95 -3.85 5.17 4.17 -0.62 0.03 0.19 NA [9,] 0.53 2.99 0.05 0.92 0.14 -0.33 -0.25 0.31 5.25 NA [10,] 0.33 6.14 -0.21 -0.36 0.03 0.28 0.33 0.52 0.12 NA [11,] 1.26 4.32 6.85 1.38 1.87 1.71 -0.68 0.19 -0.02 NA [12,] -1.08 3.44 0.07 1.31 0.31 0.28 -1.49 -0.09 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/1vnks1445116241.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/2sz3h1445116241.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/37lsw1445116241.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/4nks41445116241.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] [1,] 71.83 71.39 70.19 68.42 66.49 63.41 62.92 65.53 65.26 68.25 [2,] 78.18 79.37 80.59 81.18 81.02 75.87 75.57 78.78 76.11 76.64 [3,] 92.87 93.82 96.03 95.26 90.63 93.35 89.46 88.38 90.52 93.82 [4,] 106.27 101.07 100.07 96.03 96.53 99.35 99.23 98.14 104.06 104.11 [5,] 110.82 110.43 110.84 110.52 110.11 109.42 109.06 108.98 108.36 108.11 [,11] [,12] [1,] 74.39 76.87 [2,] 76.97 78.71 [3,] 93.94 93.92 [4,] 103.90 107.76 [5,] 108.44 110.75 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 78.07593 82.39133 85.77053 87.439 82.4614 80.98387 76.99907 78.18373 [2,] 107.66407 105.24867 106.28947 103.081 98.7986 105.71613 101.92093 98.57627 [,9] [,10] [,11] [,12] [1,] 75.79967 79.35247 79.75687 78.62033 [2,] 105.24033 108.28753 108.12313 109.21967 $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(71.83, 78.18, 92.87, 106.27, 110.82, 71.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ob201445116241.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,] -3.23 -0.28 -0.34 -1.93 -3.08 -0.58 -1.09 -3.85 -0.33 -0.36 -0.68 -1.490 [2,] -0.82 -0.28 -0.34 -1.64 -0.69 -0.49 -0.08 -0.27 0.05 0.03 0.19 -0.585 [3,] 0.95 0.41 -0.29 -0.41 0.02 -0.30 0.28 0.19 0.31 0.28 1.38 0.175 [4,] 1.19 2.32 0.18 -0.16 1.73 0.14 1.72 4.17 0.92 0.33 1.87 0.810 [5,] 3.90 3.41 0.59 0.50 4.41 0.88 3.21 7.95 0.92 0.52 4.32 1.310 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.1086 -0.9593333 -0.56386667 -1.1894667 -1.254533 -0.6318 -0.668 -2.1484 [2,] 2.0086 1.7793333 -0.01613333 0.3694667 1.294533 0.0318 1.228 2.5284 [,9] [,10] [,11] [,12] [1,] -0.1482 0.122 0.4952 -0.604267 [2,] 0.7682 0.438 2.2648 0.954267 $out [1] -5.20 -6.14 -11.56 -1.77 -4.81 -5.06 -14.76 6.43 1.37 -4.79 [11] 2.99 5.25 6.14 6.85 3.44 $group [1] 1 2 2 3 3 4 5 5 6 6 9 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3.22999999999999, -0.820000000000007, 0.949999999999989, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6u2r31445116241.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] [1,] 71.390 62.920 82.150 74.930 78.180 92.870 107.76 98.14 88.380 NA [2,] 73.920 65.395 89.130 75.710 80.805 96.175 108.40 98.74 91.640 NA [3,] 75.020 68.335 94.035 77.825 83.190 102.520 109.02 99.28 94.095 NA [4,] 76.375 75.360 103.980 95.860 90.590 106.640 110.27 100.88 97.180 NA [5,] 78.230 78.710 110.750 110.820 92.560 108.490 110.84 101.07 100.130 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73.90026 63.7899 87.26182 68.63445 78.727 97.74684 108.1671 98.30393 [2,] 76.13974 72.8801 100.80818 87.01555 87.653 107.29316 109.8729 100.25607 [,9] [,10] [1,] 91.56817 NA [2,] 96.62183 NA $out [1] 106.27 $group [1] 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(71.39, 73.92, 75.02, 76.375, 78.23, 62.92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7hs7d1445116241.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,] 88.00667 88.380 87.4000 [2,] 88.96556 90.575 88.5325 [3,] 90.60056 93.585 90.1525 [4,] 91.85111 93.930 90.4050 [5,] 94.05333 96.030 92.2250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 89.28443 92.05476 89.29844 [2,] 91.91668 95.11524 91.00656 $out [1] 93.235 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(88.0066666666667, 88.9655555555556, 90.6005555555556, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vnks1445116241.ps tmp/1vnks1445116241.png",intern=TRUE)) character(0) > try(system("convert tmp/2sz3h1445116241.ps tmp/2sz3h1445116241.png",intern=TRUE)) character(0) > try(system("convert tmp/37lsw1445116241.ps tmp/37lsw1445116241.png",intern=TRUE)) character(0) > try(system("convert tmp/4nks41445116241.ps tmp/4nks41445116241.png",intern=TRUE)) character(0) > try(system("convert tmp/5ob201445116241.ps tmp/5ob201445116241.png",intern=TRUE)) character(0) > try(system("convert tmp/6u2r31445116241.ps tmp/6u2r31445116241.png",intern=TRUE)) character(0) > try(system("convert tmp/7hs7d1445116241.ps tmp/7hs7d1445116241.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.449 0.502 2.973