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(726,784,884,696,893,674,703,799,793,799,1022,758,1021,944,915,864,1022,891,1087,822,890,1092,967,833,1104,1063,1103,1039,1185,1047,1155,878,879,1133,920,943,938,900,781,1040,792,653,866,679,799,760,699,762,671,679,862,624,516,650,583,444,562,540,524,674) > 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,] 726 1021 1104 938 671 NA [2,] 784 944 1063 900 679 NA [3,] 884 915 1103 781 862 NA [4,] 696 864 1039 1040 624 NA [5,] 893 1022 1185 792 516 NA [6,] 674 891 1047 653 650 NA [7,] 703 1087 1155 866 583 NA [8,] 799 822 878 679 444 NA [9,] 793 890 879 799 562 NA [10,] 799 1092 1133 760 540 NA [11,] 1022 967 920 699 524 NA [12,] 758 833 943 762 674 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 58 -77 -41 -38 8 NA [2,] 100 -29 40 -119 183 NA [3,] -188 -51 -64 259 -238 NA [4,] 197 158 146 -248 -108 NA [5,] -219 -131 -138 -139 134 NA [6,] 29 196 108 213 -67 NA [7,] 96 -265 -277 -187 -139 NA [8,] -6 68 1 120 118 NA [9,] 6 202 254 -39 -22 NA [10,] 223 -125 -213 -61 -16 NA [11,] -264 -134 23 63 150 NA [12,] 263 271 -5 -91 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/1qgjq1457472861.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/2b0w71457472861.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/359g21457472861.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/44s6b1457472861.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] [,12] [1,] 671 679 862 624 516 650 583 679 793 540 524 674 [2,] 726 784 862 696 792 653 703 679 793 760 699 758 [3,] 938 900 884 864 893 674 866 799 799 799 920 762 [4,] 1021 944 915 1039 1022 891 1087 822 879 1092 967 833 [5,] 1104 1063 915 1040 1185 1047 1155 878 890 1133 1022 943 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 729.5537 786.9444 846.5503 621.6371 730.4826 505.8298 594.6666 [2,] 1146.4463 1013.0556 921.4497 1106.3629 1055.5174 842.1702 1137.3334 [,8] [,9] [,10] [,11] [,12] [1,] 697.9566 738.2326 564.4096 730.6319 709.0052 [2,] 900.0434 859.7674 1033.5904 1109.3681 814.9948 $out [1] 1103 781 444 562 $group [1] 3 3 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(671, 726, 938, 1021, 1104, 679, 784, 900, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ux331457472861.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,] -77 -119 -238 -248 -139 -67 -277 -6 -39 -213 -264 -91 [2,] -41 -29 -188 -108 -139 29 -265 1 -22 -125 -134 -48 [3,] -38 40 -64 146 -138 108 -187 68 6 -61 23 129 [4,] 8 100 -51 158 -131 196 -139 118 202 -16 63 267 [5,] 58 183 -51 197 -131 213 -139 120 254 -16 150 271 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -72.623277 -51.15108 -160.80385 -41.95493 -143.6528 -10.00178 -276.03128 [2,] -3.376723 131.15108 32.80385 333.95493 -132.3472 226.00178 -97.96872 [,8] [,9] [,10] [,11] [,12] [1,] -14.67191 -152.2778 -138.01913 -116.1997 -119.85 [2,] 150.67191 164.2778 16.01913 162.1997 377.85 $out [1] 259 -219 134 96 223 $group [1] 3 5 5 7 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-77, -41, -38, 8, 58, -119, -29, 40, 100, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rguh1457472861.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,] 674.0 822.0 878.0 653.0 444.0 NA [2,] 714.5 877.0 931.5 729.5 532.0 NA [3,] 788.5 929.5 1055.0 786.5 603.5 NA [4,] 841.5 1021.5 1118.5 883.0 672.5 NA [5,] 1022.0 1092.0 1185.0 1040.0 862.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 730.5744 863.5926 969.708 716.4876 539.417 NA [2,] 846.4256 995.4074 1140.292 856.5124 667.583 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(674, 714.5, 788.5, 841.5, 1022, 822, 877, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7e1nw1457472861.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,] 724.4 674.0 750.50 [2,] 789.3 799.0 814.25 [3,] 858.7 865.0 865.75 [4,] 880.2 896.5 891.75 [5,] 909.0 938.0 926.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 817.2399 820.5296 830.4017 [2,] 900.1601 909.4704 901.0983 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(724.4, 789.3, 858.7, 880.2, 909, 674, 799, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qgjq1457472861.ps tmp/1qgjq1457472861.png",intern=TRUE)) character(0) > try(system("convert tmp/2b0w71457472861.ps tmp/2b0w71457472861.png",intern=TRUE)) character(0) > try(system("convert tmp/359g21457472861.ps tmp/359g21457472861.png",intern=TRUE)) character(0) > try(system("convert tmp/44s6b1457472861.ps tmp/44s6b1457472861.png",intern=TRUE)) character(0) > try(system("convert tmp/5ux331457472861.ps tmp/5ux331457472861.png",intern=TRUE)) character(0) > try(system("convert tmp/6rguh1457472861.ps tmp/6rguh1457472861.png",intern=TRUE)) character(0) > try(system("convert tmp/7e1nw1457472861.ps tmp/7e1nw1457472861.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.545 0.486 3.056