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(96.16,96.4,96.87,97,97.26,97.42,97.64,97.93,98.1,98.29,98.42,98.49,98.67,99.1,99.37,99.54,99.58,99.77,100.06,100.26,100.57,100.94,101.03,101.12,101.26,101.94,102.26,102.51,102.61,102.76,103.04,103.22,103.47,103.64,103.76,103.85,103.98,104.68,105.07,105.19,105.39,105.66,105.76,105.89,106.04,106.37,106.57,106.67,107.08,107.64,108.47,108.7,108.82,108.99,109.18,109.31,109.5,109.7,109.9,110.09) > 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] 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,] 96.16 98.67 101.26 103.98 107.08 NA [2,] 96.40 99.10 101.94 104.68 107.64 NA [3,] 96.87 99.37 102.26 105.07 108.47 NA [4,] 97.00 99.54 102.51 105.19 108.70 NA [5,] 97.26 99.58 102.61 105.39 108.82 NA [6,] 97.42 99.77 102.76 105.66 108.99 NA [7,] 97.64 100.06 103.04 105.76 109.18 NA [8,] 97.93 100.26 103.22 105.89 109.31 NA [9,] 98.10 100.57 103.47 106.04 109.50 NA [10,] 98.29 100.94 103.64 106.37 109.70 NA [11,] 98.42 101.03 103.76 106.57 109.90 NA [12,] 98.49 101.12 103.85 106.67 110.09 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.24 0.43 0.68 0.70 0.56 NA [2,] 0.47 0.27 0.32 0.39 0.83 NA [3,] 0.13 0.17 0.25 0.12 0.23 NA [4,] 0.26 0.04 0.10 0.20 0.12 NA [5,] 0.16 0.19 0.15 0.27 0.17 NA [6,] 0.22 0.29 0.28 0.10 0.19 NA [7,] 0.29 0.20 0.18 0.13 0.13 NA [8,] 0.17 0.31 0.25 0.15 0.19 NA [9,] 0.19 0.37 0.17 0.33 0.20 NA [10,] 0.13 0.09 0.12 0.20 0.20 NA [11,] 0.07 0.09 0.09 0.10 0.19 NA [12,] 0.18 0.14 0.13 0.41 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/1d6n11489495168.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/2r9gr1489495168.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/32tne1489495168.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/45ryk1489495168.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,] 96.16 96.40 96.87 97.00 97.26 97.42 97.64 97.93 98.10 98.29 [2,] 98.67 99.10 99.37 99.54 99.58 99.77 100.06 100.26 100.57 100.94 [3,] 101.26 101.94 102.26 102.51 102.61 102.76 103.04 103.22 103.47 103.64 [4,] 103.98 104.68 105.07 105.19 105.39 105.66 105.76 105.89 106.04 106.37 [5,] 107.08 107.64 108.47 108.70 108.82 108.99 109.18 109.31 109.50 109.70 [,11] [,12] [1,] 98.42 98.49 [2,] 101.03 101.12 [3,] 103.76 103.85 [4,] 106.57 106.67 [5,] 109.90 110.09 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.50797 97.99719 98.23239 98.51772 98.50467 98.59814 99.01239 [2,] 105.01203 105.88281 106.28761 106.50228 106.71533 106.92186 107.06761 [,8] [,9] [,10] [,11] [,12] [1,] 99.24186 99.60491 99.80318 99.84545 99.92838 [2,] 107.19814 107.33509 107.47682 107.67455 107.77162 $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(96.16, 98.67, 101.26, 103.98, 107.08, 96.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xtjt1489495168.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.24 0.27 0.12 0.04 0.15 0.10 0.13 0.15 0.17 0.09 0.09 0.130 [2,] 0.43 0.32 0.13 0.10 0.16 0.19 0.13 0.17 0.19 0.12 0.09 0.135 [3,] 0.56 0.39 0.17 0.12 0.17 0.22 0.18 0.19 0.20 0.13 0.09 0.160 [4,] 0.68 0.47 0.23 0.20 0.19 0.28 0.20 0.25 0.33 0.20 0.10 0.295 [5,] 0.70 0.47 0.25 0.26 0.19 0.29 0.29 0.31 0.37 0.20 0.10 0.410 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3833506 0.2840104 0.09934025 0.04934025 0.1488021 0.1564062 0.1305382 [2,] 0.7366494 0.4959896 0.24065975 0.19065975 0.1911979 0.2835938 0.2294618 [,8] [,9] [,10] [,11] [,12] [1,] 0.1334722 0.1010764 0.0734722 0.08293403 0.0336 [2,] 0.2465278 0.2989236 0.1865278 0.09706597 0.2864 $out [1] 0.83 0.27 0.07 0.19 $group [1] 2 5 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.240000000000009, 0.429999999999993, 0.560000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61axx1489495168.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,] 96.160 98.670 101.260 103.980 107.080 NA [2,] 96.935 99.455 102.385 105.130 108.585 NA [3,] 97.530 99.915 102.900 105.710 109.085 NA [4,] 98.195 100.755 103.555 106.205 109.600 NA [5,] 98.490 101.120 103.850 106.670 110.090 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 96.95531 99.32206 102.3664 105.2197 108.6221 NA [2,] 98.10469 100.50794 103.4336 106.2003 109.5479 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(96.16, 96.935, 97.53, 98.195, 98.49, 98.67, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lbhk1489495168.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.430 101.260 101.3250 [2,] 102.498 102.385 102.2925 [3,] 103.028 102.900 102.8125 [4,] 103.662 103.555 103.4800 [5,] 104.044 103.850 103.8950 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 102.4971 102.3664 102.2709 [2,] 103.5589 103.4336 103.3541 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(101.43, 102.498, 103.028, 103.662, 104.044, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1d6n11489495168.ps tmp/1d6n11489495168.png",intern=TRUE)) character(0) > try(system("convert tmp/2r9gr1489495168.ps tmp/2r9gr1489495168.png",intern=TRUE)) character(0) > try(system("convert tmp/32tne1489495168.ps tmp/32tne1489495168.png",intern=TRUE)) character(0) > try(system("convert tmp/45ryk1489495168.ps tmp/45ryk1489495168.png",intern=TRUE)) character(0) > try(system("convert tmp/5xtjt1489495168.ps tmp/5xtjt1489495168.png",intern=TRUE)) character(0) > try(system("convert tmp/61axx1489495168.ps tmp/61axx1489495168.png",intern=TRUE)) character(0) > try(system("convert tmp/7lbhk1489495168.ps tmp/7lbhk1489495168.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.739 0.226 3.017