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(105.95,108.55,110.81,111.54,110.38,106.67,106.45,105.44,105.37,103.72,106.57,108.54,110.36,106.64,103.45,101.36,101.9,100.86,100.37,100.16,99.5,99.52,99.2,99.35,99.37,99.85,99.76,100.07,99.77,99.93,99.16,99.4,99.81,99.67,99.37,99.49,99.28,99.33,99.19,98.11,99.12,99.06,97.41,98.45,100.33,103.18,103.06,103.48,102.8,103.92,103.9,103.96,103.62,103.83,104.09,104.07,103.22,104.01,104.01,104.24,102.93,104.73,106.48,119.5,122.45,125.29,126.56,126.38,127.95,128.23,128.7,127.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,] 105.95 110.36 99.37 99.28 102.80 102.93 NA [2,] 108.55 106.64 99.85 99.33 103.92 104.73 NA [3,] 110.81 103.45 99.76 99.19 103.90 106.48 NA [4,] 111.54 101.36 100.07 98.11 103.96 119.50 NA [5,] 110.38 101.90 99.77 99.12 103.62 122.45 NA [6,] 106.67 100.86 99.93 99.06 103.83 125.29 NA [7,] 106.45 100.37 99.16 97.41 104.09 126.56 NA [8,] 105.44 100.16 99.40 98.45 104.07 126.38 NA [9,] 105.37 99.50 99.81 100.33 103.22 127.95 NA [10,] 103.72 99.52 99.67 103.18 104.01 128.23 NA [11,] 106.57 99.20 99.37 103.06 104.01 128.70 NA [12,] 108.54 99.35 99.49 103.48 104.24 127.86 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.60 -3.72 0.48 0.05 1.12 1.80 NA [2,] 2.26 -3.19 -0.09 -0.14 -0.02 1.75 NA [3,] 0.73 -2.09 0.31 -1.08 0.06 13.02 NA [4,] -1.16 0.54 -0.30 1.01 -0.34 2.95 NA [5,] -3.71 -1.04 0.16 -0.06 0.21 2.84 NA [6,] -0.22 -0.49 -0.77 -1.65 0.26 1.27 NA [7,] -1.01 -0.21 0.24 1.04 -0.02 -0.18 NA [8,] -0.07 -0.66 0.41 1.88 -0.85 1.57 NA [9,] -1.65 0.02 -0.14 2.85 0.79 0.28 NA [10,] 2.85 -0.32 -0.30 -0.12 0.00 0.47 NA [11,] 1.97 0.15 0.12 0.42 0.23 -0.84 NA [12,] 1.82 0.02 -0.21 -0.68 -1.31 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/14uln1457468012.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/28npu1457468012.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/33yc61457468012.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/49p121457468012.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,] 99.280 99.330 99.190 98.11 99.12 99.060 97.41 98.450 99.500 [2,] 99.370 99.850 99.760 100.07 99.77 99.930 99.16 99.400 99.810 [3,] 102.865 104.325 103.675 102.66 102.76 102.345 102.23 102.115 101.775 [4,] 105.950 106.640 106.480 111.54 110.38 106.670 106.45 105.440 105.370 [5,] 110.360 108.550 110.810 119.50 122.45 106.670 106.45 105.440 105.370 [,10] [,11] [,12] [1,] 99.52 99.200 99.35 [2,] 99.67 99.370 99.49 [3,] 103.45 103.535 103.86 [4,] 104.01 106.570 108.54 [5,] 104.01 106.570 108.54 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.62069 99.94523 99.34038 95.26148 95.91621 97.99748 97.52771 [2,] 107.10931 108.70477 108.00962 110.05852 109.60379 106.69252 106.93229 [,8] [,9] [,10] [,11] [,12] [1,] 98.219 98.18862 100.6506 98.89077 98.02246 [2,] 106.011 105.36138 106.2494 108.17923 109.69754 $out [1] 125.29 126.56 126.38 127.95 128.23 128.70 127.86 $group [1] 6 7 8 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(99.28, 99.37, 102.865, 105.95, 110.36, 99.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ct791457468012.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.05 -0.140 -2.090 -1.16 -1.04 -1.650 -0.21 -0.85 -0.14 -0.32 0.12 -1.31 [2,] 0.05 -0.140 -1.080 -0.34 -1.04 -0.770 -0.21 -0.66 -0.14 -0.30 0.12 -0.68 [3,] 0.80 -0.055 0.185 0.12 0.05 -0.355 -0.10 0.17 0.15 -0.06 0.19 -0.21 [4,] 1.80 1.750 0.730 1.01 0.21 0.260 0.24 1.57 0.79 0.47 0.42 0.02 [5,] 2.60 2.260 0.730 2.95 0.21 1.270 0.24 1.88 0.79 0.47 0.42 0.02 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.3288065 -1.274111 -0.9825085 -0.7507936 -0.7562904 -1.0193833 [2,] 1.9288065 1.164111 1.3525085 0.9907936 0.8562904 0.3093833 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.3902645 -1.268422 -0.44988 -0.5566749 -0.00350969 -0.7046182 [2,] 0.1902645 1.608422 0.74988 0.4366749 0.38350969 0.2846182 $out [1] -3.72 -3.19 13.02 -3.71 2.84 -1.01 1.04 -1.65 2.85 2.85 1.97 -0.84 [13] 1.82 $group [1] 1 2 3 5 5 7 7 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.0499999999999972, 0.0499999999999972, 0.799999999999997, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jnfp1457468012.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,] 103.720 99.200 99.160 97.410 103.620 102.930 NA [2,] 105.695 99.510 99.385 98.755 103.725 112.990 NA [3,] 106.620 100.615 99.715 99.235 103.940 125.835 NA [4,] 109.465 102.675 99.830 101.695 104.040 127.905 NA [5,] 111.540 106.640 100.070 103.480 104.240 128.700 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 104.9005 99.17142 99.51203 97.89405 103.7963 119.0322 NA [2,] 108.3395 102.05858 99.91797 100.57595 104.0837 132.6378 NA $out [1] 110.36 102.80 103.22 $group [1] 2 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(103.72, 105.695, 106.62, 109.465, 111.54, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7kfwy1457468012.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,] 103.4483 101.7750 102.2425 [2,] 104.7908 102.2875 102.5238 [3,] 105.8483 102.8125 103.0863 [4,] 106.2975 103.6050 103.7456 [5,] 107.1600 104.3250 105.0187 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 105.1611 102.2116 102.5289 [2,] 106.5355 103.4134 103.6436 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(103.448333333333, 104.790833333333, 105.848333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14uln1457468012.ps tmp/14uln1457468012.png",intern=TRUE)) character(0) > try(system("convert tmp/28npu1457468012.ps tmp/28npu1457468012.png",intern=TRUE)) character(0) > try(system("convert tmp/33yc61457468012.ps tmp/33yc61457468012.png",intern=TRUE)) character(0) > try(system("convert tmp/49p121457468012.ps tmp/49p121457468012.png",intern=TRUE)) character(0) > try(system("convert tmp/5ct791457468012.ps tmp/5ct791457468012.png",intern=TRUE)) character(0) > try(system("convert tmp/6jnfp1457468012.ps tmp/6jnfp1457468012.png",intern=TRUE)) character(0) > try(system("convert tmp/7kfwy1457468012.ps tmp/7kfwy1457468012.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.646 0.475 3.146