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(100.00,100.33,100.50,100.68,100.49,100.17,100.13,100.50,101.19,101.25,101.18,101.25,101.00,101.22,101.46,102.05,102.62,102.90,103.10,103.51,103.45,103.50,104.08,104.48,104.75,104.70,104.33,104.11,104.43,104.85,105.11,104.68,105.16,104.71,104.51,104.59,104.40,103.83,103.96,103.71,103.37,103.48,103.15,102.91,103.10,103.03,103.02,103.02,103.31,103.08,103.53,103.68,103.54,103.72,103.94,103.92,104.28,105.03,105.43,105.80,106.03,106.05,106.00,106.50,106.78,106.55,106.46,106.51,106.36,106.42,106.51,106.29,106.01,106.03,106.31,106.19,106.52,106.71,107.00,107.02,107.31,107.23,107.19,107.36,107.51,107.86,108.34,108.48,108.22,108.04) > par1 = '90' > #'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] 90 > (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 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 100.00 NA [2,] 100.33 NA [3,] 100.50 NA [4,] 100.68 NA [5,] 100.49 NA [6,] 100.17 NA [7,] 100.13 NA [8,] 100.50 NA [9,] 101.19 NA [10,] 101.25 NA [11,] 101.18 NA [12,] 101.25 NA [13,] 101.00 NA [14,] 101.22 NA [15,] 101.46 NA [16,] 102.05 NA [17,] 102.62 NA [18,] 102.90 NA [19,] 103.10 NA [20,] 103.51 NA [21,] 103.45 NA [22,] 103.50 NA [23,] 104.08 NA [24,] 104.48 NA [25,] 104.75 NA [26,] 104.70 NA [27,] 104.33 NA [28,] 104.11 NA [29,] 104.43 NA [30,] 104.85 NA [31,] 105.11 NA [32,] 104.68 NA [33,] 105.16 NA [34,] 104.71 NA [35,] 104.51 NA [36,] 104.59 NA [37,] 104.40 NA [38,] 103.83 NA [39,] 103.96 NA [40,] 103.71 NA [41,] 103.37 NA [42,] 103.48 NA [43,] 103.15 NA [44,] 102.91 NA [45,] 103.10 NA [46,] 103.03 NA [47,] 103.02 NA [48,] 103.02 NA [49,] 103.31 NA [50,] 103.08 NA [51,] 103.53 NA [52,] 103.68 NA [53,] 103.54 NA [54,] 103.72 NA [55,] 103.94 NA [56,] 103.92 NA [57,] 104.28 NA [58,] 105.03 NA [59,] 105.43 NA [60,] 105.80 NA [61,] 106.03 NA [62,] 106.05 NA [63,] 106.00 NA [64,] 106.50 NA [65,] 106.78 NA [66,] 106.55 NA [67,] 106.46 NA [68,] 106.51 NA [69,] 106.36 NA [70,] 106.42 NA [71,] 106.51 NA [72,] 106.29 NA [73,] 106.01 NA [74,] 106.03 NA [75,] 106.31 NA [76,] 106.19 NA [77,] 106.52 NA [78,] 106.71 NA [79,] 107.00 NA [80,] 107.02 NA [81,] 107.31 NA [82,] 107.23 NA [83,] 107.19 NA [84,] 107.36 NA [85,] 107.51 NA [86,] 107.86 NA [87,] 108.34 NA [88,] 108.48 NA [89,] 108.22 NA [90,] 108.04 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/1p7vt1193682950.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/2vm331193682950.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/3wid71193682950.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/47yhx1193682950.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,] 100 100.33 100.5 100.68 100.49 100.17 100.13 100.5 101.19 101.25 101.18 [2,] 100 100.33 100.5 100.68 100.49 100.17 100.13 100.5 101.19 101.25 101.18 [3,] 100 100.33 100.5 100.68 100.49 100.17 100.13 100.5 101.19 101.25 101.18 [4,] 100 100.33 100.5 100.68 100.49 100.17 100.13 100.5 101.19 101.25 101.18 [5,] 100 100.33 100.5 100.68 100.49 100.17 100.13 100.5 101.19 101.25 101.18 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 101.25 101 101.22 101.46 102.05 102.62 102.9 103.1 103.51 103.45 103.5 [2,] 101.25 101 101.22 101.46 102.05 102.62 102.9 103.1 103.51 103.45 103.5 [3,] 101.25 101 101.22 101.46 102.05 102.62 102.9 103.1 103.51 103.45 103.5 [4,] 101.25 101 101.22 101.46 102.05 102.62 102.9 103.1 103.51 103.45 103.5 [5,] 101.25 101 101.22 101.46 102.05 102.62 102.9 103.1 103.51 103.45 103.5 [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] 104.08 104.48 104.75 104.7 104.33 104.11 104.43 104.85 105.11 104.68 [2,] 104.08 104.48 104.75 104.7 104.33 104.11 104.43 104.85 105.11 104.68 [3,] 104.08 104.48 104.75 104.7 104.33 104.11 104.43 104.85 105.11 104.68 [4,] 104.08 104.48 104.75 104.7 104.33 104.11 104.43 104.85 105.11 104.68 [5,] 104.08 104.48 104.75 104.7 104.33 104.11 104.43 104.85 105.11 104.68 [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 105.16 104.71 104.51 104.59 104.4 103.83 103.96 103.71 103.37 103.48 [2,] 105.16 104.71 104.51 104.59 104.4 103.83 103.96 103.71 103.37 103.48 [3,] 105.16 104.71 104.51 104.59 104.4 103.83 103.96 103.71 103.37 103.48 [4,] 105.16 104.71 104.51 104.59 104.4 103.83 103.96 103.71 103.37 103.48 [5,] 105.16 104.71 104.51 104.59 104.4 103.83 103.96 103.71 103.37 103.48 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [,51] [,52] [1,] 103.15 102.91 103.1 103.03 103.02 103.02 103.31 103.08 103.53 103.68 [2,] 103.15 102.91 103.1 103.03 103.02 103.02 103.31 103.08 103.53 103.68 [3,] 103.15 102.91 103.1 103.03 103.02 103.02 103.31 103.08 103.53 103.68 [4,] 103.15 102.91 103.1 103.03 103.02 103.02 103.31 103.08 103.53 103.68 [5,] 103.15 102.91 103.1 103.03 103.02 103.02 103.31 103.08 103.53 103.68 [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [,62] [,63] [1,] 103.54 103.72 103.94 103.92 104.28 105.03 105.43 105.8 106.03 106.05 106 [2,] 103.54 103.72 103.94 103.92 104.28 105.03 105.43 105.8 106.03 106.05 106 [3,] 103.54 103.72 103.94 103.92 104.28 105.03 105.43 105.8 106.03 106.05 106 [4,] 103.54 103.72 103.94 103.92 104.28 105.03 105.43 105.8 106.03 106.05 106 [5,] 103.54 103.72 103.94 103.92 104.28 105.03 105.43 105.8 106.03 106.05 106 [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [1,] 106.5 106.78 106.55 106.46 106.51 106.36 106.42 106.51 106.29 106.01 [2,] 106.5 106.78 106.55 106.46 106.51 106.36 106.42 106.51 106.29 106.01 [3,] 106.5 106.78 106.55 106.46 106.51 106.36 106.42 106.51 106.29 106.01 [4,] 106.5 106.78 106.55 106.46 106.51 106.36 106.42 106.51 106.29 106.01 [5,] 106.5 106.78 106.55 106.46 106.51 106.36 106.42 106.51 106.29 106.01 [,74] [,75] [,76] [,77] [,78] [,79] [,80] [,81] [,82] [,83] [1,] 106.03 106.31 106.19 106.52 106.71 107 107.02 107.31 107.23 107.19 [2,] 106.03 106.31 106.19 106.52 106.71 107 107.02 107.31 107.23 107.19 [3,] 106.03 106.31 106.19 106.52 106.71 107 107.02 107.31 107.23 107.19 [4,] 106.03 106.31 106.19 106.52 106.71 107 107.02 107.31 107.23 107.19 [5,] 106.03 106.31 106.19 106.52 106.71 107 107.02 107.31 107.23 107.19 [,84] [,85] [,86] [,87] [,88] [,89] [,90] [1,] 107.36 107.51 107.86 108.34 108.48 108.22 108.04 [2,] 107.36 107.51 107.86 108.34 108.48 108.22 108.04 [3,] 107.36 107.51 107.86 108.34 108.48 108.22 108.04 [4,] 107.36 107.51 107.86 108.34 108.48 108.22 108.04 [5,] 107.36 107.51 107.86 108.34 108.48 108.22 108.04 $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 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 100 100.33 100.5 100.68 100.49 100.17 100.13 100.5 101.19 101.25 101.18 [2,] 100 100.33 100.5 100.68 100.49 100.17 100.13 100.5 101.19 101.25 101.18 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 101.25 101 101.22 101.46 102.05 102.62 102.9 103.1 103.51 103.45 103.5 [2,] 101.25 101 101.22 101.46 102.05 102.62 102.9 103.1 103.51 103.45 103.5 [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] 104.08 104.48 104.75 104.7 104.33 104.11 104.43 104.85 105.11 104.68 [2,] 104.08 104.48 104.75 104.7 104.33 104.11 104.43 104.85 105.11 104.68 [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 105.16 104.71 104.51 104.59 104.4 103.83 103.96 103.71 103.37 103.48 [2,] 105.16 104.71 104.51 104.59 104.4 103.83 103.96 103.71 103.37 103.48 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [,51] [,52] [1,] 103.15 102.91 103.1 103.03 103.02 103.02 103.31 103.08 103.53 103.68 [2,] 103.15 102.91 103.1 103.03 103.02 103.02 103.31 103.08 103.53 103.68 [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [,62] [,63] [1,] 103.54 103.72 103.94 103.92 104.28 105.03 105.43 105.8 106.03 106.05 106 [2,] 103.54 103.72 103.94 103.92 104.28 105.03 105.43 105.8 106.03 106.05 106 [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [1,] 106.5 106.78 106.55 106.46 106.51 106.36 106.42 106.51 106.29 106.01 [2,] 106.5 106.78 106.55 106.46 106.51 106.36 106.42 106.51 106.29 106.01 [,74] [,75] [,76] [,77] [,78] [,79] [,80] [,81] [,82] [,83] [1,] 106.03 106.31 106.19 106.52 106.71 107 107.02 107.31 107.23 107.19 [2,] 106.03 106.31 106.19 106.52 106.71 107 107.02 107.31 107.23 107.19 [,84] [,85] [,86] [,87] [,88] [,89] [,90] [1,] 107.36 107.51 107.86 108.34 108.48 108.22 108.04 [2,] 107.36 107.51 107.86 108.34 108.48 108.22 108.04 $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" "81" "82" "83" "84" "85" "86" "87" "88" "89" "90" > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5peds1193682950.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,] 100.000 NA [2,] 103.080 NA [3,] 104.365 NA [4,] 106.310 NA [5,] 108.480 NA $n [1] 90 0 $conf [,1] [,2] [1,] 103.8271 NA [2,] 104.9029 NA $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/66m6v1193682950.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,] 100.000 100.000 100.000 [2,] 103.080 103.080 103.080 [3,] 104.365 104.365 104.365 [4,] 106.310 106.310 106.310 [5,] 108.480 108.480 108.480 $n [1] 90 90 90 $conf [,1] [,2] [,3] [1,] 103.8271 103.8271 103.8271 [2,] 104.9029 104.9029 104.9029 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/1p7vt1193682950.ps tmp/1p7vt1193682950.png") > system("convert tmp/2vm331193682950.ps tmp/2vm331193682950.png") > system("convert tmp/3wid71193682950.ps tmp/3wid71193682950.png") > system("convert tmp/47yhx1193682950.ps tmp/47yhx1193682950.png") > system("convert tmp/5peds1193682950.ps tmp/5peds1193682950.png") > system("convert tmp/66m6v1193682950.ps tmp/66m6v1193682950.png") > > > proc.time() user system elapsed 1.745 1.059 1.971