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(2194,2419,2742,2137,2710,2173,2363,2126,1905,2121,1983,1734,2074,2049,2406,2558,2251,2059,2397,1747,1707,2319,1631,1627,1791,2034,1997,2169,2028,2253,2218,1855,2187,1852,1570,1851,1954,1828,2251,2277,2085,2282,2266,1878,2267,2069,1746,2299,2360,2214,2825,2355,2333,3016,2155,2172,2150,2533,2058,2160,2259,2498,2695,2799,2945,2930,2318,2540,2570,2669,2450,2842,2760,2677,2979,2257,2842,2546,2455,2293,2379,2478,2054,2272,2351,2271,2542,2304,2194,2722,2395,2146,1894,2548,2087,2063,2481,2476,2212,2834,2148,2598) > par1 = '102' > #'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] 102 > (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 [38] 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 [75] 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 > arr [,1] [,2] [1,] 2194 NA [2,] 2419 NA [3,] 2742 NA [4,] 2137 NA [5,] 2710 NA [6,] 2173 NA [7,] 2363 NA [8,] 2126 NA [9,] 1905 NA [10,] 2121 NA [11,] 1983 NA [12,] 1734 NA [13,] 2074 NA [14,] 2049 NA [15,] 2406 NA [16,] 2558 NA [17,] 2251 NA [18,] 2059 NA [19,] 2397 NA [20,] 1747 NA [21,] 1707 NA [22,] 2319 NA [23,] 1631 NA [24,] 1627 NA [25,] 1791 NA [26,] 2034 NA [27,] 1997 NA [28,] 2169 NA [29,] 2028 NA [30,] 2253 NA [31,] 2218 NA [32,] 1855 NA [33,] 2187 NA [34,] 1852 NA [35,] 1570 NA [36,] 1851 NA [37,] 1954 NA [38,] 1828 NA [39,] 2251 NA [40,] 2277 NA [41,] 2085 NA [42,] 2282 NA [43,] 2266 NA [44,] 1878 NA [45,] 2267 NA [46,] 2069 NA [47,] 1746 NA [48,] 2299 NA [49,] 2360 NA [50,] 2214 NA [51,] 2825 NA [52,] 2355 NA [53,] 2333 NA [54,] 3016 NA [55,] 2155 NA [56,] 2172 NA [57,] 2150 NA [58,] 2533 NA [59,] 2058 NA [60,] 2160 NA [61,] 2259 NA [62,] 2498 NA [63,] 2695 NA [64,] 2799 NA [65,] 2945 NA [66,] 2930 NA [67,] 2318 NA [68,] 2540 NA [69,] 2570 NA [70,] 2669 NA [71,] 2450 NA [72,] 2842 NA [73,] 2760 NA [74,] 2677 NA [75,] 2979 NA [76,] 2257 NA [77,] 2842 NA [78,] 2546 NA [79,] 2455 NA [80,] 2293 NA [81,] 2379 NA [82,] 2478 NA [83,] 2054 NA [84,] 2272 NA [85,] 2351 NA [86,] 2271 NA [87,] 2542 NA [88,] 2304 NA [89,] 2194 NA [90,] 2722 NA [91,] 2395 NA [92,] 2146 NA [93,] 1894 NA [94,] 2548 NA [95,] 2087 NA [96,] 2063 NA [97,] 2481 NA [98,] 2476 NA [99,] 2212 NA [100,] 2834 NA [101,] 2148 NA [102,] 2598 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/freestat/rcomp/tmp/1sran1225377345.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/freestat/rcomp/tmp/27cse1225377345.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/freestat/rcomp/tmp/3b1ak1225377345.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/freestat/rcomp/tmp/4nqx71225377345.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] [,14] [1,] 2194 2419 2742 2137 2710 2173 2363 2126 1905 2121 1983 1734 2074 2049 [2,] 2194 2419 2742 2137 2710 2173 2363 2126 1905 2121 1983 1734 2074 2049 [3,] 2194 2419 2742 2137 2710 2173 2363 2126 1905 2121 1983 1734 2074 2049 [4,] 2194 2419 2742 2137 2710 2173 2363 2126 1905 2121 1983 1734 2074 2049 [5,] 2194 2419 2742 2137 2710 2173 2363 2126 1905 2121 1983 1734 2074 2049 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 2406 2558 2251 2059 2397 1747 1707 2319 1631 1627 1791 2034 [2,] 2406 2558 2251 2059 2397 1747 1707 2319 1631 1627 1791 2034 [3,] 2406 2558 2251 2059 2397 1747 1707 2319 1631 1627 1791 2034 [4,] 2406 2558 2251 2059 2397 1747 1707 2319 1631 1627 1791 2034 [5,] 2406 2558 2251 2059 2397 1747 1707 2319 1631 1627 1791 2034 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 1997 2169 2028 2253 2218 1855 2187 1852 1570 1851 1954 1828 [2,] 1997 2169 2028 2253 2218 1855 2187 1852 1570 1851 1954 1828 [3,] 1997 2169 2028 2253 2218 1855 2187 1852 1570 1851 1954 1828 [4,] 1997 2169 2028 2253 2218 1855 2187 1852 1570 1851 1954 1828 [5,] 1997 2169 2028 2253 2218 1855 2187 1852 1570 1851 1954 1828 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 2251 2277 2085 2282 2266 1878 2267 2069 1746 2299 2360 2214 [2,] 2251 2277 2085 2282 2266 1878 2267 2069 1746 2299 2360 2214 [3,] 2251 2277 2085 2282 2266 1878 2267 2069 1746 2299 2360 2214 [4,] 2251 2277 2085 2282 2266 1878 2267 2069 1746 2299 2360 2214 [5,] 2251 2277 2085 2282 2266 1878 2267 2069 1746 2299 2360 2214 [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [,62] [1,] 2825 2355 2333 3016 2155 2172 2150 2533 2058 2160 2259 2498 [2,] 2825 2355 2333 3016 2155 2172 2150 2533 2058 2160 2259 2498 [3,] 2825 2355 2333 3016 2155 2172 2150 2533 2058 2160 2259 2498 [4,] 2825 2355 2333 3016 2155 2172 2150 2533 2058 2160 2259 2498 [5,] 2825 2355 2333 3016 2155 2172 2150 2533 2058 2160 2259 2498 [,63] [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [,74] [1,] 2695 2799 2945 2930 2318 2540 2570 2669 2450 2842 2760 2677 [2,] 2695 2799 2945 2930 2318 2540 2570 2669 2450 2842 2760 2677 [3,] 2695 2799 2945 2930 2318 2540 2570 2669 2450 2842 2760 2677 [4,] 2695 2799 2945 2930 2318 2540 2570 2669 2450 2842 2760 2677 [5,] 2695 2799 2945 2930 2318 2540 2570 2669 2450 2842 2760 2677 [,75] [,76] [,77] [,78] [,79] [,80] [,81] [,82] [,83] [,84] [,85] [,86] [1,] 2979 2257 2842 2546 2455 2293 2379 2478 2054 2272 2351 2271 [2,] 2979 2257 2842 2546 2455 2293 2379 2478 2054 2272 2351 2271 [3,] 2979 2257 2842 2546 2455 2293 2379 2478 2054 2272 2351 2271 [4,] 2979 2257 2842 2546 2455 2293 2379 2478 2054 2272 2351 2271 [5,] 2979 2257 2842 2546 2455 2293 2379 2478 2054 2272 2351 2271 [,87] [,88] [,89] [,90] [,91] [,92] [,93] [,94] [,95] [,96] [,97] [,98] [1,] 2542 2304 2194 2722 2395 2146 1894 2548 2087 2063 2481 2476 [2,] 2542 2304 2194 2722 2395 2146 1894 2548 2087 2063 2481 2476 [3,] 2542 2304 2194 2722 2395 2146 1894 2548 2087 2063 2481 2476 [4,] 2542 2304 2194 2722 2395 2146 1894 2548 2087 2063 2481 2476 [5,] 2542 2304 2194 2722 2395 2146 1894 2548 2087 2063 2481 2476 [,99] [,100] [,101] [,102] [1,] 2212 2834 2148 2598 [2,] 2212 2834 2148 2598 [3,] 2212 2834 2148 2598 [4,] 2212 2834 2148 2598 [5,] 2212 2834 2148 2598 $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 [38] 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 [75] 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 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 2194 2419 2742 2137 2710 2173 2363 2126 1905 2121 1983 1734 2074 2049 [2,] 2194 2419 2742 2137 2710 2173 2363 2126 1905 2121 1983 1734 2074 2049 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 2406 2558 2251 2059 2397 1747 1707 2319 1631 1627 1791 2034 [2,] 2406 2558 2251 2059 2397 1747 1707 2319 1631 1627 1791 2034 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 1997 2169 2028 2253 2218 1855 2187 1852 1570 1851 1954 1828 [2,] 1997 2169 2028 2253 2218 1855 2187 1852 1570 1851 1954 1828 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 2251 2277 2085 2282 2266 1878 2267 2069 1746 2299 2360 2214 [2,] 2251 2277 2085 2282 2266 1878 2267 2069 1746 2299 2360 2214 [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [,62] [1,] 2825 2355 2333 3016 2155 2172 2150 2533 2058 2160 2259 2498 [2,] 2825 2355 2333 3016 2155 2172 2150 2533 2058 2160 2259 2498 [,63] [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [,74] [1,] 2695 2799 2945 2930 2318 2540 2570 2669 2450 2842 2760 2677 [2,] 2695 2799 2945 2930 2318 2540 2570 2669 2450 2842 2760 2677 [,75] [,76] [,77] [,78] [,79] [,80] [,81] [,82] [,83] [,84] [,85] [,86] [1,] 2979 2257 2842 2546 2455 2293 2379 2478 2054 2272 2351 2271 [2,] 2979 2257 2842 2546 2455 2293 2379 2478 2054 2272 2351 2271 [,87] [,88] [,89] [,90] [,91] [,92] [,93] [,94] [,95] [,96] [,97] [,98] [1,] 2542 2304 2194 2722 2395 2146 1894 2548 2087 2063 2481 2476 [2,] 2542 2304 2194 2722 2395 2146 1894 2548 2087 2063 2481 2476 [,99] [,100] [,101] [,102] [1,] 2212 2834 2148 2598 [2,] 2212 2834 2148 2598 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" [13] "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" [25] "25" "26" "27" "28" "29" "30" "31" "32" "33" "34" "35" "36" [37] "37" "38" "39" "40" "41" "42" "43" "44" "45" "46" "47" "48" [49] "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] "73" "74" "75" "76" "77" "78" "79" "80" "81" "82" "83" "84" [85] "85" "86" "87" "88" "89" "90" "91" "92" "93" "94" "95" "96" [97] "97" "98" "99" "100" "101" "102" > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5d1171225377345.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,] 1570.0 NA [2,] 2069.0 NA [3,] 2262.5 NA [4,] 2481.0 NA [5,] 3016.0 NA $n [1] 102 0 $conf [,1] [,2] [1,] 2198.045 NA [2,] 2326.955 NA $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6ru4r1225377345.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,] 1570.0 1570.0 1570.0 [2,] 2069.0 2069.0 2069.0 [3,] 2262.5 2262.5 2262.5 [4,] 2481.0 2481.0 2481.0 [5,] 3016.0 3016.0 3016.0 $n [1] 102 102 102 $conf [,1] [,2] [,3] [1,] 2198.045 2198.045 2198.045 [2,] 2326.955 2326.955 2326.955 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/1sran1225377345.ps tmp/1sran1225377345.png") > system("convert tmp/27cse1225377345.ps tmp/27cse1225377345.png") > system("convert tmp/3b1ak1225377345.ps tmp/3b1ak1225377345.png") > system("convert tmp/4nqx71225377345.ps tmp/4nqx71225377345.png") > system("convert tmp/5d1171225377345.ps tmp/5d1171225377345.png") > system("convert tmp/6ru4r1225377345.ps tmp/6ru4r1225377345.png") > > > proc.time() user system elapsed 2.217 1.334 2.760