R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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(98.68,99.21,99.36,100.72,102.27,102.62,102.97,102.88,102.9,103.01,103.02,103.73,104.18,103.73,103.78,103.61,103.84,103.86,104.14,104.05,104.01,104.49,104.83,104.78,104.95,105.28,105.28,105.91,106.81,106.39,107.02,106.92,107.01,106.79,107.41,107.13,107.54,108.48,108.5,108.27,109.42,110.09,109.98,109.99,109.54,108.85,106.76,107.56,106.24,108.85,111.11,111.85,110.68,106.96,106.74,105.73,105.66,104.01,106.86,108.84,110.66,106.93,103.74,101.64,102.17,101.13,100.64,100.43,99.77,99.79,99.47,99.63) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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 > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 72 > (np <- floor(n / par1)) [1] 6 > arr <- array(NA,dim=c(par1,np+1)) > darr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > dx <- diff(x) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + darr[j,ari[j]] <- dx[i] + if (j == par1) j = 0 + } > ari [1] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.68 104.18 104.95 107.54 106.24 110.66 NA [2,] 99.21 103.73 105.28 108.48 108.85 106.93 NA [3,] 99.36 103.78 105.28 108.50 111.11 103.74 NA [4,] 100.72 103.61 105.91 108.27 111.85 101.64 NA [5,] 102.27 103.84 106.81 109.42 110.68 102.17 NA [6,] 102.62 103.86 106.39 110.09 106.96 101.13 NA [7,] 102.97 104.14 107.02 109.98 106.74 100.64 NA [8,] 102.88 104.05 106.92 109.99 105.73 100.43 NA [9,] 102.90 104.01 107.01 109.54 105.66 99.77 NA [10,] 103.01 104.49 106.79 108.85 104.01 99.79 NA [11,] 103.02 104.83 107.41 106.76 106.86 99.47 NA [12,] 103.73 104.78 107.13 107.56 108.84 99.63 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.53 -0.45 0.33 0.94 2.61 -3.73 NA [2,] 0.15 0.05 0.00 0.02 2.26 -3.19 NA [3,] 1.36 -0.17 0.63 -0.23 0.74 -2.10 NA [4,] 1.55 0.23 0.90 1.15 -1.17 0.53 NA [5,] 0.35 0.02 -0.42 0.67 -3.72 -1.04 NA [6,] 0.35 0.28 0.63 -0.11 -0.22 -0.49 NA [7,] -0.09 -0.09 -0.10 0.01 -1.01 -0.21 NA [8,] 0.02 -0.04 0.09 -0.45 -0.07 -0.66 NA [9,] 0.11 0.48 -0.22 -0.69 -1.65 0.02 NA [10,] 0.01 0.34 0.62 -2.09 2.85 -0.32 NA [11,] 0.71 -0.05 -0.28 0.80 1.98 0.16 NA [12,] 0.45 0.17 0.41 -1.32 1.82 NA 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/wessaorg/rcomp/tmp/16cka1350632071.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2722h1350632071.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/361z41350632071.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/41v2v1350632071.ps",horizontal=F,onefile=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] [1,] 104.180 99.210 99.36 100.72 102.170 101.130 100.64 100.43 99.770 99.79 [2,] 104.180 103.730 103.74 101.64 102.270 102.620 102.97 102.88 102.900 103.01 [3,] 105.595 106.105 104.53 104.76 105.325 105.125 105.44 104.89 104.835 104.25 [4,] 107.540 108.480 108.50 108.27 109.420 106.960 107.02 106.92 107.010 106.79 [5,] 110.660 108.850 111.11 111.85 110.680 110.090 109.98 109.99 109.540 108.85 [,11] [,12] [1,] 99.470 99.630 [2,] 103.020 103.730 [3,] 105.795 105.955 [4,] 106.860 107.560 [5,] 107.410 108.840 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.4277 103.0411 101.4596 100.4834 100.713 102.3256 102.8276 102.2841 [2,] 107.7623 109.1689 107.6004 109.0366 109.937 107.9244 108.0524 107.4959 [,9] [,10] [,11] [,12] [1,] 102.1839 101.8118 103.3181 103.4845 [2,] 107.4861 106.6882 108.2719 108.4255 $out [1] 98.68 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(104.18, 104.18, 105.595, 107.54, 110.66, 99.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5t3991350632071.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(darr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Differenced Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -0.45 0.000 -0.23 0.230 -1.04 -0.490 -0.210 -0.660 -1.65 -0.320 -0.280 [2,] -0.45 0.000 -0.23 0.230 -1.04 -0.220 -0.210 -0.450 -0.69 -0.320 -0.050 [3,] 0.43 0.035 0.23 0.715 -0.20 0.085 -0.095 -0.055 -0.10 0.175 0.435 [4,] 0.94 0.150 0.74 1.150 0.35 0.350 -0.090 0.020 0.11 0.620 0.800 [5,] 2.61 0.150 1.36 1.550 0.67 0.630 0.010 0.090 0.48 0.620 1.980 [,12] [1,] 0.17 [2,] 0.17 [3,] 0.41 [4,] 0.45 [5,] 0.45 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.4665949 -0.06175484 -0.3956813 0.1215703 -1.0965949 -0.2826684 [2,] 1.3265949 0.13175484 0.8556813 1.3084297 0.6965949 0.4526684 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.17240388 -0.3581652 -0.6160258 -0.4313304 -0.1132775 0.2121527 [2,] -0.01759612 0.2481652 0.4160258 0.7813304 0.9832775 0.6078473 $out [1] -3.73 2.26 -3.19 -2.10 -1.17 -3.72 -1.01 -2.09 2.85 -1.32 1.82 $group [1] 1 2 2 3 4 5 7 10 10 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.450000000000003, -0.450000000000003, 0.429999999999993, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68p0r1350632071.ps",horizontal=F,onefile=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] [,4] [,5] [,6] [,7] [1,] 98.68 103.610 104.950 106.760 104.010 99.470 NA [2,] 100.04 103.810 105.595 107.915 105.985 99.780 NA [3,] 102.75 104.030 106.800 108.675 106.910 100.885 NA [4,] 102.99 104.335 107.015 109.760 109.765 102.955 NA [5,] 103.73 104.830 107.410 110.090 111.850 106.930 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 101.4045 103.7905 106.1523 107.8335 105.1859 99.43686 NA [2,] 104.0955 104.2695 107.4477 109.5165 108.6341 102.33314 NA $out [1] 110.66 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(98.68, 100.04, 102.75, 102.99, 103.73, 103.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7w5tm1350632071.ps",horizontal=F,onefile=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,] 104.4900 104.2500 104.7375 [2,] 104.9075 104.7975 104.9019 [3,] 105.2633 105.2250 105.1300 [4,] 105.3542 105.6950 105.7225 [5,] 105.8650 106.1050 106.1050 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 105.0596 104.8156 104.7557 [2,] 105.4671 105.6344 105.5043 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(104.49, 104.9075, 105.263333333333, 105.354166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16cka1350632071.ps tmp/16cka1350632071.png",intern=TRUE)) character(0) > try(system("convert tmp/2722h1350632071.ps tmp/2722h1350632071.png",intern=TRUE)) character(0) > try(system("convert tmp/361z41350632071.ps tmp/361z41350632071.png",intern=TRUE)) character(0) > try(system("convert tmp/41v2v1350632071.ps tmp/41v2v1350632071.png",intern=TRUE)) character(0) > try(system("convert tmp/5t3991350632071.ps tmp/5t3991350632071.png",intern=TRUE)) character(0) > try(system("convert tmp/68p0r1350632071.ps tmp/68p0r1350632071.png",intern=TRUE)) character(0) > try(system("convert tmp/7w5tm1350632071.ps tmp/7w5tm1350632071.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.300 0.559 3.849