R version 2.5.1 (2007-06-27) 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(97.3,101,113.2,101,105.7,113.9,86.4,96.5,103.3,114.9,105.8,94.2,98.4,99.4,108.8,112.6,104.4,112.2,81.1,97.1,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 = '80' > #'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] 1 > 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] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [77] 1 1 1 1 > arr [,1] [,2] [1,] 97.3 NA [2,] 101.0 NA [3,] 113.2 NA [4,] 101.0 NA [5,] 105.7 NA [6,] 113.9 NA [7,] 86.4 NA [8,] 96.5 NA [9,] 103.3 NA [10,] 114.9 NA [11,] 105.8 NA [12,] 94.2 NA [13,] 98.4 NA [14,] 99.4 NA [15,] 108.8 NA [16,] 112.6 NA [17,] 104.4 NA [18,] 112.2 NA [19,] 81.1 NA [20,] 97.1 NA [21,] 112.6 NA [22,] 113.8 NA [23,] 107.8 NA [24,] 103.2 NA [25,] 103.3 NA [26,] 101.2 NA [27,] 107.7 NA [28,] 110.4 NA [29,] 101.9 NA [30,] 115.9 NA [31,] 89.9 NA [32,] 88.6 NA [33,] 117.2 NA [34,] 123.9 NA [35,] 100.0 NA [36,] 103.6 NA [37,] 94.1 NA [38,] 98.7 NA [39,] 119.5 NA [40,] 112.7 NA [41,] 104.4 NA [42,] 124.7 NA [43,] 89.1 NA [44,] 97.0 NA [45,] 121.6 NA [46,] 118.8 NA [47,] 114.0 NA [48,] 111.5 NA [49,] 97.2 NA [50,] 102.5 NA [51,] 113.4 NA [52,] 109.8 NA [53,] 104.9 NA [54,] 126.1 NA [55,] 80.0 NA [56,] 96.8 NA [57,] 117.2 NA [58,] 112.3 NA [59,] 117.3 NA [60,] 111.1 NA [61,] 102.2 NA [62,] 104.3 NA [63,] 122.9 NA [64,] 107.6 NA [65,] 121.3 NA [66,] 131.5 NA [67,] 89.0 NA [68,] 104.4 NA [69,] 128.9 NA [70,] 135.9 NA [71,] 133.3 NA [72,] 121.3 NA [73,] 120.5 NA [74,] 120.4 NA [75,] 137.9 NA [76,] 126.1 NA [77,] 133.2 NA [78,] 146.6 NA [79,] 103.4 NA [80,] 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/159qw1193405205.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/2ito61193405205.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/3zrr21193405205.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/4a4xv1193405205.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] [,13] [1,] 97.3 101 113.2 101 105.7 113.9 86.4 96.5 103.3 114.9 105.8 94.2 98.4 [2,] 97.3 101 113.2 101 105.7 113.9 86.4 96.5 103.3 114.9 105.8 94.2 98.4 [3,] 97.3 101 113.2 101 105.7 113.9 86.4 96.5 103.3 114.9 105.8 94.2 98.4 [4,] 97.3 101 113.2 101 105.7 113.9 86.4 96.5 103.3 114.9 105.8 94.2 98.4 [5,] 97.3 101 113.2 101 105.7 113.9 86.4 96.5 103.3 114.9 105.8 94.2 98.4 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 99.4 108.8 112.6 104.4 112.2 81.1 97.1 112.6 113.8 107.8 103.2 103.3 [2,] 99.4 108.8 112.6 104.4 112.2 81.1 97.1 112.6 113.8 107.8 103.2 103.3 [3,] 99.4 108.8 112.6 104.4 112.2 81.1 97.1 112.6 113.8 107.8 103.2 103.3 [4,] 99.4 108.8 112.6 104.4 112.2 81.1 97.1 112.6 113.8 107.8 103.2 103.3 [5,] 99.4 108.8 112.6 104.4 112.2 81.1 97.1 112.6 113.8 107.8 103.2 103.3 [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 101.2 107.7 110.4 101.9 115.9 89.9 88.6 117.2 123.9 100 103.6 94.1 [2,] 101.2 107.7 110.4 101.9 115.9 89.9 88.6 117.2 123.9 100 103.6 94.1 [3,] 101.2 107.7 110.4 101.9 115.9 89.9 88.6 117.2 123.9 100 103.6 94.1 [4,] 101.2 107.7 110.4 101.9 115.9 89.9 88.6 117.2 123.9 100 103.6 94.1 [5,] 101.2 107.7 110.4 101.9 115.9 89.9 88.6 117.2 123.9 100 103.6 94.1 [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 98.7 119.5 112.7 104.4 124.7 89.1 97 121.6 118.8 114 111.5 97.2 [2,] 98.7 119.5 112.7 104.4 124.7 89.1 97 121.6 118.8 114 111.5 97.2 [3,] 98.7 119.5 112.7 104.4 124.7 89.1 97 121.6 118.8 114 111.5 97.2 [4,] 98.7 119.5 112.7 104.4 124.7 89.1 97 121.6 118.8 114 111.5 97.2 [5,] 98.7 119.5 112.7 104.4 124.7 89.1 97 121.6 118.8 114 111.5 97.2 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [1,] 102.5 113.4 109.8 104.9 126.1 80 96.8 117.2 112.3 117.3 111.1 102.2 [2,] 102.5 113.4 109.8 104.9 126.1 80 96.8 117.2 112.3 117.3 111.1 102.2 [3,] 102.5 113.4 109.8 104.9 126.1 80 96.8 117.2 112.3 117.3 111.1 102.2 [4,] 102.5 113.4 109.8 104.9 126.1 80 96.8 117.2 112.3 117.3 111.1 102.2 [5,] 102.5 113.4 109.8 104.9 126.1 80 96.8 117.2 112.3 117.3 111.1 102.2 [,62] [,63] [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [1,] 104.3 122.9 107.6 121.3 131.5 89 104.4 128.9 135.9 133.3 121.3 120.5 [2,] 104.3 122.9 107.6 121.3 131.5 89 104.4 128.9 135.9 133.3 121.3 120.5 [3,] 104.3 122.9 107.6 121.3 131.5 89 104.4 128.9 135.9 133.3 121.3 120.5 [4,] 104.3 122.9 107.6 121.3 131.5 89 104.4 128.9 135.9 133.3 121.3 120.5 [5,] 104.3 122.9 107.6 121.3 131.5 89 104.4 128.9 135.9 133.3 121.3 120.5 [,74] [,75] [,76] [,77] [,78] [,79] [,80] [1,] 120.4 137.9 126.1 133.2 146.6 103.4 117.2 [2,] 120.4 137.9 126.1 133.2 146.6 103.4 117.2 [3,] 120.4 137.9 126.1 133.2 146.6 103.4 117.2 [4,] 120.4 137.9 126.1 133.2 146.6 103.4 117.2 [5,] 120.4 137.9 126.1 133.2 146.6 103.4 117.2 $n [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [77] 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 97.3 101 113.2 101 105.7 113.9 86.4 96.5 103.3 114.9 105.8 94.2 98.4 [2,] 97.3 101 113.2 101 105.7 113.9 86.4 96.5 103.3 114.9 105.8 94.2 98.4 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 99.4 108.8 112.6 104.4 112.2 81.1 97.1 112.6 113.8 107.8 103.2 103.3 [2,] 99.4 108.8 112.6 104.4 112.2 81.1 97.1 112.6 113.8 107.8 103.2 103.3 [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 101.2 107.7 110.4 101.9 115.9 89.9 88.6 117.2 123.9 100 103.6 94.1 [2,] 101.2 107.7 110.4 101.9 115.9 89.9 88.6 117.2 123.9 100 103.6 94.1 [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 98.7 119.5 112.7 104.4 124.7 89.1 97 121.6 118.8 114 111.5 97.2 [2,] 98.7 119.5 112.7 104.4 124.7 89.1 97 121.6 118.8 114 111.5 97.2 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [1,] 102.5 113.4 109.8 104.9 126.1 80 96.8 117.2 112.3 117.3 111.1 102.2 [2,] 102.5 113.4 109.8 104.9 126.1 80 96.8 117.2 112.3 117.3 111.1 102.2 [,62] [,63] [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [1,] 104.3 122.9 107.6 121.3 131.5 89 104.4 128.9 135.9 133.3 121.3 120.5 [2,] 104.3 122.9 107.6 121.3 131.5 89 104.4 128.9 135.9 133.3 121.3 120.5 [,74] [,75] [,76] [,77] [,78] [,79] [,80] [1,] 120.4 137.9 126.1 133.2 146.6 103.4 117.2 [2,] 120.4 137.9 126.1 133.2 146.6 103.4 117.2 $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" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "60" [61] "61" "62" "63" "64" "65" "66" "67" "68" "69" "70" "71" "72" "73" "74" "75" [76] "76" "77" "78" "79" "80" > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5eyhh1193405205.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] [1,] 80.00 NA [2,] 101.00 NA [3,] 108.30 NA [4,] 117.25 NA [5,] 137.90 NA $n [1] 80 0 $conf [,1] [,2] [1,] 105.4294 NA [2,] 111.1706 NA $out [1] 146.6 $group [1] 1 $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6rplp1193405205.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,] 80.00 80.00 80.00 [2,] 101.00 101.00 101.00 [3,] 108.30 108.30 108.30 [4,] 117.25 117.25 117.25 [5,] 137.90 137.90 137.90 $n [1] 80 80 80 $conf [,1] [,2] [,3] [1,] 105.4294 105.4294 105.4294 [2,] 111.1706 111.1706 111.1706 $out [1] 146.6 146.6 146.6 $group [1] 1 2 3 $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/159qw1193405205.ps tmp/159qw1193405205.png") > system("convert tmp/2ito61193405205.ps tmp/2ito61193405205.png") > system("convert tmp/3zrr21193405205.ps tmp/3zrr21193405205.png") > system("convert tmp/4a4xv1193405205.ps tmp/4a4xv1193405205.png") > system("convert tmp/5eyhh1193405205.ps tmp/5eyhh1193405205.png") > system("convert tmp/6rplp1193405205.ps tmp/6rplp1193405205.png") > > > proc.time() user system elapsed 1.784 1.048 1.988