R version 2.7.2 (2008-08-25) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(604.4,883.9,527.9,756.2,812.9,655.6,707.6,612.6,659.2,833.4,727.8,797.2,753,762,613.7,759.2,816.4,736.8,680.1,736.5,637.2,801.9,772.3,897.3,792.1,826.8,666.8,906.6,871.4,891,739.2,833.6,715.6,871.6,751.6,1005.5,681.2,837.3,674.7,806.3,860.2,689.8,691.6,682.6,800.1,1023.7,733.5,875.3,770.2,1005.7,982.3,742.9,974.2,822.3,773.2,750.9,708,690,652.8,620.7,461.9) > par1 = '12' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Mean Plot (v1.0.1) 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 > #Technical description: Write here your technical program description > par1 <- as.numeric(par1) > (n <- length(x)) [1] 61 > (np <- floor(n / par1)) [1] 5 > arr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + if (j == par1) j = 0 + } > ari [1] 6 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 604.4 753.0 792.1 681.2 770.2 461.9 [2,] 883.9 762.0 826.8 837.3 1005.7 NA [3,] 527.9 613.7 666.8 674.7 982.3 NA [4,] 756.2 759.2 906.6 806.3 742.9 NA [5,] 812.9 816.4 871.4 860.2 974.2 NA [6,] 655.6 736.8 891.0 689.8 822.3 NA [7,] 707.6 680.1 739.2 691.6 773.2 NA [8,] 612.6 736.5 833.6 682.6 750.9 NA [9,] 659.2 637.2 715.6 800.1 708.0 NA [10,] 833.4 801.9 871.6 1023.7 690.0 NA [11,] 727.8 772.3 751.6 733.5 652.8 NA [12,] 797.2 897.3 1005.5 875.3 620.7 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/www/html/freestat/rcomp/tmp/1n3ea1225742317.ps",horizontal=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/www/html/freestat/rcomp/tmp/2l42h1225742317.ps",horizontal=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/www/html/freestat/rcomp/tmp/3m2w11225742317.ps",horizontal=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/www/html/freestat/rcomp/tmp/4fcwx1225742317.ps",horizontal=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,] 461.9 762.0 527.9 742.9 812.9 655.6 680.1 612.6 637.2 801.9 727.8 797.2 [2,] 604.4 826.8 613.7 756.2 816.4 689.8 691.6 682.6 659.2 801.9 727.8 797.2 [3,] 717.1 837.3 666.8 759.2 860.2 736.8 707.6 736.5 708.0 833.4 733.5 875.3 [4,] 770.2 883.9 674.7 806.3 871.4 822.3 739.2 750.9 715.6 871.6 751.6 897.3 [5,] 792.1 883.9 674.7 806.3 871.4 891.0 773.2 833.6 800.1 871.6 772.3 1005.5 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 610.1536 796.9533 623.6976 723.7995 821.3371 643.1758 673.966 688.2394 [2,] 824.0464 877.6467 709.9024 794.6005 899.0629 830.4242 741.234 784.7606 [,9] [,10] [,11] [,12] [1,] 668.1479 784.1502 716.683 804.5696 [2,] 747.8521 882.6498 750.317 946.0304 $out [1] 1005.7 982.3 906.6 974.2 1023.7 690.0 652.8 620.7 $group [1] 2 3 4 5 10 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(461.9, 604.4, 717.1, 770.2, 792.1, 762, 826.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5apjt1225742317.ps",horizontal=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,] 527.90 613.7 666.8 674.70 620.70 461.9 [2,] 634.10 708.3 745.4 686.20 699.00 461.9 [3,] 717.70 756.1 830.2 766.80 760.55 461.9 [4,] 805.05 787.1 881.3 848.75 898.25 461.9 [5,] 883.90 897.3 1005.5 1023.70 1005.70 461.9 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 639.7286 720.1588 768.2151 692.6599 669.6707 461.9 [2,] 795.6714 792.0412 892.1849 840.9401 851.4293 461.9 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(527.9, 634.1, 717.7, 805.05, 883.9, 613.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6q2fk1225742317.ps",horizontal=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,] 677.1333 666.80 644.200 [2,] 711.1800 712.55 705.075 [3,] 743.3500 736.65 747.875 [4,] 841.6600 835.35 840.325 [5,] 867.0200 875.30 855.350 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 683.8372 680.6401 686.1866 [2,] 802.8628 792.6599 809.5634 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(677.133333333333, 711.18, 743.35, 841.66, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1n3ea1225742317.ps tmp/1n3ea1225742317.png") > system("convert tmp/2l42h1225742317.ps tmp/2l42h1225742317.png") > system("convert tmp/3m2w11225742317.ps tmp/3m2w11225742317.png") > system("convert tmp/4fcwx1225742317.ps tmp/4fcwx1225742317.png") > system("convert tmp/5apjt1225742317.ps tmp/5apjt1225742317.png") > system("convert tmp/6q2fk1225742317.ps tmp/6q2fk1225742317.png") > > > proc.time() user system elapsed 1.955 1.277 2.615