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(692.4,877.3,536.8,705.9,951,755.7,695.5,744.8,672.1,666.6,760.8,756,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) > 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] 60 > (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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 692.4 604.4 753.0 792.1 681.2 NA [2,] 877.3 883.9 762.0 826.8 837.3 NA [3,] 536.8 527.9 613.7 666.8 674.7 NA [4,] 705.9 756.2 759.2 906.6 806.3 NA [5,] 951.0 812.9 816.4 871.4 860.2 NA [6,] 755.7 655.6 736.8 891.0 689.8 NA [7,] 695.5 707.6 680.1 739.2 691.6 NA [8,] 744.8 612.6 736.5 833.6 682.6 NA [9,] 672.1 659.2 637.2 715.6 800.1 NA [10,] 666.6 833.4 801.9 871.6 1023.7 NA [11,] 760.8 727.8 772.3 751.6 733.5 NA [12,] 756.0 797.2 897.3 1005.5 875.3 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/rcomp/tmp/1yswo1225666634.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/rcomp/tmp/2rds01225666634.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/rcomp/tmp/3j9ka1225666634.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/rcomp/tmp/4hgzy1225666634.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,] 604.4 762.0 527.9 705.9 812.9 655.6 680.1 612.6 637.2 801.9 727.8 756.0 [2,] 681.2 826.8 536.8 756.2 816.4 689.8 691.6 682.6 659.2 801.9 733.5 797.2 [3,] 692.4 837.3 613.7 759.2 860.2 736.8 695.5 736.5 672.1 833.4 751.6 875.3 [4,] 753.0 877.3 666.8 806.3 871.4 755.7 707.6 744.8 715.6 871.6 760.8 897.3 [5,] 792.1 883.9 674.7 806.3 951.0 755.7 707.6 833.6 800.1 871.6 772.3 1005.5 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 641.6663 801.6168 521.8423 723.7995 821.3371 690.2352 684.1944 692.5496 [2,] 743.1337 872.9832 705.5577 794.6005 899.0629 783.3648 706.8056 780.4504 [,9] [,10] [,11] [,12] [1,] 632.2479 784.1502 732.3099 804.5696 [2,] 711.9521 882.6498 770.8901 946.0304 $out [1] 906.6 891.0 739.2 666.6 1023.7 $group [1] 4 6 7 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(604.4, 681.2, 692.4, 753, 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/rcomp/tmp/5dgxm1225666634.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,] 666.60 527.90 613.7 666.8 674.70 NA [2,] 682.25 634.10 708.3 745.4 686.20 NA [3,] 725.35 717.70 756.1 830.2 766.80 NA [4,] 758.40 805.05 787.1 881.3 848.75 NA [5,] 760.80 883.90 897.3 1005.5 1023.70 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 690.6175 639.7286 720.1588 768.2151 692.6599 NA [2,] 760.0825 795.6714 792.0412 892.1849 840.9401 NA $out [1] 877.3 536.8 951.0 $group [1] 1 1 1 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(666.6, 682.25, 725.35, 758.4, 760.8, 527.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/62zmh1225666634.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,] 603.98 613.70 601.800 [2,] 703.71 693.95 706.650 [3,] 747.49 744.20 734.950 [4,] 838.45 835.35 840.325 [5,] 866.26 875.30 852.050 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 686.0342 679.7065 673.98 [2,] 808.9458 808.6935 795.92 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(603.98, 703.71, 747.49, 838.45, 866.26, 613.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1yswo1225666634.ps tmp/1yswo1225666634.png") > system("convert tmp/2rds01225666634.ps tmp/2rds01225666634.png") > system("convert tmp/3j9ka1225666634.ps tmp/3j9ka1225666634.png") > system("convert tmp/4hgzy1225666634.ps tmp/4hgzy1225666634.png") > system("convert tmp/5dgxm1225666634.ps tmp/5dgxm1225666634.png") > system("convert tmp/62zmh1225666634.ps tmp/62zmh1225666634.png") > > > proc.time() user system elapsed 1.279 0.809 1.545