R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(8584,5522,6423,5173,5583,5716,4752,4977,4999,5285,5747,1713,9923,6737,7433,6388,6855,7658,6585,6847,6353,7361,6929,1714,11798,8378,8131,7676,7505,8168,6455,6141,6554,6888,5339,1624,9187,5047,5289,4169,3862,4253,3768,3066,4108,3890,3420,1221,5984,4064,5151,4027,3530,4819,3855,3584,4322,4154,4656,1464,7780,5060,6084,4778,4989,4903,4142,4101,4595,5034,5407,1782,8395,5291,6116,4210,4621,5299,4293,4542,3831,4360,4088,1508) > 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] 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,] 8584 9923 11798 9187 5984 7780 8395 NA [2,] 5522 6737 8378 5047 4064 5060 5291 NA [3,] 6423 7433 8131 5289 5151 6084 6116 NA [4,] 5173 6388 7676 4169 4027 4778 4210 NA [5,] 5583 6855 7505 3862 3530 4989 4621 NA [6,] 5716 7658 8168 4253 4819 4903 5299 NA [7,] 4752 6585 6455 3768 3855 4142 4293 NA [8,] 4977 6847 6141 3066 3584 4101 4542 NA [9,] 4999 6353 6554 4108 4322 4595 3831 NA [10,] 5285 7361 6888 3890 4154 5034 4360 NA [11,] 5747 6929 5339 3420 4656 5407 4088 NA [12,] 1713 1714 1624 1221 1464 1782 1508 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -3062 -3186 -3420 -4140 -1920 -2720 -3104 NA [2,] 901 696 -247 242 1087 1024 825 NA [3,] -1250 -1045 -455 -1120 -1124 -1306 -1906 NA [4,] 410 467 -171 -307 -497 211 411 NA [5,] 133 803 663 391 1289 -86 678 NA [6,] -964 -1073 -1713 -485 -964 -761 -1006 NA [7,] 225 262 -314 -702 -271 -41 249 NA [8,] 22 -494 413 1042 738 494 -711 NA [9,] 286 1008 334 -218 -168 439 529 NA [10,] 462 -432 -1549 -470 502 373 -272 NA [11,] -4034 -5215 -3715 -2199 -3192 -3625 -2580 NA [12,] 8210 10084 7563 4763 6316 6613 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/1ro2v1393845312.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/2gqbq1393845312.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/3kscf1393845312.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/4umoj1393845312.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] [1,] 5984.0 4064.0 5151.0 4027.0 3530.0 4253 3768.0 3066.0 3831 3890.0 3420 [2,] 8087.5 5053.5 5686.5 4189.5 4241.5 4861 3998.5 3842.5 4215 4257.0 4372 [3,] 8584.0 5291.0 6116.0 4778.0 4989.0 5299 4293.0 4542.0 4595 5034.0 5339 [4,] 9555.0 6129.5 6928.0 5780.5 6219.0 6687 5603.5 5559.0 5676 6086.5 5577 [5,] 9923.0 6737.0 8131.0 7676.0 7505.0 8168 6585.0 6847.0 6554 7361.0 6929 [,12] [1,] 1221.0 [2,] 1486.0 [3,] 1624.0 [4,] 1713.5 [5,] 1782.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,] 7707.633 4648.43 5374.596 3827.88 3808.069 4208.542 3334.52 3516.934 [2,] 9460.367 5933.57 6857.404 5728.12 6169.931 6389.458 5251.48 5567.066 [,9] [,10] [,11] [,12] [1,] 3722.514 3941.452 4619.393 1488.141 [2,] 5467.486 6126.548 6058.607 1759.859 $out [1] 11798 8378 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(5984, 8087.5, 8584, 9555, 9923, 4064, 5053.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59x851393845312.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] [1,] -3420 -247.0 -1306.0 -497.0 -86.0 -1073.0 -702.0 -711 -218 -1549.0 [2,] -3303 469.0 -1278.0 -239.0 262.0 -1039.5 -292.5 -236 59 -451.0 [3,] -3104 825.0 -1124.0 211.0 663.0 -964.0 -41.0 413 334 -272.0 [4,] -2891 962.5 -1082.5 410.5 740.5 -862.5 237.0 616 484 417.5 [5,] -2720 1087.0 -1045.0 467.0 1289.0 -761.0 262.0 1042 1008 502.0 [,11] [,12] [1,] -5215.0 4763 [2,] -3874.5 6316 [3,] -3625.0 7088 [4,] -2886.0 8210 [5,] -2199.0 10084 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3350.04 530.2898 -1240.749 -176.8709 377.2475 -1069.7015 -357.2089 [2,] -2857.96 1119.7102 -1007.251 598.8709 948.7525 -858.2985 275.2089 [,8] [,9] [,10] [,11] [,12] [1,] -95.80065 80.19686 -790.6542 -4215.316 5866.309 [2,] 921.80065 587.80314 246.6542 -3034.684 8309.691 $out [1] -4140 -1920 -455 -1906 -1713 -485 $group [1] 1 1 3 3 6 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3420, -3303, -3104, -2891, -2720, -247, 469, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rszh1393845312.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,] 4752.0 6353.0 5339.0 3066 3530.0 4101.0 3831 NA [2,] 4988.0 6486.5 6298.0 3594 3719.5 4368.5 4149 NA [3,] 5403.5 6851.0 7196.5 3999 4109.0 4946.0 4451 NA [4,] 5731.5 7397.0 8149.5 4650 4737.5 5233.5 5295 NA [5,] 6423.0 7658.0 8378.0 5289 5984.0 6084.0 6116 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5064.385 6435.715 6352.018 3517.351 3644.683 4551.468 3928.302 NA [2,] 5742.615 7266.285 8040.982 4480.649 4573.317 5340.532 4973.698 NA $out [1] 8584 1713 9923 1714 11798 1624 9187 1221 1464 7780 1782 8395 [13] 1508 $group [1] 1 1 2 2 3 3 4 4 5 6 6 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(4752, 4988, 5403.5, 5731.5, 6423, 6353, 6486.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73u7k1393845312.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,] 4751.143 4293.0 4700.750 [2,] 4900.857 4568.5 4873.250 [3,] 5240.429 5011.5 5078.375 [4,] 5779.643 5319.0 5682.750 [5,] 6375.286 6116.0 6307.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4839.609 4669.192 4709.157 [2,] 5641.249 5353.808 5447.593 $out [1] 8807.286 1575.143 8584.000 1624.000 8821.250 1599.750 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(4751.14285714286, 4900.85714285714, 5240.42857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ro2v1393845312.ps tmp/1ro2v1393845312.png",intern=TRUE)) character(0) > try(system("convert tmp/2gqbq1393845312.ps tmp/2gqbq1393845312.png",intern=TRUE)) character(0) > try(system("convert tmp/3kscf1393845312.ps tmp/3kscf1393845312.png",intern=TRUE)) character(0) > try(system("convert tmp/4umoj1393845312.ps tmp/4umoj1393845312.png",intern=TRUE)) character(0) > try(system("convert tmp/59x851393845312.ps tmp/59x851393845312.png",intern=TRUE)) character(0) > try(system("convert tmp/6rszh1393845312.ps tmp/6rszh1393845312.png",intern=TRUE)) character(0) > try(system("convert tmp/73u7k1393845312.ps tmp/73u7k1393845312.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.769 1.479 7.246