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) > par1 = '36' > #'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] 2 > 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] 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > arr [,1] [,2] [,3] [1,] 119.5 90.1 118.1 [2,] 125.0 96.9 119.0 [3,] 145.0 125.9 142.7 [4,] 105.3 112.0 123.6 [5,] 116.9 100.0 129.6 [6,] 120.1 123.9 146.9 [7,] 88.9 79.8 108.7 [8,] 78.4 83.4 99.4 [9,] 114.6 113.6 NA [10,] 113.3 112.9 NA [11,] 117.0 104.0 NA [12,] 99.6 109.9 NA [13,] 99.4 99.0 NA [14,] 101.9 106.3 NA [15,] 115.2 128.9 NA [16,] 108.5 111.1 NA [17,] 113.8 102.9 NA [18,] 121.0 130.0 NA [19,] 92.2 87.0 NA [20,] 90.2 87.5 NA [21,] 101.5 117.6 NA [22,] 126.6 103.4 NA [23,] 93.9 110.8 NA [24,] 89.8 112.6 NA [25,] 93.4 102.5 NA [26,] 101.5 112.4 NA [27,] 110.4 135.6 NA [28,] 105.9 105.1 NA [29,] 108.4 127.7 NA [30,] 113.9 137.0 NA [31,] 86.1 91.0 NA [32,] 69.4 90.5 NA [33,] 101.2 122.4 NA [34,] 100.5 123.3 NA [35,] 98.0 124.3 NA [36,] 106.6 120.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/1duvu1225733206.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/27gac1225733206.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/3ag6n1225733206.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/4nixy1225733206.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] [1,] 90.1 96.90 125.90 105.30 100.00 120.1 79.80 78.4 113.6 112.9 104.0 [2,] 104.1 107.95 134.30 108.65 108.45 122.0 84.35 80.9 113.6 112.9 104.0 [3,] 118.1 119.00 142.70 112.00 116.90 123.9 88.90 83.4 114.1 113.1 110.5 [4,] 118.8 122.00 143.85 117.80 123.25 135.4 98.80 91.4 114.6 113.3 117.0 [5,] 119.5 125.00 145.00 123.60 129.60 146.9 108.70 99.4 114.6 113.3 117.0 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 99.60 99.0 101.9 115.20 108.5 102.90 121.0 87.0 87.50 101.50 103.4 [2,] 99.60 99.0 101.9 115.20 108.5 102.90 121.0 87.0 87.50 101.50 103.4 [3,] 104.75 99.2 104.1 122.05 109.8 108.35 125.5 89.6 88.85 109.55 115.0 [4,] 109.90 99.4 106.3 128.90 111.1 113.80 130.0 92.2 90.20 117.60 126.6 [5,] 109.90 99.4 106.3 128.90 111.1 113.80 130.0 92.2 90.20 117.60 126.6 [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [1,] 93.90 89.8 93.40 101.50 110.4 105.1 108.40 113.90 86.10 69.40 101.2 [2,] 93.90 89.8 93.40 101.50 110.4 105.1 108.40 113.90 86.10 69.40 101.2 [3,] 102.35 101.2 97.95 106.95 123.0 105.5 118.05 125.45 88.55 79.95 111.8 [4,] 110.80 112.6 102.50 112.40 135.6 105.9 127.70 137.00 91.00 90.50 122.4 [5,] 110.80 112.6 102.50 112.40 135.6 105.9 127.70 137.00 91.00 90.50 122.4 [,34] [,35] [,36] [1,] 100.5 98.00 106.6 [2,] 100.5 98.00 106.6 [3,] 111.9 111.15 113.3 [4,] 123.3 124.30 120.0 [5,] 123.3 124.30 120.0 $n [1] 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.6905 106.1834 133.9884 103.6532 103.3992 111.6763 75.71852 73.82176 [2,] 131.5095 131.8166 151.4116 120.3468 130.4008 136.1237 102.08148 92.97824 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 112.9828 112.6531 95.97603 93.24254 98.7531 99.1842 106.7440 106.8952 [2,] 115.2172 113.5469 125.02397 116.25746 99.6469 109.0158 137.3560 112.7048 [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 96.1722 115.4449 83.79041 85.83348 91.56262 89.0803 83.46883 75.72719 [2,] 120.5278 135.5551 95.40959 91.86652 127.53738 140.9197 121.23117 126.67281 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [1,] 87.78322 94.7722 94.84584 104.6062 96.48749 99.64202 83.07558 [2,] 108.11678 119.1278 151.15416 106.3938 139.61251 151.25798 94.02442 [,32] [,33] [,34] [,35] [,36] [1,] 56.37647 88.11475 86.42719 81.76688 98.32914 [2,] 103.52353 135.48525 137.37281 140.53312 128.27086 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" Warning message: In bxp(list(stats = c(90.1, 104.1, 118.1, 118.8, 119.5, 96.9, 107.95, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5he471225733206.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] [1,] 69.40 79.80 99.40 [2,] 95.95 99.50 113.40 [3,] 105.60 110.95 121.30 [4,] 114.90 122.85 136.15 [5,] 126.60 137.00 146.90 $n [1] 36 36 8 $conf [,1] [,2] [,3] [1,] 100.6098 104.8012 108.5915 [2,] 110.5902 117.0988 134.0085 $out [1] 145 $group [1] 1 $names [1] "1" "2" NA Warning message: In bxp(list(stats = c(69.4, 95.95, 105.6, 114.9, 126.6, 79.8, 99.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6w5y31225733206.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,] 87.06667 79.950 86.1500 [2,] 101.77500 101.775 101.7750 [3,] 110.15000 110.825 110.8250 [4,] 114.55000 117.475 114.9875 [5,] 130.30000 125.500 128.7000 $n [1] 36 36 36 $conf [,1] [,2] [,3] [1,] 106.7859 106.6907 107.3457 [2,] 113.5141 114.9593 114.3043 $out [1] 137.8667 79.9500 142.7000 139.0750 79.9500 $group [1] 1 1 2 3 3 $names [1] "mean" "median" "midrange" > dev.off() null device 1 > system("convert tmp/1duvu1225733206.ps tmp/1duvu1225733206.png") > system("convert tmp/27gac1225733206.ps tmp/27gac1225733206.png") > system("convert tmp/3ag6n1225733206.ps tmp/3ag6n1225733206.png") > system("convert tmp/4nixy1225733206.ps tmp/4nixy1225733206.png") > system("convert tmp/5he471225733206.ps tmp/5he471225733206.png") > system("convert tmp/6w5y31225733206.ps tmp/6w5y31225733206.png") > > > proc.time() user system elapsed 1.376 0.856 2.048