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(119.5,125,145,105.3,116.9,120.1,88.9,78.4,114.6,113.3,117,99.6,99.4,101.9,115.2,108.5,113.8,121,92.2,90.2,101.5,126.6,93.9,89.8,93.4,101.5,110.4,105.9,108.4,113.9,86.1,69.4,101.2,100.5,98,106.6,90.1,96.9,125.9,112,100,123.9,79.8,83.4,113.6,112.9,104,109.9,99,106.3,128.9,111.1,102.9,130,87,87.5,117.6,103.4,110.8,112.6,102.5,112.4,135.6,105.1,127.7,137,91,90.5,122.4,123.3,124.3,120,118.1,119,142.7,123.6,129.6,146.9,108.7,99.4) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > par2 = '' > par1 = '5' > ylab = '' > xlab = '' > main = '' > #'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] 80 > (np <- floor(n / par1)) [1] 16 > 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] 16 16 16 16 16 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 119.5 120.1 117.0 108.5 101.5 101.5 86.1 106.6 100.0 112.9 128.9 87.5 [2,] 125.0 88.9 99.6 113.8 126.6 110.4 69.4 90.1 123.9 104.0 111.1 117.6 [3,] 145.0 78.4 99.4 121.0 93.9 105.9 101.2 96.9 79.8 109.9 102.9 103.4 [4,] 105.3 114.6 101.9 92.2 89.8 108.4 100.5 125.9 83.4 99.0 130.0 110.8 [5,] 116.9 113.3 115.2 90.2 93.4 113.9 98.0 112.0 113.6 106.3 87.0 112.6 [,13] [,14] [,15] [,16] [,17] [1,] 102.5 137.0 124.3 123.6 NA [2,] 112.4 91.0 120.0 129.6 NA [3,] 135.6 90.5 118.1 146.9 NA [4,] 105.1 122.4 119.0 108.7 NA [5,] 127.7 123.3 142.7 99.4 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/1mvua1225737428.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/2vrdb1225737428.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/3igo51225737428.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/4l9ey1225737428.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] [1,] 86.10 69.40 78.40 83.40 87.00 [2,] 101.50 95.30 95.40 99.75 98.70 [3,] 110.70 111.75 103.15 106.85 112.95 [4,] 121.85 121.95 119.55 116.80 116.05 [5,] 137.00 129.60 146.90 130.00 127.70 $n [1] 16 16 16 16 16 $conf [,1] [,2] [,3] [,4] [,5] [1,] 102.6618 101.2232 93.61075 100.1152 106.0967 [2,] 118.7382 122.2768 112.68925 113.5847 119.8032 $out [1] 142.7 $group [1] 5 $names [1] "1" "2" "3" "4" "5" Warning message: In bxp(list(stats = c(86.1, 101.5, 110.7, 121.85, 137, 69.4, 95.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/55fcb1225737428.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] [,11] [,12] [1,] 105.3 78.4 99.4 90.2 89.8 101.5 69.4 90.1 79.8 99.0 87.0 103.4 [2,] 116.9 88.9 99.6 92.2 93.4 105.9 86.1 96.9 83.4 104.0 102.9 103.4 [3,] 119.5 113.3 101.9 108.5 93.9 108.4 98.0 106.6 100.0 106.3 111.1 110.8 [4,] 125.0 114.6 115.2 113.8 101.5 110.4 100.5 112.0 113.6 109.9 128.9 112.6 [5,] 125.0 120.1 117.0 121.0 101.5 113.9 101.2 125.9 123.9 112.9 130.0 117.6 [,13] [,14] [,15] [,16] [,17] [1,] 102.5 90.5 118.1 99.4 NA [2,] 105.1 91.0 119.0 108.7 NA [3,] 112.4 122.4 120.0 123.6 NA [4,] 127.7 123.3 124.3 129.6 NA [5,] 135.6 137.0 124.3 146.9 NA $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 113.7766 95.14044 90.87708 93.2375 88.17656 105.2203 87.825 95.93038 [2,] 125.2234 131.45956 112.92292 123.7625 99.62344 111.5797 108.175 117.26962 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 78.66076 102.1311 92.72847 104.2993 96.4309 99.5769 116.2550 108.8321 [2,] 121.33924 110.4689 129.47153 117.3007 128.3691 145.2231 123.7450 138.3679 [,17] [1,] NA [2,] NA $out [1] 145.0 126.6 87.5 142.7 $group [1] 1 5 12 15 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" NA Warning message: In bxp(list(stats = c(105.3, 116.9, 119.5, 125, 125, 78.4, 88.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6f6jl1225737428.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,] 107.3125 103.15 107.3375 [2,] 108.0500 106.85 107.4875 [3,] 108.3375 110.70 107.9125 [4,] 110.3438 111.75 109.2125 [5,] 111.0938 112.95 111.2375 $n [1] 5 5 5 $conf [,1] [,2] [,3] [1,] 106.7167 107.2377 106.6936 [2,] 109.9583 114.1623 109.1314 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(107.3125, 108.05, 108.3375, 110.34375, 111.09375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1mvua1225737428.ps tmp/1mvua1225737428.png") > system("convert tmp/2vrdb1225737428.ps tmp/2vrdb1225737428.png") > system("convert tmp/3igo51225737428.ps tmp/3igo51225737428.png") > system("convert tmp/4l9ey1225737428.ps tmp/4l9ey1225737428.png") > system("convert tmp/55fcb1225737428.ps tmp/55fcb1225737428.png") > system("convert tmp/6f6jl1225737428.ps tmp/6f6jl1225737428.png") > > > proc.time() user system elapsed 1.292 0.848 1.671