R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(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,215.3,215.9,244.7,259.3,289,310.9,321,315.1,333.2,314.1,284.7,273.9,216,196.4,190.9,206.4,196.3,199.5,198.9,214.4,214.2,187.6,180.6,172.2,187.2) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > par2 = '' > par1 = '12' > 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] 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,] 108.2 115.4 159.3 215.3 216.0 187.2 [2,] 108.8 110.8 170.4 215.9 196.4 NA [3,] 110.2 116.0 175.0 244.7 190.9 NA [4,] 109.5 119.2 175.8 259.3 206.4 NA [5,] 109.5 126.5 180.9 289.0 196.3 NA [6,] 116.0 127.8 180.3 310.9 199.5 NA [7,] 111.2 131.3 169.6 321.0 198.9 NA [8,] 112.1 140.3 172.3 315.1 214.4 NA [9,] 114.0 137.3 184.8 333.2 214.2 NA [10,] 119.1 143.0 177.7 314.1 187.6 NA [11,] 114.1 134.5 184.6 284.7 180.6 NA [12,] 115.1 139.9 211.4 273.9 172.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/1gskm1261409249.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/244e71261409249.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/3j38g1261409249.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/44edr1261409249.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,] 108.20 108.8 110.2 109.5 109.5 116.0 111.2 112.1 114.0 119.1 114.1 115.1 [2,] 115.40 110.8 116.0 119.2 126.5 127.8 131.3 140.3 137.3 143.0 134.5 139.9 [3,] 173.25 170.4 175.0 175.8 180.9 180.3 169.6 172.3 184.8 177.7 180.6 172.2 [4,] 215.30 196.4 190.9 206.4 196.3 199.5 198.9 214.4 214.2 187.6 184.6 211.4 [5,] 216.00 215.9 244.7 259.3 289.0 199.5 198.9 315.1 214.2 187.6 184.6 273.9 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 108.8113 109.9153 122.0758 114.1847 131.5795 129.6370 121.834 119.9411 [2,] 237.6887 230.8847 227.9242 237.4153 230.2205 230.9630 217.366 224.6589 [,9] [,10] [,11] [,12] [1,] 130.4627 146.1858 145.1995 121.6783 [2,] 239.1373 209.2142 216.0005 222.7217 $out [1] 310.9 321.0 333.2 314.1 284.7 $group [1] 6 7 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(108.2, 115.4, 173.25, 215.3, 216, 108.8, 110.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5icjy1261409249.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,] 108.20 110.80 159.30 215.30 172.20 187.2 [2,] 109.50 117.60 171.35 252.00 189.25 187.2 [3,] 111.65 129.55 176.75 286.85 197.65 187.2 [4,] 114.60 138.60 182.75 314.60 210.30 187.2 [5,] 119.10 143.00 184.80 333.20 216.00 187.2 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 109.3239 119.9718 171.5504 258.2977 188.0490 187.2 [2,] 113.9761 139.1282 181.9496 315.4023 207.2510 187.2 $out [1] 211.4 $group [1] 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(108.2, 109.5, 111.65, 114.6, 119.1, 110.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6uwmj1261409249.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,] 160.46 169.60 153.4500 [2,] 170.70 172.25 160.4750 [3,] 181.47 175.40 164.3750 [4,] 187.60 180.45 171.4875 [5,] 196.70 184.80 177.3500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 173.7618 171.6599 159.3521 [2,] 189.1782 179.1401 169.3979 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(160.46, 170.7, 181.47, 187.6, 196.7, 169.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1gskm1261409249.ps tmp/1gskm1261409249.png",intern=TRUE)) character(0) > try(system("convert tmp/244e71261409249.ps tmp/244e71261409249.png",intern=TRUE)) character(0) > try(system("convert tmp/3j38g1261409249.ps tmp/3j38g1261409249.png",intern=TRUE)) character(0) > try(system("convert tmp/44edr1261409249.ps tmp/44edr1261409249.png",intern=TRUE)) character(0) > try(system("convert tmp/5icjy1261409249.ps tmp/5icjy1261409249.png",intern=TRUE)) character(0) > try(system("convert tmp/6uwmj1261409249.ps tmp/6uwmj1261409249.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.046 0.793 1.953