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(882.5,789.6,773.3,804.3,817.8,836.7,721.8,760.8,841.4,1045.6,949.2,850.1,957.4,851.8,913.9,888,973.8,927.6,833,879.5,797.3,834.5,735.1,835,892.8,697.2,821.1,732.7,797.6,866.3,826.3,778.6,779.2,951,692.3,841.4,857.3,760.7,841.2,810.3,1007.4,931.3,931.2,855.8,858.4,925.9,930.7,1037.6,979.2,942.6,843.9,854.3,1029.8,944,856.4,1059.4,959.3,941.5,1026.4,921.3,968) > 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,] 882.5 957.4 892.8 857.3 979.2 968 [2,] 789.6 851.8 697.2 760.7 942.6 NA [3,] 773.3 913.9 821.1 841.2 843.9 NA [4,] 804.3 888.0 732.7 810.3 854.3 NA [5,] 817.8 973.8 797.6 1007.4 1029.8 NA [6,] 836.7 927.6 866.3 931.3 944.0 NA [7,] 721.8 833.0 826.3 931.2 856.4 NA [8,] 760.8 879.5 778.6 855.8 1059.4 NA [9,] 841.4 797.3 779.2 858.4 959.3 NA [10,] 1045.6 834.5 951.0 925.9 941.5 NA [11,] 949.2 735.1 692.3 930.7 1026.4 NA [12,] 850.1 835.0 841.4 1037.6 921.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/1eimh1225742677.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/2pjh51225742677.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/3py941225742677.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/4qdhl1225742677.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,] 857.3 697.2 821.1 732.7 797.6 836.7 826.3 760.8 779.2 925.9 692.3 835.0 [2,] 882.5 760.7 821.1 804.3 817.8 866.3 826.3 778.6 797.3 925.9 735.1 841.4 [3,] 925.1 789.6 841.2 810.3 973.8 927.6 833.0 855.8 841.4 941.5 930.7 850.1 [4,] 968.0 851.8 843.9 854.3 1007.4 931.3 856.4 879.5 858.4 951.0 949.2 921.3 [5,] 979.2 942.6 843.9 888.0 1029.8 944.0 856.4 879.5 858.4 951.0 1026.4 1037.6 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 869.9497 725.229 825.0896 774.9701 839.8291 881.6712 811.7314 784.5043 [2,] 980.2503 853.971 857.3104 845.6299 1107.7709 973.5288 854.2686 927.0957 [,9] [,10] [,11] [,12] [1,] 798.2269 923.7644 779.4175 793.6429 [2,] 884.5731 959.2356 1081.9825 906.5571 $out [1] 773.3 913.9 721.8 931.2 1059.4 959.3 1045.6 834.5 $group [1] 3 3 7 7 8 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(857.3, 882.5, 925.1, 968, 979.2, 697.2, 760.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5df1l1225742677.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,] 721.80 735.10 692.30 760.70 843.90 968 [2,] 781.45 833.75 755.65 848.50 888.85 968 [3,] 827.25 865.65 809.35 892.15 943.30 968 [4,] 866.30 920.75 853.85 931.25 1002.80 968 [5,] 949.20 973.80 951.00 1037.60 1059.40 968 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 788.5493 825.9687 764.5603 854.4072 891.3266 968 [2,] 865.9507 905.3313 854.1397 929.8928 995.2734 968 $out [1] 1045.6 $group [1] 1 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(721.8, 781.45, 827.25, 866.3, 949.2, 735.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6dp271225742677.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,] 808.3800 789.60 806.250 [2,] 836.2100 837.10 829.175 [3,] 866.7800 852.95 841.750 [4,] 912.0233 929.15 905.700 [5,] 939.7000 973.80 938.450 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 832.201 810.9654 806.8464 [2,] 901.359 894.9346 876.6536 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(808.38, 836.21, 866.78, 912.023333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1eimh1225742677.ps tmp/1eimh1225742677.png") > system("convert tmp/2pjh51225742677.ps tmp/2pjh51225742677.png") > system("convert tmp/3py941225742677.ps tmp/3py941225742677.png") > system("convert tmp/4qdhl1225742677.ps tmp/4qdhl1225742677.png") > system("convert tmp/5df1l1225742677.ps tmp/5df1l1225742677.png") > system("convert tmp/6dp271225742677.ps tmp/6dp271225742677.png") > > > proc.time() user system elapsed 1.276 0.830 1.529