R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(76.93,79.32,79.35,80.94,80.13,81.38,81.1,81.53,80.46,79.71,78.66,79.96,80.64,81.8,81.06,81.67,79.72,81.28,81.36,85.26,90,93,95.62,102.15,105.73,109.79,113.77,114.3,114.76,113.69,113.88,114.47,112.57,114.43,112.7,113.48,113.05,112.22,111.44,111.67,111.91,111.7,104.26,101.13,98.55,97.06,96.22,95.15,94.54,94.29,93.98,93.76,94.16,93.83,93.97,94.19,94.14,94.24,94.27,94.21,93.45,95.84,98.59,97,96.45,96.48,96.1,95.49,95.85,95.85,98.52,101.77,101.2,102.85,102.98,102.87,100.48,97.59,97.55,99.06,100.43,102.93,104.22,105.26,105.44,106.97,105.82,104.4,102.03,100.17,98.01,96.49,95.63,95.4,94.97,94.68,95.87,94.99,94.65,94.35,94.1,94.21,95.2,95.55,95.68,95.27,95.3,95.93) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 76.93 80.64 105.73 113.05 94.54 93.45 101.20 105.44 95.87 NA [2,] 79.32 81.80 109.79 112.22 94.29 95.84 102.85 106.97 94.99 NA [3,] 79.35 81.06 113.77 111.44 93.98 98.59 102.98 105.82 94.65 NA [4,] 80.94 81.67 114.30 111.67 93.76 97.00 102.87 104.40 94.35 NA [5,] 80.13 79.72 114.76 111.91 94.16 96.45 100.48 102.03 94.10 NA [6,] 81.38 81.28 113.69 111.70 93.83 96.48 97.59 100.17 94.21 NA [7,] 81.10 81.36 113.88 104.26 93.97 96.10 97.55 98.01 95.20 NA [8,] 81.53 85.26 114.47 101.13 94.19 95.49 99.06 96.49 95.55 NA [9,] 80.46 90.00 112.57 98.55 94.14 95.85 100.43 95.63 95.68 NA [10,] 79.71 93.00 114.43 97.06 94.24 95.85 102.93 95.40 95.27 NA [11,] 78.66 95.62 112.70 96.22 94.27 98.52 104.22 94.97 95.30 NA [12,] 79.96 102.15 113.48 95.15 94.21 101.77 105.26 94.68 95.93 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 2.39 1.16 4.06 -0.83 -0.25 2.39 1.65 1.53 -0.88 NA [2,] 0.03 -0.74 3.98 -0.78 -0.31 2.75 0.13 -1.15 -0.34 NA [3,] 1.59 0.61 0.53 0.23 -0.22 -1.59 -0.11 -1.42 -0.30 NA [4,] -0.81 -1.95 0.46 0.24 0.40 -0.55 -2.39 -2.37 -0.25 NA [5,] 1.25 1.56 -1.07 -0.21 -0.33 0.03 -2.89 -1.86 0.11 NA [6,] -0.28 0.08 0.19 -7.44 0.14 -0.38 -0.04 -2.16 0.99 NA [7,] 0.43 3.90 0.59 -3.13 0.22 -0.61 1.51 -1.52 0.35 NA [8,] -1.07 4.74 -1.90 -2.58 -0.05 0.36 1.37 -0.86 0.13 NA [9,] -0.75 3.00 1.86 -1.49 0.10 0.00 2.50 -0.23 -0.41 NA [10,] -1.05 2.62 -1.73 -0.84 0.03 2.67 1.29 -0.43 0.03 NA [11,] 1.30 6.53 0.78 -1.07 -0.06 3.25 1.04 -0.29 0.63 NA [12,] 0.68 3.58 -0.43 -0.61 -0.76 -0.57 0.18 1.19 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/1g8tg1445631986.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/2aoc01445631986.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/3phql1445631986.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/448sa1445631986.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] [,11] [1,] 76.93 79.32 79.35 80.94 94.10 93.83 93.97 94.19 90.00 93.00 94.27 [2,] 93.45 94.29 93.98 93.76 94.10 93.83 93.97 94.19 94.14 94.24 94.97 [3,] 95.87 95.84 98.59 97.00 96.45 96.48 96.10 95.55 95.68 95.40 95.62 [4,] 105.44 106.97 105.82 104.40 102.03 100.17 98.01 99.06 98.55 97.06 98.52 [5,] 113.05 112.22 113.77 114.30 111.91 100.17 98.01 101.13 100.43 97.06 98.52 [,12] [1,] 94.21 [2,] 94.68 [3,] 95.93 [4,] 102.15 [5,] 105.26 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.55527 89.16187 92.35427 91.39627 92.27353 93.14093 93.97227 [2,] 102.18473 102.51813 104.82573 102.60373 100.62647 99.81907 98.22773 [,8] [,9] [,10] [,11] [,12] [1,] 92.98513 93.3574 93.9148 93.75033 91.9958 [2,] 98.11487 98.0026 96.8852 97.48967 99.8642 $out [1] 80.13 79.72 114.76 81.38 81.28 113.69 111.70 81.10 81.36 113.88 [11] 104.26 81.53 85.26 114.47 80.46 112.57 79.71 114.43 102.93 78.66 [21] 112.70 104.22 79.96 113.48 $group [1] 5 5 5 6 6 6 6 7 7 7 7 8 8 8 9 9 10 10 10 11 11 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(76.93, 93.45, 95.87, 105.44, 113.05, 79.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53e1x1445631986.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.88 -1.15 -1.42 -2.39 -1.86 -0.38 -1.52 -2.58 -1.49 -1.73 -1.07 -0.760 [2,] -0.25 -0.74 -0.30 -1.95 -1.07 -0.38 -0.61 -1.07 -0.41 -0.84 -0.06 -0.590 [3,] 1.53 -0.31 -0.11 -0.55 -0.21 -0.04 0.35 -0.05 0.00 0.03 0.78 -0.125 [4,] 2.39 0.13 0.53 0.24 0.11 0.14 0.59 0.36 1.86 1.29 1.30 0.935 [5,] 4.06 0.13 1.59 0.46 1.56 0.19 1.51 1.37 3.00 2.67 3.25 1.190 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.1396 -0.7682 -0.5471333 -1.7034 -0.8314667 -0.3138667 -0.282 -0.8031333 [2,] 2.9204 0.1482 0.3271333 0.6034 0.4114667 0.2338667 0.982 0.7031333 [,9] [,10] [,11] [,12] [1,] -1.195533 -1.0918 0.06373333 -0.9768869 [2,] 1.195533 1.1518 1.49626667 0.7268869 $out [1] 3.98 2.75 -1.59 -2.89 -7.44 -2.16 0.99 3.90 -3.13 4.74 6.53 3.58 $group [1] 2 2 3 5 6 6 6 7 7 8 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.88000000000001, -0.25, 1.53, 2.38999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jatp1445631986.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] [,9] [,10] [1,] 76.930 79.720 112.570 95.150 93.760 93.450 97.550 94.680 94.100 NA [2,] 79.335 81.170 112.635 97.805 93.975 95.845 99.745 95.515 94.500 NA [3,] 80.045 81.735 113.730 107.850 94.175 96.275 102.025 99.090 95.235 NA [4,] 81.020 91.500 114.365 111.805 94.255 97.760 102.955 104.920 95.615 NA [5,] 81.530 102.150 114.760 113.050 94.540 98.590 105.260 106.970 95.930 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 79.27646 77.02342 112.9409 101.4645 94.04729 95.40156 100.5609 94.80032 [2,] 80.81354 86.44658 114.5191 114.2355 94.30271 97.14844 103.4891 103.37968 [,9] [,10] [1,] 94.72644 NA [2,] 95.74356 NA $out [1] 105.73 109.79 101.77 $group [1] 3 3 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(76.93, 79.335, 80.045, 81.02, 81.53, 79.72, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7y3ps1445631986.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,] 95.71444 95.400 95.6500 [2,] 96.12000 95.650 96.4850 [3,] 96.71167 95.900 97.5325 [4,] 97.72389 96.465 99.2625 [5,] 98.06556 97.000 100.6300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 95.98012 95.52827 96.26566 [2,] 97.44321 96.27173 98.79934 $out [1] 98.59 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(95.7144444444444, 96.12, 96.7116666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1g8tg1445631986.ps tmp/1g8tg1445631986.png",intern=TRUE)) character(0) > try(system("convert tmp/2aoc01445631986.ps tmp/2aoc01445631986.png",intern=TRUE)) character(0) > try(system("convert tmp/3phql1445631986.ps tmp/3phql1445631986.png",intern=TRUE)) character(0) > try(system("convert tmp/448sa1445631986.ps tmp/448sa1445631986.png",intern=TRUE)) character(0) > try(system("convert tmp/53e1x1445631986.ps tmp/53e1x1445631986.png",intern=TRUE)) character(0) > try(system("convert tmp/6jatp1445631986.ps tmp/6jatp1445631986.png",intern=TRUE)) character(0) > try(system("convert tmp/7y3ps1445631986.ps tmp/7y3ps1445631986.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.605 0.442 3.071