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(59.7,58.2,75.3,69,66.1,77.5,69.3,70.2,70.2,78.2,85.4,82.4,61.2,52.2,85.3,79.9,72.2,85.7,75.5,69.2,77.6,85.3,77,89.9,60,54.3,84,69.9,75.1,81.7,69.9,68.3,77.3,77.4,85.3,91,60.6,57.6,93.8,78.7,80.3,89.8,77.5,71.7,83.2,86.2,100.7,100.8,57.1,62.5,79.7,80.3,92.4,91.8,85.8,84.2,93.1,101.2,100.6,106.7) > par1 = '60' > #'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] 60 > (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 > arr [,1] [,2] [1,] 59.7 NA [2,] 58.2 NA [3,] 75.3 NA [4,] 69.0 NA [5,] 66.1 NA [6,] 77.5 NA [7,] 69.3 NA [8,] 70.2 NA [9,] 70.2 NA [10,] 78.2 NA [11,] 85.4 NA [12,] 82.4 NA [13,] 61.2 NA [14,] 52.2 NA [15,] 85.3 NA [16,] 79.9 NA [17,] 72.2 NA [18,] 85.7 NA [19,] 75.5 NA [20,] 69.2 NA [21,] 77.6 NA [22,] 85.3 NA [23,] 77.0 NA [24,] 89.9 NA [25,] 60.0 NA [26,] 54.3 NA [27,] 84.0 NA [28,] 69.9 NA [29,] 75.1 NA [30,] 81.7 NA [31,] 69.9 NA [32,] 68.3 NA [33,] 77.3 NA [34,] 77.4 NA [35,] 85.3 NA [36,] 91.0 NA [37,] 60.6 NA [38,] 57.6 NA [39,] 93.8 NA [40,] 78.7 NA [41,] 80.3 NA [42,] 89.8 NA [43,] 77.5 NA [44,] 71.7 NA [45,] 83.2 NA [46,] 86.2 NA [47,] 100.7 NA [48,] 100.8 NA [49,] 57.1 NA [50,] 62.5 NA [51,] 79.7 NA [52,] 80.3 NA [53,] 92.4 NA [54,] 91.8 NA [55,] 85.8 NA [56,] 84.2 NA [57,] 93.1 NA [58,] 101.2 NA [59,] 100.6 NA [60,] 106.7 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/15r7j1193419785.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/281tu1193419785.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/31nk31193419785.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/4qyyg1193419785.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,] 59.7 58.2 75.3 69 66.1 77.5 69.3 70.2 70.2 78.2 85.4 82.4 61.2 52.2 [2,] 59.7 58.2 75.3 69 66.1 77.5 69.3 70.2 70.2 78.2 85.4 82.4 61.2 52.2 [3,] 59.7 58.2 75.3 69 66.1 77.5 69.3 70.2 70.2 78.2 85.4 82.4 61.2 52.2 [4,] 59.7 58.2 75.3 69 66.1 77.5 69.3 70.2 70.2 78.2 85.4 82.4 61.2 52.2 [5,] 59.7 58.2 75.3 69 66.1 77.5 69.3 70.2 70.2 78.2 85.4 82.4 61.2 52.2 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 85.3 79.9 72.2 85.7 75.5 69.2 77.6 85.3 77 89.9 60 54.3 [2,] 85.3 79.9 72.2 85.7 75.5 69.2 77.6 85.3 77 89.9 60 54.3 [3,] 85.3 79.9 72.2 85.7 75.5 69.2 77.6 85.3 77 89.9 60 54.3 [4,] 85.3 79.9 72.2 85.7 75.5 69.2 77.6 85.3 77 89.9 60 54.3 [5,] 85.3 79.9 72.2 85.7 75.5 69.2 77.6 85.3 77 89.9 60 54.3 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 84 69.9 75.1 81.7 69.9 68.3 77.3 77.4 85.3 91 60.6 57.6 [2,] 84 69.9 75.1 81.7 69.9 68.3 77.3 77.4 85.3 91 60.6 57.6 [3,] 84 69.9 75.1 81.7 69.9 68.3 77.3 77.4 85.3 91 60.6 57.6 [4,] 84 69.9 75.1 81.7 69.9 68.3 77.3 77.4 85.3 91 60.6 57.6 [5,] 84 69.9 75.1 81.7 69.9 68.3 77.3 77.4 85.3 91 60.6 57.6 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 93.8 78.7 80.3 89.8 77.5 71.7 83.2 86.2 100.7 100.8 57.1 62.5 [2,] 93.8 78.7 80.3 89.8 77.5 71.7 83.2 86.2 100.7 100.8 57.1 62.5 [3,] 93.8 78.7 80.3 89.8 77.5 71.7 83.2 86.2 100.7 100.8 57.1 62.5 [4,] 93.8 78.7 80.3 89.8 77.5 71.7 83.2 86.2 100.7 100.8 57.1 62.5 [5,] 93.8 78.7 80.3 89.8 77.5 71.7 83.2 86.2 100.7 100.8 57.1 62.5 [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 79.7 80.3 92.4 91.8 85.8 84.2 93.1 101.2 100.6 106.7 [2,] 79.7 80.3 92.4 91.8 85.8 84.2 93.1 101.2 100.6 106.7 [3,] 79.7 80.3 92.4 91.8 85.8 84.2 93.1 101.2 100.6 106.7 [4,] 79.7 80.3 92.4 91.8 85.8 84.2 93.1 101.2 100.6 106.7 [5,] 79.7 80.3 92.4 91.8 85.8 84.2 93.1 101.2 100.6 106.7 $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 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 59.7 58.2 75.3 69 66.1 77.5 69.3 70.2 70.2 78.2 85.4 82.4 61.2 52.2 [2,] 59.7 58.2 75.3 69 66.1 77.5 69.3 70.2 70.2 78.2 85.4 82.4 61.2 52.2 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 85.3 79.9 72.2 85.7 75.5 69.2 77.6 85.3 77 89.9 60 54.3 [2,] 85.3 79.9 72.2 85.7 75.5 69.2 77.6 85.3 77 89.9 60 54.3 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 84 69.9 75.1 81.7 69.9 68.3 77.3 77.4 85.3 91 60.6 57.6 [2,] 84 69.9 75.1 81.7 69.9 68.3 77.3 77.4 85.3 91 60.6 57.6 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 93.8 78.7 80.3 89.8 77.5 71.7 83.2 86.2 100.7 100.8 57.1 62.5 [2,] 93.8 78.7 80.3 89.8 77.5 71.7 83.2 86.2 100.7 100.8 57.1 62.5 [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 79.7 80.3 92.4 91.8 85.8 84.2 93.1 101.2 100.6 106.7 [2,] 79.7 80.3 92.4 91.8 85.8 84.2 93.1 101.2 100.6 106.7 $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" > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/54uuh1193419785.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,] 52.20 NA [2,] 69.60 NA [3,] 77.90 NA [4,] 85.55 NA [5,] 106.70 NA $n [1] 60 0 $conf [,1] [,2] [1,] 74.64656 NA [2,] 81.15344 NA $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6ada61193419785.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,] 52.20 52.20 52.20 [2,] 69.60 69.60 69.60 [3,] 77.90 77.90 77.90 [4,] 85.55 85.55 85.55 [5,] 106.70 106.70 106.70 $n [1] 60 60 60 $conf [,1] [,2] [,3] [1,] 74.64656 74.64656 74.64656 [2,] 81.15344 81.15344 81.15344 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/15r7j1193419785.ps tmp/15r7j1193419785.png") > system("convert tmp/281tu1193419785.ps tmp/281tu1193419785.png") > system("convert tmp/31nk31193419785.ps tmp/31nk31193419785.png") > system("convert tmp/4qyyg1193419785.ps tmp/4qyyg1193419785.png") > system("convert tmp/54uuh1193419785.ps tmp/54uuh1193419785.png") > system("convert tmp/6ada61193419785.ps tmp/6ada61193419785.png") > > > proc.time() user system elapsed 1.616 0.946 1.825