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(92.94,92.97,93.37,92.6,92.84,92.55,92.93,92.44,93.36,93.24,92.65,92.06,92.88,91.69,91.66,90.26,91.11,92.33,91.82,92.24,93.35,93.53,93.34,92.59,92.42,92.64,94.44,93.59,93.39,93.33,93.72,95.43,97.06,97.7,97.59,96.97,97.75,99.27,100.63,99.8,99.5,99.72,99.77,100.18,101.11,100.67,101.13,100.46,101.6,102.3,103.26,104.56,104.61,104.62,105.03,104.93,104.73,104.33,104.6,104.41,104.63,105.55,106.12,106.62,106.72,106.52,106.79,106.95,106.92,106.74,108.13,107.86) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 92.94 92.88 92.42 97.75 101.60 104.63 NA [2,] 92.97 91.69 92.64 99.27 102.30 105.55 NA [3,] 93.37 91.66 94.44 100.63 103.26 106.12 NA [4,] 92.60 90.26 93.59 99.80 104.56 106.62 NA [5,] 92.84 91.11 93.39 99.50 104.61 106.72 NA [6,] 92.55 92.33 93.33 99.72 104.62 106.52 NA [7,] 92.93 91.82 93.72 99.77 105.03 106.79 NA [8,] 92.44 92.24 95.43 100.18 104.93 106.95 NA [9,] 93.36 93.35 97.06 101.11 104.73 106.92 NA [10,] 93.24 93.53 97.70 100.67 104.33 106.74 NA [11,] 92.65 93.34 97.59 101.13 104.60 108.13 NA [12,] 92.06 92.59 96.97 100.46 104.41 107.86 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.03 -1.19 0.22 1.52 0.70 0.92 NA [2,] 0.40 -0.03 1.80 1.36 0.96 0.57 NA [3,] -0.77 -1.40 -0.85 -0.83 1.30 0.50 NA [4,] 0.24 0.85 -0.20 -0.30 0.05 0.10 NA [5,] -0.29 1.22 -0.06 0.22 0.01 -0.20 NA [6,] 0.38 -0.51 0.39 0.05 0.41 0.27 NA [7,] -0.49 0.42 1.71 0.41 -0.10 0.16 NA [8,] 0.92 1.11 1.63 0.93 -0.20 -0.03 NA [9,] -0.12 0.18 0.64 -0.44 -0.40 -0.18 NA [10,] -0.59 -0.19 -0.11 0.46 0.27 1.39 NA [11,] -0.59 -0.75 -0.62 -0.67 -0.19 -0.27 NA [12,] 0.82 -0.17 0.78 1.14 0.22 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/133nj1457183225.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/2tmoe1457183225.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/3ar6w1457183225.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/4arvf1457183225.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] [1,] 92.420 91.69 91.660 90.260 91.110 92.330 91.820 92.240 93.350 [2,] 92.880 92.64 93.370 92.600 92.840 92.550 92.930 92.440 93.360 [3,] 95.345 96.12 97.535 96.695 96.445 96.525 96.745 97.805 99.085 [4,] 101.600 102.30 103.260 104.560 104.610 104.620 105.030 104.930 104.730 [5,] 104.630 105.55 106.120 106.620 106.720 106.520 106.790 106.950 106.920 [,10] [,11] [,12] [1,] 93.240 92.65 92.060 [2,] 93.530 93.34 92.590 [3,] 99.185 99.36 98.715 [4,] 104.330 104.60 104.410 [5,] 106.740 108.13 107.860 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.72032 89.88899 91.15563 88.98041 88.85297 88.73946 88.94011 [2,] 100.96968 102.35101 103.91437 104.40959 104.03703 104.31054 104.54989 [,8] [,9] [,10] [,11] [,12] [1,] 89.74855 91.75098 92.21865 92.09694 91.09072 [2,] 105.86145 106.41902 106.15135 106.62306 106.33928 $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(92.42, 92.88, 95.345, 101.6, 104.63, 91.69, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5odkg1457183225.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] [1,] -1.19 -0.030 -1.40 -0.300 -0.290 0.050 -0.490 -0.200 -0.44 -0.59 -0.750 [2,] 0.03 0.400 -0.85 -0.200 -0.200 0.050 -0.100 -0.030 -0.40 -0.19 -0.670 [3,] 0.46 0.765 -0.80 0.075 -0.025 0.325 0.285 0.925 -0.15 0.08 -0.605 [4,] 0.92 1.360 0.50 0.240 0.220 0.390 0.420 1.110 0.18 0.46 -0.270 [5,] 1.52 1.800 1.30 0.850 0.220 0.410 0.420 1.630 0.64 1.39 -0.190 [,12] [1,] -0.17 [2,] 0.22 [3,] 0.78 [4,] 0.82 [5,] 1.14 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.1140787 0.145769 -1.6707936 -0.2088142 -0.2959136 0.105689 -0.0504168 [2,] 1.0340787 1.384231 0.0707936 0.3588142 0.2459136 0.544311 0.6204168 [,8] [,9] [,10] [,11] [,12] [1,] 0.1896632 -0.5241187 -0.339271 -0.8630129 0.3560415 [2,] 1.6603368 0.2241187 0.499271 -0.3469871 1.2039585 $out [1] 1.22 -0.51 1.71 $group [1] 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.19, 0.0300000000000011, 0.460000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6j90y1457183225.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] [1,] 92.060 90.260 92.420 99.27 103.260 105.550 NA [2,] 92.575 91.675 93.360 99.61 103.795 106.320 NA [3,] 92.885 92.285 94.080 99.99 104.580 106.730 NA [4,] 93.105 93.110 97.015 100.65 104.675 106.935 NA [5,] 93.370 93.530 97.700 101.13 105.030 106.950 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 92.64326 91.63049 92.41293 99.51565 104.1786 106.4495 NA [2,] 93.12674 92.93951 95.74707 100.46435 104.9814 107.0105 NA $out [1] 97.75 101.60 102.30 104.63 108.13 107.86 $group [1] 4 5 5 6 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(92.06, 92.575, 92.885, 93.105, 93.37, 90.26, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7w5do1457183225.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,] 97.03667 95.345 97.13250 [2,] 97.96667 96.485 98.08937 [3,] 98.29500 97.140 98.28813 [4,] 99.21333 98.900 98.77375 [5,] 99.57333 99.360 99.06750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.72639 96.0385 97.97598 [2,] 98.86361 98.2415 98.60027 $out [1] 96.76625 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.0366666666667, 97.9666666666667, 98.295, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/133nj1457183225.ps tmp/133nj1457183225.png",intern=TRUE)) character(0) > try(system("convert tmp/2tmoe1457183225.ps tmp/2tmoe1457183225.png",intern=TRUE)) character(0) > try(system("convert tmp/3ar6w1457183225.ps tmp/3ar6w1457183225.png",intern=TRUE)) character(0) > try(system("convert tmp/4arvf1457183225.ps tmp/4arvf1457183225.png",intern=TRUE)) character(0) > try(system("convert tmp/5odkg1457183225.ps tmp/5odkg1457183225.png",intern=TRUE)) character(0) > try(system("convert tmp/6j90y1457183225.ps tmp/6j90y1457183225.png",intern=TRUE)) character(0) > try(system("convert tmp/7w5do1457183225.ps tmp/7w5do1457183225.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.408 0.379 2.810