R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(15391,13704,15409,15098,15254,15522,16669,16238,16246,15424,14952,15008,14929,13905,14994,14753,15031,15386,16160,16116,16219,16064,15436,15404,15112,14119,14775,14289,15121,15371,15782,16104,15674,15105,14223,14385,14558,13804,14672,14244,15089,14580,15218,15696,15129,15110,14204,13655,14534,12746,14074,13699,14184,14110,15820,15362,14993,14437,13694,13688,14366,13267,14409,14031,14584,14626,15669,15460,15552,15220,13907,14090,14176,12523,13597,13241,14345,14273,15308,15353,15330,14610,13852,13902) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15391 14929 15112 14558 14534 14366 14176 NA [2,] 13704 13905 14119 13804 12746 13267 12523 NA [3,] 15409 14994 14775 14672 14074 14409 13597 NA [4,] 15098 14753 14289 14244 13699 14031 13241 NA [5,] 15254 15031 15121 15089 14184 14584 14345 NA [6,] 15522 15386 15371 14580 14110 14626 14273 NA [7,] 16669 16160 15782 15218 15820 15669 15308 NA [8,] 16238 16116 16104 15696 15362 15460 15353 NA [9,] 16246 16219 15674 15129 14993 15552 15330 NA [10,] 15424 16064 15105 15110 14437 15220 14610 NA [11,] 14952 15436 14223 14204 13694 13907 13852 NA [12,] 15008 15404 14385 13655 13688 14090 13902 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -1687 -1024 -993 -754 -1788 -1099 -1653 NA [2,] 1705 1089 656 868 1328 1142 1074 NA [3,] -311 -241 -486 -428 -375 -378 -356 NA [4,] 156 278 832 845 485 553 1104 NA [5,] 268 355 250 -509 -74 42 -72 NA [6,] 1147 774 411 638 1710 1043 1035 NA [7,] -431 -44 322 478 -458 -209 45 NA [8,] 8 103 -430 -567 -369 92 -23 NA [9,] -822 -155 -569 -19 -556 -332 -720 NA [10,] -472 -628 -882 -906 -743 -1313 -758 NA [11,] 56 -32 162 -549 -6 183 50 NA [12,] -79 -292 173 879 678 86 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/1g5421476341406.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/2txom1476341406.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/3ia1r1476341406.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/4kvh21476341406.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] [1,] 14176.0 12523.0 13597.0 13241 14184.0 14110.0 15218.0 15353 14993.0 [2,] 14450.0 13006.5 14241.5 13865 14464.5 14426.5 15488.5 15411 15229.5 [3,] 14558.0 13704.0 14672.0 14244 15031.0 14626.0 15782.0 15696 15552.0 [4,] 15020.5 13854.5 14884.5 14521 15105.0 15378.5 15990.0 16110 15946.5 [5,] 15391.0 14119.0 15409.0 15098 15254.0 15522.0 16669.0 16238 16246.0 [,10] [,11] [,12] [1,] 14437.0 13694.0 13655.0 [2,] 14857.5 13879.5 13795.0 [3,] 15110.0 14204.0 14090.0 [4,] 15322.0 14587.5 14696.5 [5,] 15424.0 15436.0 15404.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 14217.31 13197.59 14288.01 13852.25 14648.5 14057.48 15482.51 15278.57 [2,] 14898.69 14210.41 15055.99 14635.75 15413.5 15194.52 16081.49 16113.43 [,9] [,10] [,11] [,12] [1,] 15123.82 14832.61 13781.19 13551.64 [2,] 15980.18 15387.39 14626.81 14628.36 $out [1] 16064 $group [1] 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(14176, 14450, 14558, 15020.5, 15391, 12523, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bfs51476341406.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] [1,] -1788.0 656 -486.0 156.0 -509 411 -458.0 -567.0 -822.0 -906.0 -32 [2,] -1670.0 971 -403.0 381.5 -73 706 -320.0 -399.5 -644.5 -894.0 -19 [3,] -1099.0 1089 -375.0 553.0 42 1035 -44.0 -23.0 -556.0 -758.0 50 [4,] -1008.5 1235 -333.5 838.5 259 1095 183.5 50.0 -243.5 -685.5 109 [5,] -754.0 1328 -241.0 1104.0 355 1147 478.0 103.0 -19.0 -472.0 183 [,12] [1,] -292.0 [2,] -79.0 [3,] 129.5 [4,] 678.0 [5,] 879.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1494.0371 931.3435 -416.5043 280.087 -156.265 802.6955 -344.6821 [2,] -703.9629 1246.6565 -333.4957 825.913 240.265 1267.3045 256.6821 [,8] [,9] [,10] [,11] [,12] [1,] -291.4341 -795.4707 -882.5128 -26.43954 -358.7895 [2,] 245.4341 -316.5293 -633.4872 126.43954 617.7895 $out [1] 1705 1710 -1313 -549 $group [1] 2 6 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1788, -1670, -1099, -1008.5, -754, 656, 971, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mcyd1476341406.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] [1,] 14952 13905.0 14119.0 13655.0 12746.0 13267.0 12523.0 NA [2,] 15053 14961.5 14337.0 14224.0 13696.5 14060.5 13724.5 NA [3,] 15400 15395.0 15108.5 14626.0 14147.0 14496.5 14224.5 NA [4,] 15880 16090.0 15522.5 15119.5 14763.5 15340.0 14959.0 NA [5,] 16669 16219.0 16104.0 15696.0 15820.0 15669.0 15353.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15022.8 14880.28 14567.79 14217.56 13660.33 13912.91 13661.44 NA [2,] 15777.2 15909.72 15649.21 15034.44 14633.67 15080.09 14787.56 NA $out [1] 13704 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(14952, 15053, 15400, 15880, 16669, 13905, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73zhw1476341406.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,] 13438.29 13704 13430.50 [2,] 14314.29 14224 14239.62 [3,] 14762.43 14649 14760.00 [4,] 15365.21 15331 15338.88 [5,] 15803.71 15782 15760.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 14283.09 14144.09 14258.62 [2,] 15241.76 15153.91 15261.38 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(13438.2857142857, 14314.2857142857, 14762.4285714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1g5421476341406.ps tmp/1g5421476341406.png",intern=TRUE)) character(0) > try(system("convert tmp/2txom1476341406.ps tmp/2txom1476341406.png",intern=TRUE)) character(0) > try(system("convert tmp/3ia1r1476341406.ps tmp/3ia1r1476341406.png",intern=TRUE)) character(0) > try(system("convert tmp/4kvh21476341406.ps tmp/4kvh21476341406.png",intern=TRUE)) character(0) > try(system("convert tmp/5bfs51476341406.ps tmp/5bfs51476341406.png",intern=TRUE)) character(0) > try(system("convert tmp/6mcyd1476341406.ps tmp/6mcyd1476341406.png",intern=TRUE)) character(0) > try(system("convert tmp/73zhw1476341406.ps tmp/73zhw1476341406.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.622 0.226 2.893