R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(101.16,100.81,100.94,101.13,101.29,101.34,101.35,101.7,102.05,102.48,102.66,102.72,102.73,102.18,102.22,102.37,102.53,102.61,102.62,103,103.17,103.52,103.69,103.73,99.57,99.09,99.14,99.36,99.6,99.65,99.8,100.15,100.45,100.89,101.13,101.17,101.21,101.1,101.17,101.11,101.2,101.15,100.92,101.1,101.22,101.25,101.39,101.43,101.95,101.92,102.05,102.07,102.1,102.16,101.63,101.43,101.4,101.6,101.72,101.73,102.67,102.59,102.69,102.93,103.02,103.06,102.47,102.4,102.42,102.51,102.61,102.78) > 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,] 101.16 102.73 99.57 101.21 101.95 102.67 NA [2,] 100.81 102.18 99.09 101.10 101.92 102.59 NA [3,] 100.94 102.22 99.14 101.17 102.05 102.69 NA [4,] 101.13 102.37 99.36 101.11 102.07 102.93 NA [5,] 101.29 102.53 99.60 101.20 102.10 103.02 NA [6,] 101.34 102.61 99.65 101.15 102.16 103.06 NA [7,] 101.35 102.62 99.80 100.92 101.63 102.47 NA [8,] 101.70 103.00 100.15 101.10 101.43 102.40 NA [9,] 102.05 103.17 100.45 101.22 101.40 102.42 NA [10,] 102.48 103.52 100.89 101.25 101.60 102.51 NA [11,] 102.66 103.69 101.13 101.39 101.72 102.61 NA [12,] 102.72 103.73 101.17 101.43 101.73 102.78 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.35 -0.55 -0.48 -0.11 -0.03 -0.08 NA [2,] 0.13 0.04 0.05 0.07 0.13 0.10 NA [3,] 0.19 0.15 0.22 -0.06 0.02 0.24 NA [4,] 0.16 0.16 0.24 0.09 0.03 0.09 NA [5,] 0.05 0.08 0.05 -0.05 0.06 0.04 NA [6,] 0.01 0.01 0.15 -0.23 -0.53 -0.59 NA [7,] 0.35 0.38 0.35 0.18 -0.20 -0.07 NA [8,] 0.35 0.17 0.30 0.12 -0.03 0.02 NA [9,] 0.43 0.35 0.44 0.03 0.20 0.09 NA [10,] 0.18 0.17 0.24 0.14 0.12 0.10 NA [11,] 0.06 0.04 0.04 0.04 0.01 0.17 NA [12,] 0.01 -4.16 0.04 0.52 0.94 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/1fqp41495031759.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/2ahlf1495031759.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/3hcwf1495031759.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/457511495031759.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.57 99.09 99.14 99.36 99.600 99.65 99.80 100.150 100.450 100.89 [2,] 101.16 100.81 100.94 101.11 101.200 101.15 100.92 101.100 101.220 101.25 [3,] 101.58 101.51 101.61 101.60 101.695 101.75 101.49 101.565 101.725 102.04 [4,] 102.67 102.18 102.22 102.37 102.530 102.61 102.47 102.400 102.420 102.51 [5,] 102.73 102.59 102.69 102.93 103.020 103.06 102.62 103.000 103.170 103.52 [,11] [,12] [1,] 101.130 101.170 [2,] 101.390 101.430 [3,] 102.165 102.225 [4,] 102.660 102.780 [5,] 103.690 103.730 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.606 100.6263 100.7844 100.7873 100.8371 100.8083 100.4902 100.7265 [2,] 102.554 102.3937 102.4356 102.4127 102.5529 102.6917 102.4898 102.4035 [,9] [,10] [,11] [,12] [1,] 100.951 101.2273 101.3458 101.3542 [2,] 102.499 102.8527 102.9842 103.0958 $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.57, 101.16, 101.58, 102.67, 102.73, 99.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xgit1495031759.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.55 0.040 -0.06 0.030 0.04 -0.59 -0.200 -0.030 0.030 0.100 0.04 0.01 [2,] -0.48 0.050 0.02 0.090 0.04 -0.53 -0.070 0.020 0.090 0.120 0.04 0.01 [3,] -0.23 0.085 0.17 0.125 0.05 -0.11 0.265 0.145 0.275 0.155 0.04 0.04 [4,] -0.08 0.130 0.22 0.160 0.06 0.01 0.350 0.300 0.430 0.180 0.06 0.52 [5,] -0.03 0.130 0.24 0.240 0.08 0.15 0.380 0.350 0.440 0.240 0.06 0.94 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.48801292 0.03339742 0.04099354 0.07984774 0.03709935 -0.4583174 [2,] 0.02801292 0.13660258 0.29900646 0.17015226 0.06290065 0.2383174 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.005913566 -0.03560904 0.05568902 0.1162981 0.02709935 -0.3203647 [2,] 0.535913566 0.32560904 0.49431098 0.1937019 0.05290065 0.4003647 $out [1] -0.05 0.01 0.17 -4.16 $group [1] 5 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.549999999999997, -0.47999999999999, -0.229999999999997, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xtiz1495031759.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,] 100.810 102.180 99.090 100.920 101.400 102.400 NA [2,] 101.145 102.450 99.465 101.105 101.615 102.490 NA [3,] 101.345 102.675 99.725 101.185 101.825 102.640 NA [4,] 102.265 103.345 100.670 101.235 102.060 102.855 NA [5,] 102.720 103.730 101.170 101.430 102.160 103.060 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.8342 102.2668 99.17539 101.1257 101.622 102.4735 NA [2,] 101.8558 103.0832 100.27461 101.2443 102.028 102.8065 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(100.81, 101.145, 101.345, 102.265, 102.72, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/76h861495031759.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,] 101.2817 101.4900 101.4988 [2,] 101.4800 101.5725 101.6737 [3,] 101.6267 101.6525 101.8094 [4,] 101.9133 101.8950 101.8838 [5,] 102.2600 102.2250 102.1350 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 101.4290 101.5054 101.7136 [2,] 101.8243 101.7996 101.9052 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(101.281666666667, 101.48, 101.626666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fqp41495031759.ps tmp/1fqp41495031759.png",intern=TRUE)) character(0) > try(system("convert tmp/2ahlf1495031759.ps tmp/2ahlf1495031759.png",intern=TRUE)) character(0) > try(system("convert tmp/3hcwf1495031759.ps tmp/3hcwf1495031759.png",intern=TRUE)) character(0) > try(system("convert tmp/457511495031759.ps tmp/457511495031759.png",intern=TRUE)) character(0) > try(system("convert tmp/5xgit1495031759.ps tmp/5xgit1495031759.png",intern=TRUE)) character(0) > try(system("convert tmp/6xtiz1495031759.ps tmp/6xtiz1495031759.png",intern=TRUE)) character(0) > try(system("convert tmp/76h861495031759.ps tmp/76h861495031759.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.696 1.822 12.629