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(112.6,113.8,107.8,103.2,103.3,101.2,107.7,110.4,101.9,115.9,89.9,88.6,117.2,123.9,100,103.6,94.1,98.7,119.5,112.7,104.4,124.7,89.1,97,121.6,118.8,114,111.5,97.2,102.5,113.4,109.8,104.9,126.1,80,96.8,117.2,112.3,117.3,111.1,102.2,104.3,122.9,107.6,121.3,131.5,89,104.4,128.9,135.9,133.3,121.3,120.5,120.4,137.9,126.1,133.2,146.6,103.4,117.2) > 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,] 112.6 117.2 121.6 117.2 128.9 NA [2,] 113.8 123.9 118.8 112.3 135.9 NA [3,] 107.8 100.0 114.0 117.3 133.3 NA [4,] 103.2 103.6 111.5 111.1 121.3 NA [5,] 103.3 94.1 97.2 102.2 120.5 NA [6,] 101.2 98.7 102.5 104.3 120.4 NA [7,] 107.7 119.5 113.4 122.9 137.9 NA [8,] 110.4 112.7 109.8 107.6 126.1 NA [9,] 101.9 104.4 104.9 121.3 133.2 NA [10,] 115.9 124.7 126.1 131.5 146.6 NA [11,] 89.9 89.1 80.0 89.0 103.4 NA [12,] 88.6 97.0 96.8 104.4 117.2 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/1moat1194611110.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/27pa11194611110.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/3qxz51194611110.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/40mhw1194611110.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,] 112.6 112.3 100.0 103.2 94.1 98.7 107.7 107.6 101.9 115.9 89.0 88.6 [2,] 117.2 113.8 107.8 103.6 97.2 101.2 113.4 109.8 104.4 124.7 89.0 96.8 [3,] 117.2 118.8 114.0 111.1 102.2 102.5 119.5 110.4 104.9 126.1 89.1 97.0 [4,] 121.6 123.9 117.3 111.5 103.3 104.3 122.9 112.7 121.3 131.5 89.9 104.4 [5,] 121.6 135.9 117.3 121.3 103.3 104.3 122.9 112.7 133.2 131.5 89.9 104.4 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 114.0910 111.6634 107.2873 105.5179 97.88976 100.3095 112.7873 108.3509 [2,] 120.3090 125.9366 120.7127 116.6821 106.51024 104.6905 126.2127 112.4491 [,9] [,10] [,11] [,12] [1,] 92.9585 121.2951 88.46406 91.62986 [2,] 116.8415 130.9049 89.73594 102.37014 $out [1] 128.9 133.3 120.5 120.4 137.9 126.1 146.6 80.0 103.4 117.2 $group [1] 1 3 5 6 7 8 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(112.6, 117.2, 117.2, 121.6, 121.6, 112.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/54l4n1194611110.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,] 88.60 89.10 80.00 89.00 103.40 NA [2,] 101.55 97.85 99.85 104.35 120.45 NA [3,] 105.50 104.00 110.65 111.70 127.50 NA [4,] 111.50 118.35 116.40 119.30 134.60 NA [5,] 115.90 124.70 126.10 131.50 146.60 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 100.9617 94.64981 103.1014 104.8812 121.0461 NA [2,] 110.0383 113.35019 118.1986 118.5188 133.9539 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(88.6, 101.55, 105.5, 111.5, 115.9, 89.1, 97.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/68e3e1194611110.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,] 90.28 89.10 89.450 [2,] 104.44 102.35 101.675 [3,] 113.23 110.75 111.900 [4,] 119.89 118.00 118.500 [5,] 128.96 126.10 128.100 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 106.1832 103.6119 104.226 [2,] 120.2768 117.8881 119.574 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(90.28, 104.44, 113.23, 119.89, 128.96, 89.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1moat1194611110.ps tmp/1moat1194611110.png") > system("convert tmp/27pa11194611110.ps tmp/27pa11194611110.png") > system("convert tmp/3qxz51194611110.ps tmp/3qxz51194611110.png") > system("convert tmp/40mhw1194611110.ps tmp/40mhw1194611110.png") > system("convert tmp/54l4n1194611110.ps tmp/54l4n1194611110.png") > system("convert tmp/68e3e1194611110.ps tmp/68e3e1194611110.png") > > > proc.time() user system elapsed 1.375 0.862 1.686