R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(383,349,317,401,285,377,380,347,414,406,487,475,566,604,764,725,585,797,740,587,719,621,677,636,591,636,748,571,475,758,554,597,521,597,658,482,567,605,653,512,653,498,520,606,601,608,732,585,800,721,689,689,777,681,836,594,662,835,702,630,857,847,820,801,900,763,897,687,682,844,687,671) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 383 566 591 567 800 857 NA [2,] 349 604 636 605 721 847 NA [3,] 317 764 748 653 689 820 NA [4,] 401 725 571 512 689 801 NA [5,] 285 585 475 653 777 900 NA [6,] 377 797 758 498 681 763 NA [7,] 380 740 554 520 836 897 NA [8,] 347 587 597 606 594 687 NA [9,] 414 719 521 601 662 682 NA [10,] 406 621 597 608 835 844 NA [11,] 487 677 658 732 702 687 NA [12,] 475 636 482 585 630 671 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -34 38 45 38 -79 -10 NA [2,] -32 160 112 48 -32 -27 NA [3,] 84 -39 -177 -141 0 -19 NA [4,] -116 -140 -96 141 88 99 NA [5,] 92 212 283 -155 -96 -137 NA [6,] 3 -57 -204 22 155 134 NA [7,] -33 -153 43 86 -242 -210 NA [8,] 67 132 -76 -5 68 -5 NA [9,] -8 -98 76 7 173 162 NA [10,] 81 56 61 124 -133 -157 NA [11,] -12 -41 -176 -147 -72 -16 NA [12,] 91 -45 85 215 227 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/16cz41420494048.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/2by111420494048.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/3000f1420494048.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/4q3fh1420494048.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,] 383 604.0 653.0 401 285 377.0 380 587.0 414.0 406.0 658 475.0 [2,] 566 604.0 653.0 512 475 498.0 520 587.0 521.0 597.0 658 482.0 [3,] 579 620.5 718.5 630 619 719.5 647 595.5 631.5 614.5 682 607.5 [4,] 800 721.0 764.0 725 777 763.0 836 606.0 682.0 835.0 702 636.0 [5,] 857 847.0 820.0 801 900 797.0 897 606.0 719.0 844.0 732 671.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 428.0624 545.0312 646.9014 492.6081 424.2002 548.5664 443.1698 583.2444 [2,] 729.9376 695.9688 790.0986 767.3919 813.7998 890.4336 850.8302 607.7556 [,9] [,10] [,11] [,12] [1,] 527.6498 460.9823 653.6186 508.165 [2,] 735.3502 768.0177 710.3814 706.835 $out [1] 349 317 347 687 487 $group [1] 2 3 8 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(383, 566, 579, 800, 857, 604, 604, 620.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gx6j1420494048.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,] -79 -32.0 -177 -140 -155 -204.0 -242 -76 -98.0 -157.0 -176.0 -45 [2,] -34 -32.0 -141 -116 -137 -57.0 -210 -5 -8.0 -133.0 -147.0 85 [3,] 14 10.5 -29 -4 -2 12.5 -93 31 41.5 58.5 -56.5 91 [4,] 38 112.0 0 99 212 134.0 43 68 162.0 81.0 -16.0 215 [5,] 45 160.0 84 141 283 155.0 86 132 173.0 124.0 -12.0 227 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -32.44233 -82.38465 -119.94955 -142.6819 -227.1163 -110.7012 -256.19317 [2,] 60.44233 103.38465 61.94955 134.6819 223.1163 135.7012 70.19317 [,8] [,9] [,10] [,11] [,12] [1,] -16.08736 -68.15549 -79.53691 -140.99923 -0.8576725 [2,] 78.08736 151.15549 196.53691 27.99923 182.8576725 $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(-79, -34, 14, 38, 45, -32, -32, 10.5, 112, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/699er1420494048.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] [1,] 285.0 566.0 475.0 498.0 594.0 671.0 NA [2,] 348.0 595.5 537.5 543.5 671.5 687.0 NA [3,] 381.5 656.5 594.0 603.0 695.5 810.5 NA [4,] 410.0 732.5 647.0 630.5 788.5 852.0 NA [5,] 487.0 797.0 758.0 732.0 836.0 900.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 353.2214 594.0134 544.0563 563.3187 642.1355 735.2424 NA [2,] 409.7786 718.9866 643.9437 642.6813 748.8645 885.7576 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(285, 348, 381.5, 410, 487, 566, 595.5, 656.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79vjd1420494048.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,] 569.6667 579.00 571.1250 [2,] 606.1667 611.00 615.1875 [3,] 627.1667 625.25 652.3750 [4,] 653.1667 664.50 675.3750 [5,] 665.1667 719.50 711.0000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 605.7297 600.8483 624.9231 [2,] 648.6037 649.6517 679.8269 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(569.666666666667, 606.166666666667, 627.166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16cz41420494048.ps tmp/16cz41420494048.png",intern=TRUE)) character(0) > try(system("convert tmp/2by111420494048.ps tmp/2by111420494048.png",intern=TRUE)) character(0) > try(system("convert tmp/3000f1420494048.ps tmp/3000f1420494048.png",intern=TRUE)) character(0) > try(system("convert tmp/4q3fh1420494048.ps tmp/4q3fh1420494048.png",intern=TRUE)) character(0) > try(system("convert tmp/5gx6j1420494048.ps tmp/5gx6j1420494048.png",intern=TRUE)) character(0) > try(system("convert tmp/699er1420494048.ps tmp/699er1420494048.png",intern=TRUE)) character(0) > try(system("convert tmp/79vjd1420494048.ps tmp/79vjd1420494048.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.585 0.489 3.100