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(84.71,85.17,84.93,85.1,85.19,85.38,85.95,86.04,85.68,85.79,85.79,86.05,86.14,86.82,86.93,87.03,87.13,87.09,87.65,87.6,87.03,87.12,87.08,87.56,87.31,87.89,88.2,87.7,88.19,88.65,89.48,89.65,89.34,89.73,89.77,90.26,90.03,91.09,90.94,91.03,91.14,91.51,91.99,91.91,91.8,91.8,91.44,91.83,91.46,92.17,91.91,92.06,92.33,92.73,93.35,93.28,93.22,93.31,93.21,93.14,93.82,94.18,94.44,94.35,94.38,94.72,95.25,95.16,94.9,95.09,95.22,95.39,96.57,97.05,97.11,97.08,97.5,97.92,98.44,98.44,98.06,98.2,98.19,98.36,98.41,98.97,99.45,98.95,99.7,100.12,100.62,100.75,100.47,100.71,100.85,101.03,101.13,101.38,101.73,101.89,102.02,102.11,102.77,102.49,102.52,102.69,102.32,102.6) > 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,] 84.71 86.14 87.31 90.03 91.46 93.82 96.57 98.41 101.13 NA [2,] 85.17 86.82 87.89 91.09 92.17 94.18 97.05 98.97 101.38 NA [3,] 84.93 86.93 88.20 90.94 91.91 94.44 97.11 99.45 101.73 NA [4,] 85.10 87.03 87.70 91.03 92.06 94.35 97.08 98.95 101.89 NA [5,] 85.19 87.13 88.19 91.14 92.33 94.38 97.50 99.70 102.02 NA [6,] 85.38 87.09 88.65 91.51 92.73 94.72 97.92 100.12 102.11 NA [7,] 85.95 87.65 89.48 91.99 93.35 95.25 98.44 100.62 102.77 NA [8,] 86.04 87.60 89.65 91.91 93.28 95.16 98.44 100.75 102.49 NA [9,] 85.68 87.03 89.34 91.80 93.22 94.90 98.06 100.47 102.52 NA [10,] 85.79 87.12 89.73 91.80 93.31 95.09 98.20 100.71 102.69 NA [11,] 85.79 87.08 89.77 91.44 93.21 95.22 98.19 100.85 102.32 NA [12,] 86.05 87.56 90.26 91.83 93.14 95.39 98.36 101.03 102.60 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.46 0.68 0.58 1.06 0.71 0.36 0.48 0.56 0.25 NA [2,] -0.24 0.11 0.31 -0.15 -0.26 0.26 0.06 0.48 0.35 NA [3,] 0.17 0.10 -0.50 0.09 0.15 -0.09 -0.03 -0.50 0.16 NA [4,] 0.09 0.10 0.49 0.11 0.27 0.03 0.42 0.75 0.13 NA [5,] 0.19 -0.04 0.46 0.37 0.40 0.34 0.42 0.42 0.09 NA [6,] 0.57 0.56 0.83 0.48 0.62 0.53 0.52 0.50 0.66 NA [7,] 0.09 -0.05 0.17 -0.08 -0.07 -0.09 0.00 0.13 -0.28 NA [8,] -0.36 -0.57 -0.31 -0.11 -0.06 -0.26 -0.38 -0.28 0.03 NA [9,] 0.11 0.09 0.39 0.00 0.09 0.19 0.14 0.24 0.17 NA [10,] 0.00 -0.04 0.04 -0.36 -0.10 0.13 -0.01 0.14 -0.37 NA [11,] 0.26 0.48 0.49 0.39 -0.07 0.17 0.17 0.18 0.28 NA [12,] 0.09 -0.25 -0.23 -0.37 0.68 1.18 0.05 0.10 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/15j8r1444994380.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/2lii21444994380.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/3hw0u1444994380.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/47zoj1444994380.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,] 84.71 85.17 84.93 85.10 85.19 85.38 85.95 86.04 85.68 85.79 [2,] 87.31 87.89 88.20 87.70 88.19 88.65 89.48 89.65 89.34 89.73 [3,] 91.46 92.17 91.91 92.06 92.33 92.73 93.35 93.28 93.22 93.31 [4,] 96.57 97.05 97.11 97.08 97.50 97.92 98.44 98.44 98.06 98.20 [5,] 101.13 101.38 101.73 101.89 102.02 102.11 102.77 102.49 102.52 102.69 [,11] [,12] [1,] 85.79 86.05 [2,] 89.77 90.26 [3,] 93.21 93.14 [4,] 98.19 98.36 [5,] 102.32 102.60 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.58307 87.34573 87.2174 87.11987 87.42673 87.8478 88.63107 88.6506 [2,] 96.33693 96.99427 96.6026 97.00013 97.23327 97.6122 98.06893 97.9094 [,9] [,10] [,11] [,12] [1,] 88.62747 88.84913 88.77547 88.874 [2,] 97.81253 97.77087 97.64453 97.406 $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(84.71, 87.31, 91.46, 96.57, 101.13, 85.17, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5750w1444994380.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.25 -0.26 -0.09 0.03 -0.04 0.48 -0.28 -0.57 0.00 -0.10 -0.07 -0.37 [2,] 0.46 -0.15 -0.09 0.10 0.19 0.52 -0.08 -0.36 0.09 -0.10 0.17 -0.24 [3,] 0.56 0.11 0.09 0.13 0.37 0.56 -0.05 -0.28 0.14 -0.01 0.26 0.07 [4,] 0.68 0.31 0.15 0.42 0.42 0.62 0.09 -0.11 0.19 0.04 0.39 0.39 [5,] 0.71 0.48 0.17 0.75 0.46 0.66 0.17 0.03 0.24 0.14 0.49 1.18 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.4441333 -0.1322667 -0.0364 -0.03853333 0.2488667 0.5073333 -0.13953333 [2,] 0.6758667 0.3522667 0.2164 0.29853333 0.4911333 0.6126667 0.03953333 [,8] [,9] [,10] [,11] [,12] [1,] -0.4116667 0.08733333 -0.08373333 0.1441333 -0.281927 [2,] -0.1483333 0.19266667 0.06373333 0.3758667 0.421927 $out [1] 1.06 -0.50 -0.50 0.83 0.39 -0.36 -0.37 $group [1] 1 3 3 6 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.25, 0.460000000000008, 0.560000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6e4ac1444994380.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,] 84.710 86.820 87.310 90.030 91.460 93.820 96.570 98.410 101.130 NA [2,] 85.135 86.980 88.040 91.060 92.115 94.365 97.095 99.210 101.810 NA [3,] 85.530 87.085 88.995 91.475 92.935 94.810 97.990 100.295 102.215 NA [4,] 85.870 87.345 89.690 91.815 93.250 95.190 98.280 100.730 102.560 NA [5,] 86.050 87.650 90.260 91.990 93.350 95.390 98.440 101.030 102.770 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.19476 86.91852 88.24242 91.13064 92.41732 94.43371 97.44951 99.60172 [2,] 85.86524 87.25148 89.74758 91.81936 93.45268 95.18629 98.53049 100.98828 [,9] [,10] [1,] 101.8729 NA [2,] 102.5571 NA $out [1] 86.14 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(84.71, 85.135, 85.53, 85.87, 86.05, 86.82, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7awst1444994380.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,] 92.17556 91.460 91.9400 [2,] 92.82389 92.115 92.5625 [3,] 93.51389 92.935 93.4925 [4,] 93.87556 93.250 93.9725 [5,] 94.02444 93.350 94.3100 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 93.03422 92.41732 92.84939 [2,] 93.99356 93.45268 94.13561 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(92.1755555555555, 92.8238888888889, 93.5138888888889, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15j8r1444994380.ps tmp/15j8r1444994380.png",intern=TRUE)) character(0) > try(system("convert tmp/2lii21444994380.ps tmp/2lii21444994380.png",intern=TRUE)) character(0) > try(system("convert tmp/3hw0u1444994380.ps tmp/3hw0u1444994380.png",intern=TRUE)) character(0) > try(system("convert tmp/47zoj1444994380.ps tmp/47zoj1444994380.png",intern=TRUE)) character(0) > try(system("convert tmp/5750w1444994380.ps tmp/5750w1444994380.png",intern=TRUE)) character(0) > try(system("convert tmp/6e4ac1444994380.ps tmp/6e4ac1444994380.png",intern=TRUE)) character(0) > try(system("convert tmp/7awst1444994380.ps tmp/7awst1444994380.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.505 0.426 2.966