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(100.71,100.75,100.75,100.70,100.77,100.44,100.17,100.21,100.27,100.29,100.33,100.35,100.94,101.07,101.01,100.86,100.71,99.95,100.02,100.03,100.04,99.73,99.76,99.83,100.08,99.35,99.43,99.53,99.03,99.05,99.07,99.23,99.03,99.06,99.13,99.14,100.91,100.97,100.55,100.68,100.31,100.31,99.28,99.24,99.29,99.27,99.26,99.25,99.57,98.97,99.00,98.88,98.90,98.92,98.80,98.83,98.88,98.88,98.89,98.89,99.05,99.20,99.13,98.92,98.98,98.99,99.08,99.10,99.10,99.06,99.05,99.11,99.75,99.80,99.95,99.69,99.55,99.14,99.05,99.00,99.03,99.16,99.01,99.00,99.90,100.18,100.20,100.13,99.85,99.88,99.88,99.89,99.96,100.05,100.04,100.06,99.72,99.70,99.63,99.73,99.77,99.76,99.61,99.61,99.59,99.42,99.52,99.46) > 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,] 100.71 100.94 100.08 100.91 99.57 99.05 99.75 99.90 99.72 NA [2,] 100.75 101.07 99.35 100.97 98.97 99.20 99.80 100.18 99.70 NA [3,] 100.75 101.01 99.43 100.55 99.00 99.13 99.95 100.20 99.63 NA [4,] 100.70 100.86 99.53 100.68 98.88 98.92 99.69 100.13 99.73 NA [5,] 100.77 100.71 99.03 100.31 98.90 98.98 99.55 99.85 99.77 NA [6,] 100.44 99.95 99.05 100.31 98.92 98.99 99.14 99.88 99.76 NA [7,] 100.17 100.02 99.07 99.28 98.80 99.08 99.05 99.88 99.61 NA [8,] 100.21 100.03 99.23 99.24 98.83 99.10 99.00 99.89 99.61 NA [9,] 100.27 100.04 99.03 99.29 98.88 99.10 99.03 99.96 99.59 NA [10,] 100.29 99.73 99.06 99.27 98.88 99.06 99.16 100.05 99.42 NA [11,] 100.33 99.76 99.13 99.26 98.89 99.05 99.01 100.04 99.52 NA [12,] 100.35 99.83 99.14 99.25 98.89 99.11 99.00 100.06 99.46 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.04 0.13 -0.73 0.06 -0.60 0.15 0.05 0.28 -0.02 NA [2,] 0.00 -0.06 0.08 -0.42 0.03 -0.07 0.15 0.02 -0.07 NA [3,] -0.05 -0.15 0.10 0.13 -0.12 -0.21 -0.26 -0.07 0.10 NA [4,] 0.07 -0.15 -0.50 -0.37 0.02 0.06 -0.14 -0.28 0.04 NA [5,] -0.33 -0.76 0.02 0.00 0.02 0.01 -0.41 0.03 -0.01 NA [6,] -0.27 0.07 0.02 -1.03 -0.12 0.09 -0.09 0.00 -0.15 NA [7,] 0.04 0.01 0.16 -0.04 0.03 0.02 -0.05 0.01 0.00 NA [8,] 0.06 0.01 -0.20 0.05 0.05 0.00 0.03 0.07 -0.02 NA [9,] 0.02 -0.31 0.03 -0.02 0.00 -0.04 0.13 0.09 -0.17 NA [10,] 0.04 0.03 0.07 -0.01 0.01 -0.01 -0.15 -0.01 0.10 NA [11,] 0.02 0.07 0.01 -0.01 0.00 0.06 -0.01 0.02 -0.06 NA [12,] 0.59 0.25 1.77 0.32 0.16 0.64 0.90 -0.34 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/1nlj21445718131.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/2836n1445718131.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/3f2yl1445718131.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/4h4281445718131.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,] 99.05 98.97 99.00 98.88 98.90 98.92 98.80 98.83 98.88 98.88 [2,] 99.72 99.35 99.43 99.53 99.03 99.05 99.07 99.10 99.03 99.06 [3,] 99.90 99.80 99.95 99.73 99.77 99.76 99.28 99.24 99.29 99.27 [4,] 100.71 100.75 100.55 100.68 100.31 99.95 99.88 99.89 99.96 99.73 [5,] 100.94 101.07 101.01 100.86 100.77 100.44 100.17 100.21 100.27 100.29 [,11] [,12] [1,] 98.89 98.89 [2,] 99.05 99.11 [3,] 99.26 99.25 [4,] 99.76 99.83 [5,] 100.33 100.35 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 99.3786 99.06267 99.36013 99.12433 99.09587 99.286 98.8534 98.82393 [2,] 100.4214 100.53733 100.53987 100.33567 100.44413 100.234 99.7066 99.65607 [,9] [,10] [,11] [,12] [1,] 98.8002 98.91713 98.88607 98.8708 [2,] 99.7798 99.62287 99.63393 99.6292 $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(99.05, 99.72, 99.9, 100.71, 100.94, 98.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b73p1445718131.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.02 -0.07 -0.26 -0.50 -0.76 -0.27 -0.04 -0.02 -0.04 -0.01 -0.01 -0.340 [2,] -0.02 -0.07 -0.15 -0.28 -0.33 -0.15 0.00 0.00 -0.04 -0.01 -0.01 0.205 [3,] 0.05 0.00 -0.07 -0.14 0.00 -0.09 0.01 0.03 0.00 0.01 0.01 0.455 [4,] 0.13 0.03 0.10 0.04 0.02 0.02 0.03 0.05 0.03 0.04 0.02 0.770 [5,] 0.28 0.15 0.13 0.07 0.03 0.09 0.04 0.07 0.13 0.10 0.06 0.900 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.029 -0.05266667 -0.20166667 -0.30853333 -0.1843333 -0.1795333333 [2,] 0.129 0.05266667 0.06166667 0.02853333 0.1843333 -0.0004666667 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.0058 0.003666667 -0.03686667 -0.01633333 -0.0058 0.1393829 [2,] 0.0258 0.056333333 0.03686667 0.03633333 0.0258 0.7706171 $out [1] -0.73 -0.60 -0.42 -1.03 0.16 -0.05 -0.20 -0.31 -0.17 -0.15 0.07 -0.06 [13] 1.77 $group [1] 1 1 2 6 7 7 8 9 9 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.019999999999996, -0.019999999999996, 0.0499999999999972, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6j0ui1445718131.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,] 100.170 99.730 99.030 99.240 98.800 98.920 99.00 99.850 99.420 NA [2,] 100.280 99.890 99.055 99.265 98.880 99.020 99.02 99.885 99.555 NA [3,] 100.395 100.035 99.135 99.800 98.890 99.070 99.15 100.000 99.620 NA [4,] 100.730 100.900 99.390 100.615 98.945 99.105 99.72 100.095 99.725 NA [5,] 100.770 101.070 99.530 100.970 99.000 99.200 99.95 100.200 99.770 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.1898 99.57433 98.9822 99.18426 98.86035 99.03123 98.83073 99.90422 [2,] 100.6002 100.49567 99.2878 100.41574 98.91965 99.10877 99.46927 100.09578 [,9] [,10] [1,] 99.54246 NA [2,] 99.69754 NA $out [1] 100.08 99.57 $group [1] 3 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(100.17, 100.28, 100.395, 100.73, 100.77, 99.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/786nf1445718131.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,] 99.43556 99.240 99.3950 [2,] 99.44889 99.265 99.4725 [3,] 99.53500 99.510 99.4975 [4,] 99.93167 99.785 100.0200 [5,] 100.07000 99.950 100.2150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.3148 99.27282 99.24778 [2,] 99.7552 99.74718 99.74722 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(99.4355555555556, 99.4488888888889, 99.535, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nlj21445718131.ps tmp/1nlj21445718131.png",intern=TRUE)) character(0) > try(system("convert tmp/2836n1445718131.ps tmp/2836n1445718131.png",intern=TRUE)) character(0) > try(system("convert tmp/3f2yl1445718131.ps tmp/3f2yl1445718131.png",intern=TRUE)) character(0) > try(system("convert tmp/4h4281445718131.ps tmp/4h4281445718131.png",intern=TRUE)) character(0) > try(system("convert tmp/5b73p1445718131.ps tmp/5b73p1445718131.png",intern=TRUE)) character(0) > try(system("convert tmp/6j0ui1445718131.ps tmp/6j0ui1445718131.png",intern=TRUE)) character(0) > try(system("convert tmp/786nf1445718131.ps tmp/786nf1445718131.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.542 0.429 2.991