R version 2.15.2 (2012-10-26) -- "Trick or Treat" 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(15.58,15.66,15.73,15.74,15.77,15.78,15.8,15.81,15.82,15.88,15.85,15.89,15.92,16.02,16.1,16.13,16.21,16.25,16.27,16.21,16.21,16.24,16.32,16.32,16.36,16.48,16.54,16.58,16.56,16.55,16.58,16.53,16.6,16.46,16.48,16.48,16.49,16.54,16.67,16.72,16.79,16.86,16.84,16.86,16.96,17.01,17.02,17.04,17.04,17.39,17.54,17.57,17.58,17.56,17.63,17.67,17.71,17.75,17.82,17.86,17.89,17.96,18,18.08,18,18.02,18.01,18.02,17.95,17.96,18,18.01) > 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,] 15.58 15.92 16.36 16.49 17.04 17.89 NA [2,] 15.66 16.02 16.48 16.54 17.39 17.96 NA [3,] 15.73 16.10 16.54 16.67 17.54 18.00 NA [4,] 15.74 16.13 16.58 16.72 17.57 18.08 NA [5,] 15.77 16.21 16.56 16.79 17.58 18.00 NA [6,] 15.78 16.25 16.55 16.86 17.56 18.02 NA [7,] 15.80 16.27 16.58 16.84 17.63 18.01 NA [8,] 15.81 16.21 16.53 16.86 17.67 18.02 NA [9,] 15.82 16.21 16.60 16.96 17.71 17.95 NA [10,] 15.88 16.24 16.46 17.01 17.75 17.96 NA [11,] 15.85 16.32 16.48 17.02 17.82 18.00 NA [12,] 15.89 16.32 16.48 17.04 17.86 18.01 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.08 0.10 0.12 0.05 0.35 0.07 NA [2,] 0.07 0.08 0.06 0.13 0.15 0.04 NA [3,] 0.01 0.03 0.04 0.05 0.03 0.08 NA [4,] 0.03 0.08 -0.02 0.07 0.01 -0.08 NA [5,] 0.01 0.04 -0.01 0.07 -0.02 0.02 NA [6,] 0.02 0.02 0.03 -0.02 0.07 -0.01 NA [7,] 0.01 -0.06 -0.05 0.02 0.04 0.01 NA [8,] 0.01 0.00 0.07 0.10 0.04 -0.07 NA [9,] 0.06 0.03 -0.14 0.05 0.04 0.01 NA [10,] -0.03 0.08 0.02 0.01 0.07 0.04 NA [11,] 0.04 0.00 0.00 0.02 0.04 0.01 NA [12,] 0.03 0.04 0.01 0.00 0.03 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/1v8v21362673049.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/2yx2t1362673049.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/3vbz01362673049.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/411i31362673049.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] [1,] 15.580 15.66 15.730 15.74 15.770 15.780 15.80 15.810 15.82 15.880 15.85 [2,] 15.920 16.02 16.100 16.13 16.210 16.250 16.27 16.210 16.21 16.240 16.32 [3,] 16.425 16.51 16.605 16.65 16.675 16.705 16.71 16.695 16.78 16.735 16.75 [4,] 17.040 17.39 17.540 17.57 17.580 17.560 17.63 17.670 17.71 17.750 17.82 [5,] 17.890 17.96 18.000 18.08 18.000 18.020 18.01 18.020 17.95 17.960 18.00 [,12] [1,] 15.89 [2,] 16.32 [3,] 16.76 [4,] 17.86 [5,] 18.01 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.70256 15.62631 15.67615 15.72115 15.79131 15.86001 15.83276 15.75325 [2,] 17.14744 17.39369 17.53385 17.57885 17.55869 17.54999 17.58724 17.63675 [,9] [,10] [,11] [,12] [1,] 15.81245 15.761 15.78245 15.76665 [2,] 17.74755 17.709 17.71755 17.75335 $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(15.58, 15.92, 16.425, 17.04, 17.89, 15.66, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5eqq01362673049.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.05 0.040 0.010 -0.08 -0.020 -0.02 -0.06 -0.070 0.010 -0.03 0.000 0.00 [2,] 0.07 0.060 0.030 -0.02 -0.010 -0.01 -0.05 0.000 0.010 0.01 0.000 0.01 [3,] 0.09 0.075 0.035 0.02 0.015 0.02 0.01 0.025 0.035 0.03 0.015 0.03 [4,] 0.12 0.130 0.050 0.07 0.040 0.03 0.02 0.070 0.050 0.07 0.040 0.03 [5,] 0.12 0.150 0.050 0.08 0.070 0.07 0.04 0.100 0.060 0.08 0.040 0.04 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.05774839 0.02984774 0.02209935 -0.03805291 -0.01725161 -0.005801292 [2,] 0.12225161 0.12015226 0.04790065 0.07805291 0.04725161 0.045801292 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.03515226 -0.02015226 0.009198708 -0.008701938 -0.01080129 0.01586805 [2,] 0.05515226 0.07015226 0.060801292 0.068701938 0.04080129 0.04413195 $out [1] 0.35 0.08 -0.14 $group [1] 1 3 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0500000000000007, 0.0700000000000003, 0.0899999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6q56n1362673049.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,] 15.660 15.920 16.360 16.490 17.390 17.890 NA [2,] 15.735 16.115 16.480 16.695 17.550 17.960 NA [3,] 15.790 16.210 16.535 16.850 17.605 18.000 NA [4,] 15.835 16.260 16.570 16.985 17.730 18.015 NA [5,] 15.890 16.320 16.600 17.040 17.860 18.080 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 15.74439 16.14386 16.49395 16.71773 17.5229 17.97491 NA [2,] 15.83561 16.27614 16.57605 16.98227 17.6871 18.02509 NA $out [1] 15.58 17.04 $group [1] 1 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(15.66, 15.735, 15.79, 15.835, 15.89, 15.92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7mwsa1362673049.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,] 16.67500 16.5100 16.65625 [2,] 16.78333 16.6275 16.78312 [3,] 16.84333 16.7000 16.86688 [4,] 16.87917 16.7425 16.92250 [5,] 16.93333 16.7800 17.00750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 16.79962 16.64755 16.80331 [2,] 16.88704 16.75245 16.93044 $out [1] 16.54667 16.42500 16.46625 $group [1] 1 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16.675, 16.7833333333333, 16.8433333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1v8v21362673049.ps tmp/1v8v21362673049.png",intern=TRUE)) character(0) > try(system("convert tmp/2yx2t1362673049.ps tmp/2yx2t1362673049.png",intern=TRUE)) character(0) > try(system("convert tmp/3vbz01362673049.ps tmp/3vbz01362673049.png",intern=TRUE)) character(0) > try(system("convert tmp/411i31362673049.ps tmp/411i31362673049.png",intern=TRUE)) character(0) > try(system("convert tmp/5eqq01362673049.ps tmp/5eqq01362673049.png",intern=TRUE)) character(0) > try(system("convert tmp/6q56n1362673049.ps tmp/6q56n1362673049.png",intern=TRUE)) character(0) > try(system("convert tmp/7mwsa1362673049.ps tmp/7mwsa1362673049.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.371 0.693 5.053