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(6.81,6.80,6.80,6.85,6.85,6.85,6.85,6.85,6.85,6.86,6.86,6.88,6.88,6.88,6.91,6.91,6.91,6.91,6.99,6.99,6.99,7.02,7.02,7.05,7.05,7.05,7.05,7.10,7.10,7.10,7.10,7.12,7.13,7.18,7.24,7.24,7.24,7.27,7.27,7.27,7.27,7.30,7.30,7.57,7.76,7.94,7.94,7.96,7.96,7.98,7.99,8.00,8.00,8.04,8.04,8.04,8.04,8.04,8.07,8.07,8.07,8.07,8.11,8.11,8.11,8.12,8.11,8.13,8.15,8.16,8.20,8.20,8.20,8.20,8.23,8.25,8.26,8.31,8.33,8.33,8.36,8.39,8.41,8.50,8.58,8.58,8.66,8.67,8.70,8.71,8.73,8.75,8.76,8.76,8.77,8.78) > 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,] 6.81 6.88 7.05 7.24 7.96 8.07 8.20 8.58 NA [2,] 6.80 6.88 7.05 7.27 7.98 8.07 8.20 8.58 NA [3,] 6.80 6.91 7.05 7.27 7.99 8.11 8.23 8.66 NA [4,] 6.85 6.91 7.10 7.27 8.00 8.11 8.25 8.67 NA [5,] 6.85 6.91 7.10 7.27 8.00 8.11 8.26 8.70 NA [6,] 6.85 6.91 7.10 7.30 8.04 8.12 8.31 8.71 NA [7,] 6.85 6.99 7.10 7.30 8.04 8.11 8.33 8.73 NA [8,] 6.85 6.99 7.12 7.57 8.04 8.13 8.33 8.75 NA [9,] 6.85 6.99 7.13 7.76 8.04 8.15 8.36 8.76 NA [10,] 6.86 7.02 7.18 7.94 8.04 8.16 8.39 8.76 NA [11,] 6.86 7.02 7.24 7.94 8.07 8.20 8.41 8.77 NA [12,] 6.88 7.05 7.24 7.96 8.07 8.20 8.50 8.78 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -0.01 0.00 0.00 0.03 0.02 0.00 0.00 0.00 NA [2,] 0.00 0.03 0.00 0.00 0.01 0.04 0.03 0.08 NA [3,] 0.05 0.00 0.05 0.00 0.01 0.00 0.02 0.01 NA [4,] 0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.03 NA [5,] 0.00 0.00 0.00 0.03 0.04 0.01 0.05 0.01 NA [6,] 0.00 0.08 0.00 0.00 0.00 -0.01 0.02 0.02 NA [7,] 0.00 0.00 0.02 0.27 0.00 0.02 0.00 0.02 NA [8,] 0.00 0.00 0.01 0.19 0.00 0.02 0.03 0.01 NA [9,] 0.01 0.03 0.05 0.18 0.00 0.01 0.03 0.00 NA [10,] 0.00 0.00 0.06 0.00 0.03 0.04 0.02 0.01 NA [11,] 0.02 0.03 0.00 0.02 0.00 0.00 0.09 0.01 NA [12,] 0.00 0.00 0.00 0.00 0.00 0.00 0.08 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/19tsj1424950976.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/2elvw1424950976.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/319fh1424950976.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/41uyx1424950976.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,] 6.810 6.800 6.80 6.850 6.850 6.850 6.850 6.850 6.850 6.860 6.860 6.880 [2,] 6.965 6.965 6.98 7.005 7.005 7.005 7.045 7.055 7.060 7.100 7.130 7.145 [3,] 7.600 7.625 7.63 7.635 7.635 7.670 7.670 7.805 7.900 7.990 8.005 8.015 [4,] 8.135 8.135 8.17 8.180 8.185 8.215 8.220 8.230 8.255 8.275 8.305 8.350 [5,] 8.580 8.580 8.66 8.670 8.700 8.710 8.730 8.750 8.760 8.760 8.770 8.780 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6.946421 6.971421 6.965249 6.978628 6.975835 6.994077 7.013628 7.148628 [2,] 8.253579 8.278579 8.294751 8.291372 8.294165 8.345923 8.326372 8.461372 [,9] [,10] [,11] [,12] [1,] 7.232456 7.333628 7.348628 7.34187 [2,] 8.567544 8.646372 8.661372 8.68813 $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(6.81, 6.965, 7.6, 8.135, 8.58, 6.8, 6.965, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56s5r1424950976.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.000 0.000 0.000 0.000 -0.01 0.00 0.000 0.000 0.000 0.000 0 [2,] 0.00 0.000 0.000 0.000 0.000 0.00 0.00 0.000 0.005 0.000 0.000 0 [3,] 0.00 0.020 0.010 0.000 0.010 0.00 0.01 0.010 0.020 0.015 0.015 0 [4,] 0.01 0.035 0.035 0.005 0.035 0.02 0.02 0.025 0.040 0.035 0.025 0 [5,] 0.02 0.080 0.050 0.010 0.050 0.02 0.02 0.030 0.050 0.060 0.030 0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [1,] -0.005586144 0.0004484975 -0.009551502 -0.002793072 -0.009551502 [2,] 0.005586144 0.0395515025 0.029551502 0.002793072 0.029551502 [,6] [,7] [,8] [,9] [,10] [1,] -0.01117229 -0.001172287 -0.003965359 0.0004484975 -0.004551502 [2,] 0.01117229 0.021172287 0.023965359 0.0395515025 0.034551502 [,11] [,12] [1,] 0.001034641 0 [2,] 0.028965359 0 $out [1] 0.03 0.03 0.08 0.27 0.19 0.18 0.09 0.08 $group [1] 1 4 6 7 8 9 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.00999999999999979, 0, 0, 0.0100000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61prm1424950976.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,] 6.800 6.880 7.050 7.24 7.960 8.070 8.200 8.580 NA [2,] 6.830 6.910 7.075 7.27 7.995 8.110 8.240 8.665 NA [3,] 6.850 6.950 7.100 7.30 8.040 8.115 8.320 8.720 NA [4,] 6.855 7.005 7.155 7.85 8.040 8.155 8.375 8.760 NA [5,] 6.880 7.050 7.240 7.96 8.070 8.200 8.500 8.780 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 6.838597 6.90667 7.063511 7.035458 8.019475 8.094475 8.258426 8.67667 NA [2,] 6.861403 6.99333 7.136489 7.564542 8.060525 8.135525 8.381574 8.76333 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(6.8, 6.83, 6.85, 6.855, 6.88, 6.88, 6.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74di51424950976.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,] 7.598750 7.6000 7.555000 [2,] 7.636250 7.6325 7.588125 [3,] 7.674375 7.6700 7.614375 [4,] 7.774375 7.9450 7.663750 [5,] 7.835000 8.0150 7.733750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.611375 7.527467 7.579882 [2,] 7.737375 7.812533 7.648868 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(7.59875, 7.63625, 7.674375, 7.774375, 7.835, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19tsj1424950976.ps tmp/19tsj1424950976.png",intern=TRUE)) character(0) > try(system("convert tmp/2elvw1424950976.ps tmp/2elvw1424950976.png",intern=TRUE)) character(0) > try(system("convert tmp/319fh1424950976.ps tmp/319fh1424950976.png",intern=TRUE)) character(0) > try(system("convert tmp/41uyx1424950976.ps tmp/41uyx1424950976.png",intern=TRUE)) character(0) > try(system("convert tmp/56s5r1424950976.ps tmp/56s5r1424950976.png",intern=TRUE)) character(0) > try(system("convert tmp/61prm1424950976.ps tmp/61prm1424950976.png",intern=TRUE)) character(0) > try(system("convert tmp/74di51424950976.ps tmp/74di51424950976.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.479 0.409 2.921