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(104.42,104.42,104.42,104.42,104.42,104.42,104.42,104.44,104.44,104.44,105.19,105.19,105.19,106.38,106.38,106.38,106.38,106.38,106.38,106.72,106.73,106.72,108.6,108.6,109.65,109.65,109.65,109.65,109.65,109.65,109.65,109.65,112.27,112.27,112.27,112.27,112.27,114.98,114.98,114.98,114.98,114.98,114.98,116.04,116.59,116.59,116.59,116.59,118.75,118.75,118.75,118.75,118.75,118.75,118.75,119.31,119.31,119.31,119.31,119.31,121.19,121.19,121.19,121.19,121.19,122.91,122.91,122.91,122.91,122.91,122.91,122.91) > 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,] 104.42 105.19 109.65 112.27 118.75 121.19 NA [2,] 104.42 106.38 109.65 114.98 118.75 121.19 NA [3,] 104.42 106.38 109.65 114.98 118.75 121.19 NA [4,] 104.42 106.38 109.65 114.98 118.75 121.19 NA [5,] 104.42 106.38 109.65 114.98 118.75 121.19 NA [6,] 104.42 106.38 109.65 114.98 118.75 122.91 NA [7,] 104.42 106.38 109.65 114.98 118.75 122.91 NA [8,] 104.44 106.72 109.65 116.04 119.31 122.91 NA [9,] 104.44 106.73 112.27 116.59 119.31 122.91 NA [10,] 104.44 106.72 112.27 116.59 119.31 122.91 NA [11,] 105.19 108.60 112.27 116.59 119.31 122.91 NA [12,] 105.19 108.60 112.27 116.59 119.31 122.91 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 1.19 0.00 2.71 0.00 0.00 NA [2,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [3,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [4,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [5,] 0.00 0.00 0.00 0.00 0.00 1.72 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.02 0.34 0.00 1.06 0.56 0.00 NA [8,] 0.00 0.01 2.62 0.55 0.00 0.00 NA [9,] 0.00 -0.01 0.00 0.00 0.00 0.00 NA [10,] 0.75 1.88 0.00 0.00 0.00 0.00 NA [11,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [12,] 0.00 1.05 0.00 2.16 1.88 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/1cehy1350816281.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/2s3a71350816281.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/3og911350816281.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/436no1350816281.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] [1,] 104.42 104.420 104.420 104.420 104.420 104.420 104.420 104.440 104.44 [2,] 105.19 106.380 106.380 106.380 106.380 106.380 106.380 106.720 106.73 [3,] 110.96 112.315 112.315 112.315 112.315 112.315 112.315 112.845 114.43 [4,] 118.75 118.750 118.750 118.750 118.750 118.750 118.750 119.310 119.31 [5,] 121.19 121.190 121.190 121.190 121.190 122.910 122.910 122.910 122.91 [,10] [,11] [,12] [1,] 104.44 105.19 105.19 [2,] 106.72 108.60 108.60 [3,] 114.43 114.43 114.43 [4,] 119.31 119.31 119.31 [5,] 122.91 122.91 122.91 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 102.2134 104.336 104.336 104.336 104.336 104.336 104.336 104.724 106.3155 [2,] 119.7066 120.294 120.294 120.294 120.294 120.294 120.294 120.966 122.5445 [,10] [,11] [,12] [1,] 106.309 107.5217 107.5217 [2,] 122.551 121.3383 121.3383 $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(104.42, 105.19, 110.96, 118.75, 121.19, 104.42, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5hno21350816281.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.00 0 0 0 0 0 0.00 0.000 0 0.00 0 0.00 [2,] 0.00 0 0 0 0 0 0.00 0.000 0 0.00 0 0.00 [3,] 0.00 0 0 0 0 0 0.18 0.005 0 0.00 0 1.05 [4,] 1.19 0 0 0 0 0 0.56 0.550 0 0.75 0 1.88 [5,] 2.71 0 0 0 0 0 1.06 0.550 0 0.75 0 2.16 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -0.7675884 0 0 0 0 0 -0.1812181 -0.3497678 0 -0.4837742 [2,] 0.7675884 0 0 0 0 0 0.5412181 0.3597678 0 0.4837742 [,11] [,12] [1,] 0 -0.2784033 [2,] 0 2.3784033 $out [1] 1.72 2.62 -0.01 1.88 $group [1] 5 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 1.19, 2.71000000000001, 0, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ub3j1350816281.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,] 104.42 106.380 109.65 114.98 118.75 121.19 NA [2,] 104.42 106.380 109.65 114.98 118.75 121.19 NA [3,] 104.42 106.380 109.65 114.98 118.75 122.91 NA [4,] 104.44 106.725 112.27 116.59 119.31 122.91 NA [5,] 104.44 106.730 112.27 116.59 119.31 122.91 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 104.4109 106.2226 108.455 114.2457 118.4946 122.1255 NA [2,] 104.4291 106.5374 110.845 115.7143 119.0054 123.6945 NA $out [1] 105.19 105.19 105.19 108.60 108.60 112.27 $group [1] 1 1 2 2 2 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(104.42, 104.42, 104.42, 104.44, 104.44, 106.38, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7npm21350816281.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,] 111.9117 110.960 111.7175 [2,] 112.5617 112.315 112.5025 [3,] 112.8483 112.315 112.5025 [4,] 113.7075 114.430 113.3706 [5,] 114.1450 114.430 114.0737 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 112.3257 111.3503 112.1065 [2,] 113.3710 113.2797 112.8985 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(111.911666666667, 112.561666666667, 112.848333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cehy1350816281.ps tmp/1cehy1350816281.png",intern=TRUE)) character(0) > try(system("convert tmp/2s3a71350816281.ps tmp/2s3a71350816281.png",intern=TRUE)) character(0) > try(system("convert tmp/3og911350816281.ps tmp/3og911350816281.png",intern=TRUE)) character(0) > try(system("convert tmp/436no1350816281.ps tmp/436no1350816281.png",intern=TRUE)) character(0) > try(system("convert tmp/5hno21350816281.ps tmp/5hno21350816281.png",intern=TRUE)) character(0) > try(system("convert tmp/6ub3j1350816281.ps tmp/6ub3j1350816281.png",intern=TRUE)) character(0) > try(system("convert tmp/7npm21350816281.ps tmp/7npm21350816281.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.350 0.630 3.973