R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(86.88,90.65,90.68,89.64,102.62,101.84,92.51,94.29,94.68,96.94,94.03,89.65,84.9,89.07,89.8,93.22,92.23,98.41,96.63,89.8,90,92.13,93.27,90.81,85.42,88.28,88.73,90.18,92.74,96.13,94.85,94.25,96.94,101.22,98.71,95.51,93.91,98.17,97.59,99.64,107.88,108.49,100.25,99.27,101.73,101.25,97.09,94.74,94.53,93.48,96.05,106.22,98.33,99.86,93.78,88.96,83.77,89.46,86.78,88.4,87.19,92.23,95.99,104.75,105.63,108.71,96.4,93.31,93.77,98.7,95.04,95.61) > 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,] 86.88 84.90 85.42 93.91 94.53 87.19 NA [2,] 90.65 89.07 88.28 98.17 93.48 92.23 NA [3,] 90.68 89.80 88.73 97.59 96.05 95.99 NA [4,] 89.64 93.22 90.18 99.64 106.22 104.75 NA [5,] 102.62 92.23 92.74 107.88 98.33 105.63 NA [6,] 101.84 98.41 96.13 108.49 99.86 108.71 NA [7,] 92.51 96.63 94.85 100.25 93.78 96.40 NA [8,] 94.29 89.80 94.25 99.27 88.96 93.31 NA [9,] 94.68 90.00 96.94 101.73 83.77 93.77 NA [10,] 96.94 92.13 101.22 101.25 89.46 98.70 NA [11,] 94.03 93.27 98.71 97.09 86.78 95.04 NA [12,] 89.65 90.81 95.51 94.74 88.40 95.61 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.77 4.17 2.86 4.26 -1.05 5.04 NA [2,] 0.03 0.73 0.45 -0.58 2.57 3.76 NA [3,] -1.04 3.42 1.45 2.05 10.17 8.76 NA [4,] 12.98 -0.99 2.56 8.24 -7.89 0.88 NA [5,] -0.78 6.18 3.39 0.61 1.53 3.08 NA [6,] -9.33 -1.78 -1.28 -8.24 -6.08 -12.31 NA [7,] 1.78 -6.83 -0.60 -0.98 -4.82 -3.09 NA [8,] 0.39 0.20 2.69 2.46 -5.19 0.46 NA [9,] 2.26 2.13 4.28 -0.48 5.69 4.93 NA [10,] -2.91 1.14 -2.51 -4.16 -2.68 -3.66 NA [11,] -4.38 -2.46 -3.20 -2.35 1.62 0.57 NA [12,] -4.75 -5.39 -1.60 -0.21 -1.21 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/1x5zm1489571531.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/2ie201489571531.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/3jawg1489571531.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/4ypos1489571531.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,] 84.900 88.28 88.730 89.64 92.230 96.13 92.510 88.96 83.770 89.46 [2,] 85.420 89.07 89.800 90.18 92.740 98.41 93.780 89.80 90.000 92.13 [3,] 87.035 91.44 93.335 96.43 100.475 100.85 95.625 93.78 94.225 97.82 [4,] 93.910 93.48 96.050 104.75 105.630 108.49 96.630 94.29 96.940 101.22 [5,] 94.530 98.17 97.590 106.22 107.880 108.71 100.250 99.27 101.730 101.25 [,11] [,12] [1,] 93.270 88.400 [2,] 93.270 89.650 [3,] 94.535 92.775 [4,] 97.090 95.510 [5,] 98.710 95.610 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 81.55868 88.59541 89.30355 87.03188 92.16053 94.34807 93.78666 90.8838 [2,] 92.51132 94.28459 97.36645 105.82812 108.78947 107.35193 97.46334 96.6762 [,9] [,10] [,11] [,12] [1,] 89.74848 91.95666 92.07098 88.99511 [2,] 98.70152 103.68334 96.99902 96.55489 $out [1] 86.78 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(84.9, 85.42, 87.035, 93.91, 94.53, 88.28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pap91489571531.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,] 2.86 -0.58 -1.040 -7.89 -0.780 -12.31 -6.830 0.200 -0.48 -4.160 -4.380 [2,] 2.86 0.03 1.450 -0.99 0.610 -9.33 -4.820 0.200 2.13 -3.660 -3.200 [3,] 3.97 0.59 2.735 1.72 2.305 -7.16 -2.035 0.425 3.27 -2.795 -2.405 [4,] 4.26 2.57 8.760 8.24 3.390 -1.78 -0.600 2.460 4.93 -2.510 0.570 [5,] 5.04 3.76 10.170 12.98 6.180 -1.28 1.780 2.690 5.69 -2.510 1.620 [,12] [1,] -5.39 [2,] -4.75 [3,] -1.60 [4,] -1.21 [5,] -0.21 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.066955 -1.048382 -1.980186 -4.233648 0.5118102 -12.029994 -4.7570363 [2,] 4.873045 2.228382 7.450186 7.673648 4.0981898 -2.290006 0.6870363 [,8] [,9] [,10] [,11] [,12] [1,] -1.032773 1.46391 -3.536787 -4.83677177 -4.1013551 [2,] 1.882773 5.07609 -2.053213 0.02677177 0.9013551 $out [1] -1.05 -5.19 1.14 $group [1] 1 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2.86, 2.86, 3.97, 4.26000000000001, 5.04000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6lxnu1489571531.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,] 86.88 84.900 85.420 93.910 83.77 87.190 NA [2,] 90.15 89.800 89.455 97.340 88.68 93.540 NA [3,] 93.27 91.470 94.550 99.455 93.63 95.800 NA [4,] 95.81 93.245 96.535 101.490 97.19 101.725 NA [5,] 102.62 98.410 101.220 101.730 106.22 108.710 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.68844 89.89871 91.32076 97.56216 89.74853 92.06677 NA [2,] 95.85156 93.04129 97.77924 101.34784 97.51147 99.53323 NA $out [1] 107.88 108.49 $group [1] 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(86.88, 90.15, 93.27, 95.81, 102.62, 84.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7pn1c1489571531.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,] 88.80500 87.035 89.00750 [2,] 92.79667 93.055 92.55375 [3,] 93.81750 94.380 94.33875 [4,] 96.94583 97.125 97.08375 [5,] 102.24000 100.850 102.80000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 91.92504 92.52365 92.27259 [2,] 95.70996 96.23635 96.40491 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(88.805, 92.7966666666667, 93.8175, 96.9458333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1x5zm1489571531.ps tmp/1x5zm1489571531.png",intern=TRUE)) character(0) > try(system("convert tmp/2ie201489571531.ps tmp/2ie201489571531.png",intern=TRUE)) character(0) > try(system("convert tmp/3jawg1489571531.ps tmp/3jawg1489571531.png",intern=TRUE)) character(0) > try(system("convert tmp/4ypos1489571531.ps tmp/4ypos1489571531.png",intern=TRUE)) character(0) > try(system("convert tmp/5pap91489571531.ps tmp/5pap91489571531.png",intern=TRUE)) character(0) > try(system("convert tmp/6lxnu1489571531.ps tmp/6lxnu1489571531.png",intern=TRUE)) character(0) > try(system("convert tmp/7pn1c1489571531.ps tmp/7pn1c1489571531.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.559 0.172 2.776