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(78.46,78.59,81.37,83.61,84.65,84.56,83.85,84.08,85.41,85.75,86.38,88.87,90.37,92.21,95.75,97.29,98.29,99.51,99.04,98.9,100.74,100.3,101.68,101.3,103.13,104.17,105.98,106.25,104.01,101.68,101.93,104.41,105.51,104.71,103.14,102.66,102.68,101.89,101.37,101.16,99.34,99.35,99.88,99.31,99.91,98.39,98.02,98.7,98.01,98.42,98.2,93.5,93.17,93.42,93.13,92.31,92.09,92.62,91.43,89.38) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 78.46 90.37 103.13 102.68 98.01 NA [2,] 78.59 92.21 104.17 101.89 98.42 NA [3,] 81.37 95.75 105.98 101.37 98.20 NA [4,] 83.61 97.29 106.25 101.16 93.50 NA [5,] 84.65 98.29 104.01 99.34 93.17 NA [6,] 84.56 99.51 101.68 99.35 93.42 NA [7,] 83.85 99.04 101.93 99.88 93.13 NA [8,] 84.08 98.90 104.41 99.31 92.31 NA [9,] 85.41 100.74 105.51 99.91 92.09 NA [10,] 85.75 100.30 104.71 98.39 92.62 NA [11,] 86.38 101.68 103.14 98.02 91.43 NA [12,] 88.87 101.30 102.66 98.70 89.38 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.13 1.84 1.04 -0.79 0.41 NA [2,] 2.78 3.54 1.81 -0.52 -0.22 NA [3,] 2.24 1.54 0.27 -0.21 -4.70 NA [4,] 1.04 1.00 -2.24 -1.82 -0.33 NA [5,] -0.09 1.22 -2.33 0.01 0.25 NA [6,] -0.71 -0.47 0.25 0.53 -0.29 NA [7,] 0.23 -0.14 2.48 -0.57 -0.82 NA [8,] 1.33 1.84 1.10 0.60 -0.22 NA [9,] 0.34 -0.44 -0.80 -1.52 0.53 NA [10,] 0.63 1.38 -1.57 -0.37 -1.19 NA [11,] 2.49 -0.38 -0.48 0.68 -2.05 NA [12,] 1.50 1.83 0.02 -0.69 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/1qddb1445008019.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/2d99o1445008019.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/3cnu41445008019.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/4n7iw1445008019.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,] 78.46 78.59 95.75 83.61 84.65 84.56 83.85 84.08 85.41 85.75 [2,] 90.37 92.21 95.75 93.50 93.17 93.42 93.13 92.31 92.09 92.62 [3,] 98.01 98.42 98.20 97.29 98.29 99.35 99.04 98.90 99.91 98.39 [4,] 102.68 101.89 101.37 101.16 99.34 99.51 99.88 99.31 100.74 100.30 [5,] 103.13 104.17 105.98 106.25 104.01 101.68 101.93 104.41 105.51 104.71 [,11] [,12] [1,] 86.38 88.87 [2,] 91.43 89.38 [3,] 98.02 98.70 [4,] 101.68 101.30 [5,] 103.14 102.66 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.31179 91.58014 94.22892 91.87746 93.93029 95.04682 94.27047 [2,] 106.70821 105.25986 102.17108 102.70254 102.64971 103.65318 103.80953 [,8] [,9] [,10] [,11] [,12] [1,] 93.95382 93.79793 92.96333 90.77738 90.27736 [2,] 103.84618 106.02207 103.81667 105.26262 107.12264 $out [1] 81.37 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(78.46, 90.37, 98.01, 102.68, 103.13, 78.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5c15j1445008019.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.79 -0.52 -0.21 -2.24 -0.09 -0.71 -0.82 -0.22 -1.52 -1.57 -2.05 -0.690 [2,] 0.13 -0.22 -0.21 -1.82 -0.09 -0.47 -0.57 0.60 -0.80 -1.19 -0.48 -0.335 [3,] 0.41 1.81 0.27 -0.33 0.01 -0.29 -0.14 1.10 -0.44 -0.37 -0.38 0.760 [4,] 1.04 2.78 1.54 1.00 0.25 0.25 0.23 1.33 0.34 0.63 0.68 1.665 [5,] 1.84 3.54 2.24 1.04 0.25 0.53 0.23 1.84 0.53 1.38 0.68 1.830 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.2330037 -0.3097924 -0.9665456 -2.322605 -0.2302431 -0.7987502 -0.705278 [2,] 1.0530037 3.9297924 1.5065456 1.662605 0.2502431 0.2187502 0.425278 [,8] [,9] [,10] [,11] [,12] [1,] 0.5841838 -1.2455211 -1.6560074 -1.1996531 -0.82 [2,] 1.6158162 0.3655211 0.9160074 0.4396531 2.34 $out [1] -4.70 1.22 -2.33 2.48 2.49 $group [1] 3 5 5 7 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.790000000000006, 0.13000000000001, 0.409999999999997, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64aku1445008019.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] [1,] 78.46 92.21 101.680 98.020 89.380 NA [2,] 82.49 96.52 102.895 99.005 92.200 NA [3,] 84.32 98.97 104.090 99.615 93.150 NA [4,] 85.58 100.52 105.110 101.265 95.755 NA [5,] 88.87 101.68 106.250 102.680 98.420 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 82.91063 97.14557 103.0797 98.5842 91.52854 NA [2,] 85.72937 100.79443 105.1003 100.6458 94.77146 NA $out [1] 90.37 $group [1] 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(78.46, 82.49, 84.32, 85.58, 88.87, 92.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/77cqr1445008019.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.056 97.290 95.8100 [2,] 95.635 98.110 96.3350 [3,] 96.011 98.405 96.4850 [4,] 96.358 98.970 96.8025 [5,] 96.732 99.910 97.3300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 95.68123 98.01275 96.27177 [2,] 96.34077 98.79725 96.69823 $out [1] 94.53 98.56 95.34 $group [1] 1 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(95.056, 95.635, 96.011, 96.358, 96.732, 97.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qddb1445008019.ps tmp/1qddb1445008019.png",intern=TRUE)) character(0) > try(system("convert tmp/2d99o1445008019.ps tmp/2d99o1445008019.png",intern=TRUE)) character(0) > try(system("convert tmp/3cnu41445008019.ps tmp/3cnu41445008019.png",intern=TRUE)) character(0) > try(system("convert tmp/4n7iw1445008019.ps tmp/4n7iw1445008019.png",intern=TRUE)) character(0) > try(system("convert tmp/5c15j1445008019.ps tmp/5c15j1445008019.png",intern=TRUE)) character(0) > try(system("convert tmp/64aku1445008019.ps tmp/64aku1445008019.png",intern=TRUE)) character(0) > try(system("convert tmp/77cqr1445008019.ps tmp/77cqr1445008019.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.612 0.525 3.168