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(83.8,86.62,83.98,82.59,82.3,81.64,81.66,81.63,85.54,85.62,85.89,86.38,87.59,87.68,88.07,87.66,88.36,88.08,94.35,99.07,100.39,102.1,102.89,103.05,102.78,102.53,101.6,100.78,100.54,100.19,100.07,100.18,100.08,99.66,99.92,99.51,101.77,102.49,101.91,100.57,100.23,99.99,99.2,99.07,98.79,99.31,98.98,97.69,98.9,98.75,99.7,100.18,100.14,100.13,99.85,99.38,98.87,97.79,97.32,97.29,96.73,97.22,96.66,96.58,96.47,96.7,97.91,97.97,98.26,97.8,97.33,97.56) > 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,] 83.80 87.59 102.78 101.77 98.90 96.73 NA [2,] 86.62 87.68 102.53 102.49 98.75 97.22 NA [3,] 83.98 88.07 101.60 101.91 99.70 96.66 NA [4,] 82.59 87.66 100.78 100.57 100.18 96.58 NA [5,] 82.30 88.36 100.54 100.23 100.14 96.47 NA [6,] 81.64 88.08 100.19 99.99 100.13 96.70 NA [7,] 81.66 94.35 100.07 99.20 99.85 97.91 NA [8,] 81.63 99.07 100.18 99.07 99.38 97.97 NA [9,] 85.54 100.39 100.08 98.79 98.87 98.26 NA [10,] 85.62 102.10 99.66 99.31 97.79 97.80 NA [11,] 85.89 102.89 99.92 98.98 97.32 97.33 NA [12,] 86.38 103.05 99.51 97.69 97.29 97.56 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.82 0.09 -0.25 0.72 -0.15 0.49 NA [2,] -2.64 0.39 -0.93 -0.58 0.95 -0.56 NA [3,] -1.39 -0.41 -0.82 -1.34 0.48 -0.08 NA [4,] -0.29 0.70 -0.24 -0.34 -0.04 -0.11 NA [5,] -0.66 -0.28 -0.35 -0.24 -0.01 0.23 NA [6,] 0.02 6.27 -0.12 -0.79 -0.28 1.21 NA [7,] -0.03 4.72 0.11 -0.13 -0.47 0.06 NA [8,] 3.91 1.32 -0.10 -0.28 -0.51 0.29 NA [9,] 0.08 1.71 -0.42 0.52 -1.08 -0.46 NA [10,] 0.27 0.79 0.26 -0.33 -0.47 -0.47 NA [11,] 0.49 0.16 -0.41 -1.29 -0.03 0.23 NA [12,] 1.21 -0.27 2.26 1.21 -0.56 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/1kt551457432688.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/2q1ry1457432688.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/3qu1f1457432688.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/4zhxz1457432688.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,] 83.800 86.620 83.98 82.59 82.300 81.640 94.350 97.97 98.26 [2,] 87.590 87.680 88.07 87.66 88.360 88.080 94.350 97.97 98.26 [3,] 97.815 97.985 98.18 98.38 98.305 98.345 98.555 99.07 98.83 [4,] 101.770 102.490 101.60 100.57 100.230 100.130 99.850 99.38 100.08 [5,] 102.780 102.530 101.91 100.78 100.540 100.190 100.070 100.18 100.39 [,10] [,11] [,12] [1,] 97.790 97.320 97.290 [2,] 97.790 97.320 97.290 [3,] 98.555 98.155 97.625 [4,] 99.660 99.920 99.510 [5,] 102.100 102.890 99.510 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 88.66844 88.43207 89.45271 90.05263 90.64847 90.57236 95.00732 [2,] 106.96156 107.53793 106.90729 106.70737 105.96153 106.11764 102.10268 [,8] [,9] [,10] [,11] [,12] [1,] 98.1605 97.65604 97.34879 96.47792 96.19303 [2,] 99.9795 100.00396 99.76121 99.83208 99.05697 $out [1] 81.66 81.63 85.54 85.62 85.89 86.38 103.05 $group [1] 7 8 9 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(83.8, 87.59, 97.815, 101.77, 102.78, 86.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58ziu1457432688.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.25 -2.64 -1.390 -0.340 -0.66 -0.79 -0.470 -0.510 -1.08 -0.470 -1.290 [2,] -0.15 -0.93 -1.340 -0.290 -0.35 -0.28 -0.130 -0.280 -0.46 -0.470 -0.410 [3,] 0.29 -0.57 -0.615 -0.175 -0.26 -0.05 0.015 0.095 -0.17 -0.035 0.065 [4,] 0.72 0.39 -0.080 -0.040 -0.01 1.21 0.110 1.320 0.52 0.270 0.230 [5,] 0.72 0.95 0.480 -0.040 0.23 1.21 0.110 1.320 1.71 0.790 0.490 [,12] [1,] -0.56 [2,] -0.27 [3,] 1.21 [4,] 1.21 [5,] 2.26 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.2711781 -1.4214426 -1.4277407 -0.33625807 -0.47931098 -1.0110981 [2,] 0.8511781 0.2814426 0.1977407 -0.01374193 -0.04068902 0.9110981 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.1398078 -0.9370517 -0.8021317 -0.5123239 -0.3478207 0.1642357 [2,] 0.1698078 1.1270517 0.4621317 0.4423239 0.4778207 2.2557643 $out [1] 2.82 0.70 6.27 4.72 3.91 $group [1] 1 4 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.25, -0.150000000000006, 0.289999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66s8t1457432688.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,] 81.630 87.590 99.510 97.690 97.29 96.470 NA [2,] 81.980 87.875 99.995 99.025 98.27 96.680 NA [3,] 83.890 91.355 100.185 99.650 99.14 97.275 NA [4,] 85.755 101.245 101.190 101.170 99.99 97.855 NA [5,] 86.620 103.050 102.780 102.490 100.18 98.260 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 82.1682 85.25685 99.63995 98.67165 98.3555 96.73907 NA [2,] 85.6118 97.45315 100.73005 100.62835 99.9245 97.81093 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(81.63, 81.98, 83.89, 85.755, 86.62, 87.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7yvef1457432688.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,] 94.45500 97.625 95.16500 [2,] 94.99417 98.070 95.38062 [3,] 95.69417 98.325 96.63687 [4,] 96.95083 98.555 98.59313 [5,] 97.05500 99.070 99.08500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 94.80172 98.10379 95.17163 [2,] 96.58662 98.54621 98.10212 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(94.455, 94.9941666666667, 95.6941666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1kt551457432688.ps tmp/1kt551457432688.png",intern=TRUE)) character(0) > try(system("convert tmp/2q1ry1457432688.ps tmp/2q1ry1457432688.png",intern=TRUE)) character(0) > try(system("convert tmp/3qu1f1457432688.ps tmp/3qu1f1457432688.png",intern=TRUE)) character(0) > try(system("convert tmp/4zhxz1457432688.ps tmp/4zhxz1457432688.png",intern=TRUE)) character(0) > try(system("convert tmp/58ziu1457432688.ps tmp/58ziu1457432688.png",intern=TRUE)) character(0) > try(system("convert tmp/66s8t1457432688.ps tmp/66s8t1457432688.png",intern=TRUE)) character(0) > try(system("convert tmp/7yvef1457432688.ps tmp/7yvef1457432688.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.439 0.429 2.893