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(1.55,1.56,1.56,1.57,1.57,1.58,1.58,1.58,1.58,1.59,1.59,1.60,1.60,1.61,1.62,1.62,1.63,1.63,1.63,1.63,1.63,1.63,1.64,1.64,1.64,1.65,1.65,1.66,1.67,1.67,1.68,1.68,1.69,1.70,1.71,1.72,1.72,1.73,1.73,1.73,1.73,1.74,1.75,1.75,1.75,1.76,1.76,1.76,1.77,1.78,1.78,1.79,1.79,1.79,1.79,1.79,1.83,1.83,1.83,1.83,1.84,1.84,1.84,1.85,1.85,1.85,1.86,1.86,1.86,1.87,1.87,1.88) > 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,] 1.55 1.60 1.64 1.72 1.77 1.84 NA [2,] 1.56 1.61 1.65 1.73 1.78 1.84 NA [3,] 1.56 1.62 1.65 1.73 1.78 1.84 NA [4,] 1.57 1.62 1.66 1.73 1.79 1.85 NA [5,] 1.57 1.63 1.67 1.73 1.79 1.85 NA [6,] 1.58 1.63 1.67 1.74 1.79 1.85 NA [7,] 1.58 1.63 1.68 1.75 1.79 1.86 NA [8,] 1.58 1.63 1.68 1.75 1.79 1.86 NA [9,] 1.58 1.63 1.69 1.75 1.83 1.86 NA [10,] 1.59 1.63 1.70 1.76 1.83 1.87 NA [11,] 1.59 1.64 1.71 1.76 1.83 1.87 NA [12,] 1.60 1.64 1.72 1.76 1.83 1.88 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 0.01 0.01 0.01 0.01 0.00 NA [2,] 0.00 0.01 0.00 0.00 0.00 0.00 NA [3,] 0.01 0.00 0.01 0.00 0.01 0.01 NA [4,] 0.00 0.01 0.01 0.00 0.00 0.00 NA [5,] 0.01 0.00 0.00 0.01 0.00 0.00 NA [6,] 0.00 0.00 0.01 0.01 0.00 0.01 NA [7,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [8,] 0.00 0.00 0.01 0.00 0.04 0.00 NA [9,] 0.01 0.00 0.01 0.01 0.00 0.01 NA [10,] 0.00 0.01 0.01 0.00 0.00 0.00 NA [11,] 0.01 0.00 0.01 0.00 0.00 0.01 NA [12,] 0.00 0.00 0.00 0.01 0.01 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/fisher/rcomp/tmp/1mfud1350845901.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/fisher/rcomp/tmp/2bzcx1350845901.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/fisher/rcomp/tmp/3bkvq1350845901.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/fisher/rcomp/tmp/4i94x1350845901.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] [,11] [,12] [1,] 1.55 1.56 1.56 1.570 1.57 1.580 1.580 1.580 1.58 1.59 1.590 1.60 [2,] 1.60 1.61 1.62 1.620 1.63 1.630 1.630 1.630 1.63 1.63 1.640 1.64 [3,] 1.68 1.69 1.69 1.695 1.70 1.705 1.715 1.715 1.72 1.73 1.735 1.74 [4,] 1.77 1.78 1.78 1.790 1.79 1.790 1.790 1.790 1.83 1.83 1.830 1.83 [5,] 1.84 1.84 1.84 1.850 1.85 1.850 1.860 1.860 1.86 1.87 1.870 1.88 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.570345 1.580345 1.586795 1.585345 1.596795 1.601795 1.611795 1.611795 [2,] 1.789655 1.799655 1.793205 1.804655 1.803205 1.808205 1.818205 1.818205 [,9] [,10] [,11] [,12] [1,] 1.590994 1.600994 1.612444 1.617444 [2,] 1.849006 1.859006 1.857556 1.862556 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.55, 1.6, 1.68, 1.77, 1.84, 1.56, 1.61, 1.69, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5h9lo1350845901.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] [,12] [1,] 0.01 0 0.00 0.00 0.00 0.000 0 0.00 0.00 0.00 0.000 0.00 [2,] 0.01 0 0.00 0.00 0.00 0.000 0 0.00 0.00 0.00 0.000 0.00 [3,] 0.01 0 0.01 0.00 0.00 0.005 0 0.00 0.01 0.00 0.005 0.00 [4,] 0.01 0 0.01 0.01 0.01 0.010 0 0.01 0.01 0.01 0.010 0.01 [5,] 0.01 0 0.01 0.01 0.01 0.010 0 0.01 0.01 0.01 0.010 0.01 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 0 0.003549677 -0.006450323 -0.006450323 -0.001450323 0 [2,] 0.01 0 0.016450323 0.006450323 0.006450323 0.011450323 0 [,8] [,9] [,10] [,11] [,12] [1,] -0.006450323 0.003549677 -0.006450323 -0.001450323 -0.007065975 [2,] 0.006450323 0.016450323 0.006450323 0.011450323 0.007065975 $out [1] 0.00 0.01 0.04 $group [1] 1 2 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.01, 0.01, 0.01, 0.01, 0.01, 0, 0, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ywnl1350845901.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,] 1.550 1.61 1.640 1.720 1.770 1.840 NA [2,] 1.565 1.62 1.655 1.730 1.785 1.845 NA [3,] 1.580 1.63 1.675 1.745 1.790 1.855 NA [4,] 1.585 1.63 1.695 1.755 1.830 1.865 NA [5,] 1.600 1.64 1.720 1.760 1.830 1.880 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.570878 1.625439 1.656756 1.733597 1.769475 1.845878 NA [2,] 1.589122 1.634561 1.693244 1.756403 1.810525 1.864122 NA $out [1] 1.6 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.55, 1.565, 1.58, 1.585, 1.6, 1.61, 1.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/71ta51350845901.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,] 1.686667 1.6800 1.68375 [2,] 1.700000 1.6925 1.70000 [3,] 1.712500 1.7100 1.71000 [4,] 1.726667 1.7250 1.72875 [5,] 1.738333 1.7400 1.73625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.700337 1.695177 1.696887 [2,] 1.724663 1.724823 1.723113 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.68666666666667, 1.7, 1.7125, 1.72666666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1mfud1350845901.ps tmp/1mfud1350845901.png",intern=TRUE)) character(0) > try(system("convert tmp/2bzcx1350845901.ps tmp/2bzcx1350845901.png",intern=TRUE)) character(0) > try(system("convert tmp/3bkvq1350845901.ps tmp/3bkvq1350845901.png",intern=TRUE)) character(0) > try(system("convert tmp/4i94x1350845901.ps tmp/4i94x1350845901.png",intern=TRUE)) character(0) > try(system("convert tmp/5h9lo1350845901.ps tmp/5h9lo1350845901.png",intern=TRUE)) character(0) > try(system("convert tmp/6ywnl1350845901.ps tmp/6ywnl1350845901.png",intern=TRUE)) character(0) > try(system("convert tmp/71ta51350845901.ps tmp/71ta51350845901.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.424 0.643 4.057