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(94.65,94.16,93.91,93.21,92.81,93.55,93.03,93.25,94.24,93.23,93.52,92.05,93.42,95.15,95.12,95.46,94.92,95.63,94.96,95.1,95.22,93.77,95.01,94.87,95.01,96.68,94.94,93.9,94.83,96.27,96.51,96.69,97.47,96.41,98.68,99.3,99.22,99.7,98,98.51,98.6,98.14,99.14,98.25,99.72,99.23,101.32,101.07,101.66,103.09,102.3,100.01,98.78,99.46,99.73,99.52,98.97,97.97,99.37,99.14,99.89,100.29,99.57,101.11,101.44,100.81,101.26,99.86,100.57,100.35,101.15,101.33,102.09,101.79,102.83,102.5,102.22,102.43,102.89,102.12,103.25,103.36,103.5,103.68) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 94.65 93.42 95.01 99.22 101.66 99.89 102.09 NA [2,] 94.16 95.15 96.68 99.70 103.09 100.29 101.79 NA [3,] 93.91 95.12 94.94 98.00 102.30 99.57 102.83 NA [4,] 93.21 95.46 93.90 98.51 100.01 101.11 102.50 NA [5,] 92.81 94.92 94.83 98.60 98.78 101.44 102.22 NA [6,] 93.55 95.63 96.27 98.14 99.46 100.81 102.43 NA [7,] 93.03 94.96 96.51 99.14 99.73 101.26 102.89 NA [8,] 93.25 95.10 96.69 98.25 99.52 99.86 102.12 NA [9,] 94.24 95.22 97.47 99.72 98.97 100.57 103.25 NA [10,] 93.23 93.77 96.41 99.23 97.97 100.35 103.36 NA [11,] 93.52 95.01 98.68 101.32 99.37 101.15 103.50 NA [12,] 92.05 94.87 99.30 101.07 99.14 101.33 103.68 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.49 1.73 1.67 0.48 1.43 0.40 -0.30 NA [2,] -0.25 -0.03 -1.74 -1.70 -0.79 -0.72 1.04 NA [3,] -0.70 0.34 -1.04 0.51 -2.29 1.54 -0.33 NA [4,] -0.40 -0.54 0.93 0.09 -1.23 0.33 -0.28 NA [5,] 0.74 0.71 1.44 -0.46 0.68 -0.63 0.21 NA [6,] -0.52 -0.67 0.24 1.00 0.27 0.45 0.46 NA [7,] 0.22 0.14 0.18 -0.89 -0.21 -1.40 -0.77 NA [8,] 0.99 0.12 0.78 1.47 -0.55 0.71 1.13 NA [9,] -1.01 -1.45 -1.06 -0.49 -1.00 -0.22 0.11 NA [10,] 0.29 1.24 2.27 2.09 1.40 0.80 0.14 NA [11,] -1.47 -0.14 0.62 -0.25 -0.23 0.18 0.18 NA [12,] 1.37 0.14 -0.08 0.59 0.75 0.76 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/10axw1457085570.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/2bx7v1457085570.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/3fo171457085570.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/4hy7j1457085570.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,] 93.420 94.160 93.910 93.21 92.810 93.550 93.030 93.250 94.240 [2,] 94.830 95.915 95.030 94.68 94.875 95.950 95.735 95.895 96.345 [3,] 99.220 99.700 98.000 98.51 98.600 98.140 99.140 98.250 98.970 [4,] 100.775 101.040 100.935 100.56 100.110 100.135 100.495 99.690 100.145 [5,] 102.090 103.090 102.830 102.50 102.220 102.430 102.890 102.120 103.250 [,10] [,11] [,12] [1,] 93.23 93.520 92.050 [2,] 95.09 96.845 97.005 [3,] 97.97 99.370 99.300 [4,] 99.79 101.235 101.200 [5,] 103.36 103.500 103.680 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.66974 96.63943 94.47363 94.99856 95.47374 95.64079 96.2974 [2,] 102.77026 102.76057 101.52637 102.02144 101.72626 100.63921 101.9826 [,8] [,9] [,10] [,11] [,12] [1,] 95.98369 96.7007 95.16324 96.74836 96.79481 [2,] 100.51631 101.2393 100.77676 101.99164 101.80519 $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(93.42, 94.83, 99.22, 100.775, 102.09, 94.16, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56vhu1457085570.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,] -0.49 -1.740 -2.290 -1.23 -0.630 -0.670 -1.40 -0.550 -1.450 0.140 -0.25 [2,] 0.05 -1.245 -0.870 -0.47 -0.125 -0.140 -0.83 0.415 -1.035 0.545 -0.24 [3,] 0.48 -0.720 -0.330 -0.28 0.680 0.270 -0.21 0.780 -1.000 1.240 -0.14 [4,] 1.55 -0.140 0.425 0.21 0.725 0.455 0.16 1.060 -0.355 1.745 0.18 [5,] 1.73 1.040 1.540 0.93 1.440 1.000 0.22 1.470 0.110 2.270 0.62 [,12] [1,] -0.08 [2,] 0.14 [3,] 0.67 [4,] 0.76 [5,] 1.37 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.4157758 -1.37988817 -1.1033531 -0.686085 0.1723937 -0.0853244 -0.801212 [2,] 1.3757758 -0.06011183 0.4433531 0.126085 1.1876063 0.6253244 0.381212 [,8] [,9] [,10] [,11] [,12] [1,] 0.3948164 -1.406085 0.5233794 -0.3908172 0.27008 [2,] 1.1651836 -0.593915 1.9566206 0.1108172 1.06992 $out [1] -1.47 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.490000000000009, 0.0500000000000043, 0.480000000000004, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dd841457085570.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] [1,] 92.050 94.870 93.900 98.00 97.970 99.570 101.790 NA [2,] 93.120 94.895 94.975 98.38 99.055 100.090 102.170 NA [3,] 93.385 95.055 96.460 99.18 99.490 100.690 102.665 NA [4,] 94.035 95.185 97.080 99.71 100.835 101.205 103.305 NA [5,] 94.650 95.460 99.300 101.32 103.090 101.440 103.680 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 92.96766 94.92273 95.4999 98.57338 98.67813 100.1814 102.1473 NA [2,] 93.80234 95.18727 97.4201 99.78662 100.30187 101.1986 103.1827 NA $out [1] 93.42 95.63 93.77 $group [1] 2 2 2 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(92.05, 93.12, 93.385, 94.035, 94.65, 94.87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7g1ly1457085570.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.65714 97.970 97.44000 [2,] 97.82071 98.195 97.70625 [3,] 98.06857 98.785 98.01250 [4,] 98.59286 99.260 98.36125 [5,] 98.93571 99.700 99.10250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.71639 98.29925 97.71375 [2,] 98.42075 99.27075 98.31125 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.6571428571429, 97.8207142857143, 98.0685714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10axw1457085570.ps tmp/10axw1457085570.png",intern=TRUE)) character(0) > try(system("convert tmp/2bx7v1457085570.ps tmp/2bx7v1457085570.png",intern=TRUE)) character(0) > try(system("convert tmp/3fo171457085570.ps tmp/3fo171457085570.png",intern=TRUE)) character(0) > try(system("convert tmp/4hy7j1457085570.ps tmp/4hy7j1457085570.png",intern=TRUE)) character(0) > try(system("convert tmp/56vhu1457085570.ps tmp/56vhu1457085570.png",intern=TRUE)) character(0) > try(system("convert tmp/6dd841457085570.ps tmp/6dd841457085570.png",intern=TRUE)) character(0) > try(system("convert tmp/7g1ly1457085570.ps tmp/7g1ly1457085570.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.206 0.349 2.585