R version 2.6.0 (2007-10-03) Copyright (C) 2007 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(174.1,180.4,182.6,207.1,213.7,186.5,179.1,168.3,156.5,144.3,138.9,137.8,136.3,140.3,149.1,149.2,140.4,129,124.7,130.8,130.1,133.2,130.1,126.6,124.8,125.3,126.9,120.1,118.7,117.7,113.4,107.5,107.6,114.3,114.9,111.2,109.9,108.6,109.2,106.4,103.7,103,96.9,104.7,102.2,99,95.8,94.5,102.7,103.2,105.6,103.9,107.2,100.7,92.1,90.3,93.4,98.5,100.8,102.3,104.7,101.1,101.4,99.5,98.4,96.3,100.7,101.2,100.3,97.8,97.4,98.6,99.7,99,98.1,97,98.5,103.8,114.4,124.5,134.2,131.8,125.6,119.9,114.9,115.5,112.5,111.4,115.3,110.8,103.7,111.1,113,111.2,117.6,121.7,127.3,129.8,137.1,141.4,137.4,130.7,117.2,110.8,111.4,108.2,108.8,110.2,109.5,109.5,116,111.2,112.1,114,119.1,114.1,115.1,115.4,110.8,116,119.2,126.5,127.8,131.3,140.3,137.3,143,134.5,139.9,159.3,170.4,175,175.8,180.9,180.3,169.6,172.3,184.8,177.7,184.6,211.4) > 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] 141 > (np <- floor(n / par1)) [1] 11 > 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] 12 12 12 12 12 12 12 12 12 11 11 11 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 174.1 136.3 124.8 109.9 102.7 104.7 99.7 114.9 127.3 109.5 119.2 175.8 [2,] 180.4 140.3 125.3 108.6 103.2 101.1 99.0 115.5 129.8 109.5 126.5 180.9 [3,] 182.6 149.1 126.9 109.2 105.6 101.4 98.1 112.5 137.1 116.0 127.8 180.3 [4,] 207.1 149.2 120.1 106.4 103.9 99.5 97.0 111.4 141.4 111.2 131.3 169.6 [5,] 213.7 140.4 118.7 103.7 107.2 98.4 98.5 115.3 137.4 112.1 140.3 172.3 [6,] 186.5 129.0 117.7 103.0 100.7 96.3 103.8 110.8 130.7 114.0 137.3 184.8 [7,] 179.1 124.7 113.4 96.9 92.1 100.7 114.4 103.7 117.2 119.1 143.0 177.7 [8,] 168.3 130.8 107.5 104.7 90.3 101.2 124.5 111.1 110.8 114.1 134.5 184.6 [9,] 156.5 130.1 107.6 102.2 93.4 100.3 134.2 113.0 111.4 115.1 139.9 211.4 [10,] 144.3 133.2 114.3 99.0 98.5 97.8 131.8 111.2 108.2 115.4 159.3 NA [11,] 138.9 130.1 114.9 95.8 100.8 97.4 125.6 117.6 108.8 110.8 170.4 NA [12,] 137.8 126.6 111.2 94.5 102.3 98.6 119.9 121.7 110.2 116.0 175.0 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/18aem1196417070.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/2f7sp1196417070.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/3jn131196417070.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/4frcv1196417070.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] [1,] 99.70 99.00 98.10 97.00 98.40 96.30 92.10 90.30 93.40 97.8 [2,] 107.10 105.90 107.40 105.15 105.45 103.40 102.20 106.10 104.90 103.6 [3,] 117.05 120.40 121.45 115.75 117.00 115.85 115.80 112.60 114.05 114.3 [4,] 131.80 135.05 143.10 145.30 140.35 134.00 133.85 132.65 137.05 132.5 [5,] 136.30 140.30 182.60 169.60 172.30 137.30 179.10 168.30 156.50 159.3 [,11] [,12] [1,] 95.80 94.50 [2,] 104.80 106.25 [3,] 114.90 116.00 [4,] 127.85 124.15 [5,] 138.90 137.80 $n [1] 12 12 12 12 12 12 12 12 12 11 11 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.7842 107.1045 105.167 97.43732 101.0819 101.8931 101.3642 100.4904 [2,] 128.3158 133.6955 137.733 134.06268 132.9181 129.8069 130.2358 124.7096 [,9] [,10] [,11] [,12] [1,] 99.38617 100.5324 103.9193 107.4727 [2,] 128.71383 128.0676 125.8807 124.5273 $out [1] 174.1 175.8 180.4 180.9 207.1 213.7 186.5 184.8 184.6 211.4 170.4 175.0 $group [1] 1 1 2 2 4 5 6 6 8 9 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(99.7, 107.1, 117.05, 131.8, 136.3, 99, 105.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5pfpm1196417070.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] [,9] [,10] [1,] 137.80 124.70 107.50 94.50 90.30 96.30 97.00 110.80 108.20 109.50 [2,] 150.40 129.55 112.30 97.95 95.95 98.10 98.75 111.15 110.50 111.00 [3,] 176.60 132.00 116.30 103.35 101.55 99.90 109.10 112.75 122.25 114.05 [4,] 184.55 140.35 122.45 107.50 103.55 101.15 125.05 115.40 133.90 115.70 [5,] 213.70 149.20 126.90 109.90 107.20 104.70 134.20 121.70 141.40 119.10 [,11] [,12] [1,] 119.20 169.6 [2,] 129.55 175.8 [3,] 138.60 180.3 [4,] 151.15 184.6 [5,] 175.00 184.8 $n [1] 12 12 12 12 12 12 12 12 12 12 12 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 161.0240 127.0740 111.6705 98.99418 98.08359 98.50887 97.1044 110.8115 [2,] 192.1760 136.9260 120.9295 107.70582 105.01641 101.29113 121.0956 114.6885 [,9] [,10] [,11] [,12] [1,] 111.5771 111.9063 128.7481 175.6653 [2,] 132.9229 116.1937 148.4519 184.9347 $out [1] 103.7 211.4 $group [1] 8 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" NA Warning message: In bxp(list(stats = c(137.8, 150.4, 176.6, 184.55, 213.7, 124.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6bt5h1196417070.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,] 119.1909 112.600 115.2000 [2,] 121.4682 114.600 117.1500 [3,] 125.5625 115.825 119.0938 [4,] 127.7792 117.025 122.1313 [5,] 129.8333 120.400 124.5625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 122.6840 114.7189 116.8218 [2,] 128.4410 116.9311 121.3657 $out [1] 121.45 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(119.190909090909, 121.468181818182, 125.5625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/18aem1196417070.ps tmp/18aem1196417070.png") > system("convert tmp/2f7sp1196417070.ps tmp/2f7sp1196417070.png") > system("convert tmp/3jn131196417070.ps tmp/3jn131196417070.png") > system("convert tmp/4frcv1196417070.ps tmp/4frcv1196417070.png") > system("convert tmp/5pfpm1196417070.ps tmp/5pfpm1196417070.png") > system("convert tmp/6bt5h1196417070.ps tmp/6bt5h1196417070.png") > > > proc.time() user system elapsed 1.301 0.816 1.667