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(789,811,996,778,603,990,735,800,706,766,870,647,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) > 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,] 789 726 1021 1104 938 NA [2,] 811 784 944 1063 900 NA [3,] 996 884 915 1103 781 NA [4,] 778 696 864 1039 1040 NA [5,] 603 893 1022 1185 792 NA [6,] 990 674 891 1047 653 NA [7,] 735 703 1087 1155 866 NA [8,] 800 799 822 878 679 NA [9,] 706 793 890 879 799 NA [10,] 766 799 1092 1133 760 NA [11,] 870 1022 967 920 699 NA [12,] 647 758 833 943 762 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 22 58 -77 -41 -38 NA [2,] 185 100 -29 40 -119 NA [3,] -218 -188 -51 -64 259 NA [4,] -175 197 158 146 -248 NA [5,] 387 -219 -131 -138 -139 NA [6,] -255 29 196 108 213 NA [7,] 65 96 -265 -277 -187 NA [8,] -94 -6 68 1 120 NA [9,] 60 6 202 254 -39 NA [10,] 104 223 -125 -213 -61 NA [11,] -223 -264 -134 23 63 NA [12,] 79 263 271 -5 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/1wp5r1444931688.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/2cioe1444931688.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/3nuiw1444931688.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/4lknc1444931688.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,] 726 784 781 696 603 653 703 799 706 760 870 647 [2,] 789 811 884 778 792 674 735 799 793 766 870 758 [3,] 938 900 915 864 893 891 866 800 799 799 920 762 [4,] 1021 944 996 1039 1022 990 1087 822 879 1092 967 833 [5,] 1104 1063 1103 1040 1185 1047 1155 822 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,] 774.0694 806.0225 835.8611 679.5781 730.4826 667.7152 617.2777 [2,] 1101.9306 993.9775 994.1389 1048.4219 1055.5174 1114.2848 1114.7223 [,8] [,9] [,10] [,11] [,12] [1,] 783.7483 738.2326 568.6492 851.46 709.0052 [2,] 816.2517 859.7674 1029.3508 988.54 814.9948 $out [1] 878 679 699 $group [1] 8 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(726, 789, 938, 1021, 1104, 784, 811, 900, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57z6w1444931688.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 -218 -248 -139 29 -277 -94 -39 -213 -264 -5 [2,] -41 -29 -188 -175 -139 29 -265 -6 6 -125 -223 37 [3,] -38 40 -64 146 -138 108 -187 1 60 -61 -134 171 [4,] 22 100 -51 158 -131 196 65 68 202 104 23 267 [5,] 58 185 -51 197 -131 213 96 120 254 223 63 271 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -82.515641 -51.15108 -160.80385 -89.29696 -143.6528 -10.00178 -420.17717 [2,] 6.515641 131.15108 32.80385 381.29696 -132.3472 226.00178 46.17717 [,8] [,9] [,10] [,11] [,12] [1,] -51.28821 -78.49311 -222.8108 -307.82298 -10.7 [2,] 53.28821 198.49311 100.8108 39.82298 352.7 $out [1] 259 387 -219 -255 $group [1] 3 5 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-77, -41, -38, 22, 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/6u0oh1444931688.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,] 603.0 674.0 822.0 878.0 653.0 NA [2,] 720.5 714.5 877.0 931.5 729.5 NA [3,] 783.5 788.5 929.5 1055.0 786.5 NA [4,] 840.5 841.5 1021.5 1118.5 883.0 NA [5,] 996.0 1022.0 1092.0 1185.0 1040.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 728.7672 730.5744 863.5926 969.708 716.4876 NA [2,] 838.2328 846.4256 995.4074 1140.292 856.5124 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(603, 720.5, 783.5, 840.5, 996, 674, 714.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7545o1444931688.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,] 788.6 762.0 795.50 [2,] 832.2 799.5 834.00 [3,] 897.3 878.5 906.00 [4,] 909.6 907.5 914.75 [5,] 935.8 938.0 940.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 861.9973 829.2405 869.1694 [2,] 932.6027 927.7595 942.8306 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(788.6, 832.2, 897.3, 909.6, 935.8, 762, 799.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wp5r1444931688.ps tmp/1wp5r1444931688.png",intern=TRUE)) character(0) > try(system("convert tmp/2cioe1444931688.ps tmp/2cioe1444931688.png",intern=TRUE)) character(0) > try(system("convert tmp/3nuiw1444931688.ps tmp/3nuiw1444931688.png",intern=TRUE)) character(0) > try(system("convert tmp/4lknc1444931688.ps tmp/4lknc1444931688.png",intern=TRUE)) character(0) > try(system("convert tmp/57z6w1444931688.ps tmp/57z6w1444931688.png",intern=TRUE)) character(0) > try(system("convert tmp/6u0oh1444931688.ps tmp/6u0oh1444931688.png",intern=TRUE)) character(0) > try(system("convert tmp/7545o1444931688.ps tmp/7545o1444931688.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.649 0.425 3.099