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(10230.4,9221,9428.6,10934.5,10986,11724.6,11180.9,11163.2,11240.9,12107.1,10762.3,11340.4,11266.8,9542.7,9227.7,10571.9,10774.4,10392.8,9920.2,9884.9,10174.5,11395.4,10760.2,10570.1,10536,9902.6,8889,10837.3,11624.1,10509,10984.9,10649.1,10855.7,11677.4,10760.2,10046.2,10772.8,9987.7,8638.7,11063.7,11855.7,10684.5,11337.4,10478,11123.9,12909.3,11339.9,10462.2,12733.5,10519.2,10414.9,12476.8,12384.6,12266.7,12919.9,11497.3,12142,13919.4,12656.8,12034.1,13199.7,10881.3,11301.2,13643.9,12517,13981.1,14275.7,13435,13565.7,16216.3,12970,14079.9,14235,12213.4,12581,14130.4,14210.8,14378.5,13142.8,13714.7,13621.9,15379.8,13306.3,14391.2,14909.9,14025.4,12951.2,14344.3,16213.3,15544.5,14750.6,17292.7,17568.5,17930.8,18644.7,16694.8,17242.8) > 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] 97 > (np <- floor(n / par1)) [1] 8 > 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] 9 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 10230.4 11266.8 10536.0 10772.8 12733.5 13199.7 14235.0 14909.9 17242.8 [2,] 9221.0 9542.7 9902.6 9987.7 10519.2 10881.3 12213.4 14025.4 NA [3,] 9428.6 9227.7 8889.0 8638.7 10414.9 11301.2 12581.0 12951.2 NA [4,] 10934.5 10571.9 10837.3 11063.7 12476.8 13643.9 14130.4 14344.3 NA [5,] 10986.0 10774.4 11624.1 11855.7 12384.6 12517.0 14210.8 16213.3 NA [6,] 11724.6 10392.8 10509.0 10684.5 12266.7 13981.1 14378.5 15544.5 NA [7,] 11180.9 9920.2 10984.9 11337.4 12919.9 14275.7 13142.8 14750.6 NA [8,] 11163.2 9884.9 10649.1 10478.0 11497.3 13435.0 13714.7 17292.7 NA [9,] 11240.9 10174.5 10855.7 11123.9 12142.0 13565.7 13621.9 17568.5 NA [10,] 12107.1 11395.4 11677.4 12909.3 13919.4 16216.3 15379.8 17930.8 NA [11,] 10762.3 10760.2 10760.2 11339.9 12656.8 12970.0 13306.3 18644.7 NA [12,] 11340.4 10570.1 10046.2 10462.2 12034.1 14079.9 14391.2 16694.8 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/1dd9e1225388716.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/2p7g21225388716.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/3kxn61225388716.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/4ygkn1225388716.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] [1,] 10230.4 9221.00 8638.70 10571.90 10774.40 10392.80 9920.20 9884.90 [2,] 10772.8 9722.65 9058.35 10885.90 11305.05 10596.75 11082.90 10563.55 [3,] 12733.5 10253.45 9921.75 11770.25 12120.15 11995.65 12128.65 11330.25 [4,] 14235.0 11547.35 11941.10 13887.15 13363.90 14179.80 13709.25 13574.85 [5,] 17242.8 14025.40 12951.20 14344.30 16213.30 15544.50 14750.60 17292.70 [,9] [,10] [,11] [,12] [1,] 10174.50 11395.40 10760.20 10046.20 [2,] 10989.80 11892.25 10761.25 10516.15 [3,] 11691.45 13414.35 11998.35 11687.25 [4,] 13593.80 15798.05 13138.15 14235.55 [5,] 13621.90 17930.80 13306.30 16694.80 $n [1] 9 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 10910.07 9234.146 8311.404 10093.71 10970.05 9994.107 10661.53 [2,] 14556.93 11272.754 11532.096 13446.79 13270.25 13997.193 13595.77 [,8] [,9] [,10] [,11] [,12] [1,] 9648.095 10236.82 11232.51 10670.58 9609.54 [2,] 13012.405 13146.08 15596.19 13326.12 13764.96 $out [1] 17568.5 18644.7 $group [1] 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(10230.4, 10772.8, 12733.5, 14235, 17242.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/506ig1225388716.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] [,7] [,8] [1,] 9428.60 9227.70 9902.60 9987.70 10414.90 10881.30 12213.40 12951.20 [2,] 10496.35 9902.55 10277.60 10470.10 11765.70 12743.50 13224.55 14547.45 [3,] 11074.60 10481.45 10704.65 10918.25 12325.65 13500.35 13922.55 15878.90 [4,] 11290.65 10767.30 10920.30 11338.65 12695.15 14030.50 14306.75 17430.60 [5,] 12107.10 11395.40 11677.40 11855.70 13919.40 14275.70 15379.80 18644.70 [,9] [1,] 17242.8 [2,] 17242.8 [3,] 17242.8 [4,] 17242.8 [5,] 17242.8 $n [1] 12 12 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 10712.31 10087.03 10411.51 10522.10 11901.72 12913.34 13428.95 14563.88 [2,] 11436.89 10875.87 10997.79 11314.40 12749.58 14087.36 14416.15 17193.92 [,9] [1,] 17242.8 [2,] 17242.8 $out [1] 9221.0 8889.0 8638.7 12909.3 16216.3 $group [1] 1 3 4 4 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(9428.6, 10496.35, 11074.6, 11290.65, 12107.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6qkz41225388716.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,] 12250.35 11330.25 11907.92 [2,] 12257.36 11508.75 11981.77 [3,] 12443.79 11882.95 12298.63 [4,] 12610.39 12124.40 12355.48 [5,] 12791.88 12733.50 12503.90 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 12282.76 11602.15 12128.18 [2,] 12604.81 12163.75 12469.08 $out [1] 10786.66 10429.04 13941.94 10253.45 9921.75 13414.35 10513.47 10382.09 [9] 13794.30 $group [1] 1 1 1 2 2 2 3 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(12250.35, 12257.35625, 12443.7875, 12610.39375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1dd9e1225388716.ps tmp/1dd9e1225388716.png") > system("convert tmp/2p7g21225388716.ps tmp/2p7g21225388716.png") > system("convert tmp/3kxn61225388716.ps tmp/3kxn61225388716.png") > system("convert tmp/4ygkn1225388716.ps tmp/4ygkn1225388716.png") > system("convert tmp/506ig1225388716.ps tmp/506ig1225388716.png") > system("convert tmp/6qkz41225388716.ps tmp/6qkz41225388716.png") > > > proc.time() user system elapsed 1.921 1.247 2.128