R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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.8,1.8,1.81,1.81,1.81,1.81,1.81,1.81,1.82,1.82,1.81,1.8,1.8,1.81,1.81,1.81,1.81,1.81,1.81,1.82,1.82,1.82,1.83,1.83,1.83,1.84,1.85,1.86,1.86,1.87,1.87,1.86,1.88,1.89,1.91,1.91,1.91,1.91,1.92,1.93,1.93,1.94,1.94,1.95,1.95,1.96,1.97,1.97,1.97,1.97,1.98,1.98,1.99,1.99,1.99,2,2,2.01,2.01,2.02,2.01,2.01,2.03,2.03,2.04,2.05,2.05,2.06,2.06,2.06,2.04,2.04,2.04,2.03,2.03,2.03,2.03,2.03,2.03,2.03,2.03,2.03,2.02,2.03,2.03,2.02,2.03,2.04,2.05,2.05,2.05,2.05,2.07,2.07,2.08,2.08) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1.80 1.80 1.83 1.91 1.97 2.01 2.04 2.03 NA [2,] 1.80 1.81 1.84 1.91 1.97 2.01 2.03 2.02 NA [3,] 1.81 1.81 1.85 1.92 1.98 2.03 2.03 2.03 NA [4,] 1.81 1.81 1.86 1.93 1.98 2.03 2.03 2.04 NA [5,] 1.81 1.81 1.86 1.93 1.99 2.04 2.03 2.05 NA [6,] 1.81 1.81 1.87 1.94 1.99 2.05 2.03 2.05 NA [7,] 1.81 1.81 1.87 1.94 1.99 2.05 2.03 2.05 NA [8,] 1.81 1.82 1.86 1.95 2.00 2.06 2.03 2.05 NA [9,] 1.82 1.82 1.88 1.95 2.00 2.06 2.03 2.07 NA [10,] 1.82 1.82 1.89 1.96 2.01 2.06 2.03 2.07 NA [11,] 1.81 1.83 1.91 1.97 2.01 2.04 2.02 2.08 NA [12,] 1.80 1.83 1.91 1.97 2.02 2.04 2.03 2.08 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.00 0.01 0.01 0.00 0.00 0.00 -0.01 -0.01 NA [2,] 0.01 0.00 0.01 0.01 0.01 0.02 0.00 0.01 NA [3,] 0.00 0.00 0.01 0.01 0.00 0.00 0.00 0.01 NA [4,] 0.00 0.00 0.00 0.00 0.01 0.01 0.00 0.01 NA [5,] 0.00 0.00 0.01 0.01 0.00 0.01 0.00 0.00 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.00 0.01 -0.01 0.01 0.01 0.01 0.00 0.00 NA [8,] 0.01 0.00 0.02 0.00 0.00 0.00 0.00 0.02 NA [9,] 0.00 0.00 0.01 0.01 0.01 0.00 0.00 0.00 NA [10,] -0.01 0.01 0.02 0.01 0.00 -0.02 -0.01 0.01 NA [11,] -0.01 0.00 0.00 0.00 0.01 0.00 0.01 0.00 NA [12,] 0.00 0.00 0.00 0.00 -0.01 0.00 0.00 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/11ohv1413124505.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/2pjoe1413124505.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/3ybvv1413124505.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/449tz1413124505.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.800 1.800 1.81 1.810 1.810 1.810 1.810 1.810 1.820 1.820 1.81 1.800 [2,] 1.815 1.825 1.83 1.835 1.835 1.840 1.840 1.840 1.850 1.855 1.87 1.870 [3,] 1.940 1.940 1.95 1.955 1.960 1.965 1.965 1.975 1.975 1.985 1.99 1.995 [4,] 2.020 2.015 2.03 2.030 2.035 2.040 2.040 2.040 2.045 2.045 2.03 2.035 [5,] 2.040 2.030 2.03 2.040 2.050 2.050 2.050 2.060 2.070 2.070 2.08 2.080 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.825484 1.833863 1.838277 1.84607 1.848277 1.853277 1.853277 1.863277 [2,] 2.054516 2.046137 2.061723 2.06393 2.071723 2.076723 2.076723 2.086723 [,9] [,10] [,11] [,12] [1,] 1.86607 1.878863 1.900622 1.902829 [2,] 2.08393 2.091137 2.079378 2.087171 $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.8, 1.815, 1.94, 2.02, 2.04, 1.8, 1.825, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5u11a1413124505.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.010 0.000 0.00 0.00 0.00 0 -0.010 0.000 0.00 -0.020 0.000 0 [2,] -0.005 0.005 0.00 0.00 0.00 0 0.000 0.000 0.00 -0.010 0.000 0 [3,] 0.000 0.010 0.00 0.00 0.00 0 0.005 0.000 0.00 0.005 0.000 0 [4,] 0.005 0.010 0.01 0.01 0.01 0 0.010 0.015 0.01 0.010 0.005 0 [5,] 0.010 0.010 0.01 0.01 0.01 0 0.010 0.020 0.01 0.020 0.010 0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.005586144 0.007206928 -0.005586144 -0.005586144 -0.005586144 0 [2,] 0.005586144 0.012793072 0.005586144 0.005586144 0.005586144 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.0005861436 -0.008379215 -0.005586144 -0.006172287 -0.002793072 0 [2,] 0.0105861436 0.008379215 0.005586144 0.016172287 0.002793072 0 $out [1] 0.02 -0.01 -0.01 $group [1] 2 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0100000000000002, -0.00499999999999989, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60b8g1413124505.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] [,8] [,9] [1,] 1.800 1.80 1.830 1.910 1.970 2.010 2.03 2.020 NA [2,] 1.805 1.81 1.855 1.925 1.980 2.030 2.03 2.035 NA [3,] 1.810 1.81 1.865 1.940 1.990 2.040 2.03 2.050 NA [4,] 1.810 1.82 1.885 1.955 2.005 2.055 2.03 2.070 NA [5,] 1.810 1.83 1.910 1.970 2.020 2.060 2.03 2.080 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1.807719 1.805439 1.851317 1.926317 1.978597 2.028597 2.03 2.034036 NA [2,] 1.812281 1.814561 1.878683 1.953683 2.001403 2.051403 2.03 2.065964 NA $out [1] 1.82 1.82 2.04 2.02 $group [1] 1 1 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(1.8, 1.805, 1.81, 1.81, 1.81, 1.8, 1.81, 1.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qc8s1413124505.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.923750 1.9400 1.918750 [2,] 1.934375 1.9525 1.936875 [3,] 1.943750 1.9650 1.943750 [4,] 1.955625 1.9800 1.953125 [5,] 1.960000 1.9950 1.961250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.934058 1.952457 1.936338 [2,] 1.953442 1.977543 1.951162 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.92375, 1.934375, 1.94375, 1.955625, 1.96, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11ohv1413124505.ps tmp/11ohv1413124505.png",intern=TRUE)) character(0) > try(system("convert tmp/2pjoe1413124505.ps tmp/2pjoe1413124505.png",intern=TRUE)) character(0) > try(system("convert tmp/3ybvv1413124505.ps tmp/3ybvv1413124505.png",intern=TRUE)) character(0) > try(system("convert tmp/449tz1413124505.ps tmp/449tz1413124505.png",intern=TRUE)) character(0) > try(system("convert tmp/5u11a1413124505.ps tmp/5u11a1413124505.png",intern=TRUE)) character(0) > try(system("convert tmp/60b8g1413124505.ps tmp/60b8g1413124505.png",intern=TRUE)) character(0) > try(system("convert tmp/7qc8s1413124505.ps tmp/7qc8s1413124505.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.539 0.459 3.028