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(105.86,105.97,106.08,106.04,106.65,106.85,106.85,106.95,107.29,107.65,107.87,107.98,107.98,107.83,108.69,108.91,109.67,109.72,109.72,109.72,109.74,109.78,110.49,110.37,110.37,110.41,110.64,110.88,110.91,110.99,110.99,110.99,111.28,112.37,112.35,112.24,112.24,112.21,112.35,112.71,113.08,113.26,113.26,113.27,113.85,114.92,115.24,115.21,115.21,115.18,115.24,116.24,116.68,116.77,116.77,116.84,116.94,117.83,118.16,118.27,113.62,113.72,113.53,113.69,114.61,114.46,114.68,114.72,115.62,115.4,115.43,115.44) > par1 = '6' > par1 <- '6' > #'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] 12 > 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] 12 12 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 105.86 106.85 107.98 109.72 110.37 110.99 112.24 113.26 115.21 116.77 [2,] 105.97 106.95 107.83 109.72 110.41 110.99 112.21 113.27 115.18 116.84 [3,] 106.08 107.29 108.69 109.74 110.64 111.28 112.35 113.85 115.24 116.94 [4,] 106.04 107.65 108.91 109.78 110.88 112.37 112.71 114.92 116.24 117.83 [5,] 106.65 107.87 109.67 110.49 110.91 112.35 113.08 115.24 116.68 118.16 [6,] 106.85 107.98 109.72 110.37 110.99 112.24 113.26 115.21 116.77 118.27 [,11] [,12] [,13] [1,] 113.62 114.68 NA [2,] 113.72 114.72 NA [3,] 113.53 115.62 NA [4,] 113.69 115.40 NA [5,] 114.61 115.43 NA [6,] 114.46 115.44 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.11 0.10 -0.15 0.00 0.04 0.00 -0.03 0.01 -0.03 0.07 0.10 0.04 [2,] 0.11 0.34 0.86 0.02 0.23 0.29 0.14 0.58 0.06 0.10 -0.19 0.90 [3,] -0.04 0.36 0.22 0.04 0.24 1.09 0.36 1.07 1.00 0.89 0.16 -0.22 [4,] 0.61 0.22 0.76 0.71 0.03 -0.02 0.37 0.32 0.44 0.33 0.92 0.03 [5,] 0.20 0.11 0.05 -0.12 0.08 -0.11 0.18 -0.03 0.09 0.11 -0.15 0.01 [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -4.65 0.22 NA [,13] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] 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/1k3x01413119860.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/27hwo1413119860.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/3qkhd1413119860.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/4mgfd1413119860.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] [1,] 105.860 105.970 106.080 106.040 106.650 106.850 [2,] 108.850 108.775 109.215 109.345 110.080 110.045 [3,] 111.615 111.600 111.815 112.540 112.715 112.750 [4,] 114.150 114.220 114.545 115.160 115.335 115.325 [5,] 116.770 116.840 116.940 117.830 118.160 118.270 $n [1] 12 12 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 109.1976 109.1165 109.384 109.8877 110.3182 110.3418 [2,] 114.0324 114.0835 114.246 115.1923 115.1118 115.1582 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" Warning message: In bxp(list(stats = c(105.86, 108.85, 111.615, 114.15, 116.77, 105.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5u96p1413119860.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] [1,] -0.150 -0.190 -0.220 -0.020 -0.150 0 [2,] -0.015 0.080 0.100 0.125 -0.070 0 [3,] 0.025 0.185 0.300 0.350 0.065 0 [4,] 0.085 0.460 0.945 0.660 0.110 0 [5,] 0.110 0.900 1.090 0.920 0.200 0 $n [1] 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.02061067 0.01167945 -0.08541017 0.1059829 -0.01709921 0 [2,] 0.07061067 0.35832055 0.68541017 0.5940171 0.14709921 0 $out [1] -4.65 0.22 $group [1] 6 6 $names [1] "1" "2" "3" "4" "5" "6" Warning message: In bxp(list(stats = c(-0.150000000000006, -0.0149999999999935, 0.0249999999999915, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6p5yn1413119860.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] [,10] [1,] 105.86 106.85 107.83 109.72 110.37 110.99 112.21 113.260 115.18 116.770 [2,] 105.97 106.95 107.98 109.72 110.41 110.99 112.24 113.270 115.21 116.840 [3,] 106.06 107.47 108.80 109.76 110.76 111.76 112.53 114.385 115.74 117.385 [4,] 106.65 107.87 109.67 110.37 110.91 112.35 113.08 115.210 116.68 118.160 [5,] 106.85 107.98 109.72 110.49 110.99 112.37 113.26 115.240 116.77 118.270 [,11] [,12] [,13] [1,] 113.530 114.680 NA [2,] 113.620 114.720 NA [3,] 113.705 115.415 NA [4,] 114.460 115.440 NA [5,] 114.610 115.620 NA $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.6214 106.8766 107.7099 109.3407 110.4375 110.8828 111.9882 113.1336 [2,] 106.4986 108.0634 109.8901 110.1793 111.0825 112.6372 113.0718 115.6364 [,9] [,10] [,11] [,12] [,13] [1,] 114.7918 116.5336 113.1632 114.9506 NA [2,] 116.6882 118.2364 114.2468 115.8794 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(105.86, 105.97, 106.06, 106.65, 106.85, 106.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7czao1413119860.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.4625 111.6000 111.5850 [2,] 111.4842 111.6150 111.6087 [3,] 111.9862 112.1775 112.0694 [4,] 112.5950 112.7150 112.7375 [5,] 112.6300 112.7500 112.7862 $n [1] 6 6 6 $conf [,1] [,2] [,3] [1,] 111.2697 111.468 111.3413 [2,] 112.7028 112.887 112.7975 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(111.4625, 111.484166666667, 111.98625, 112.595, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1k3x01413119860.ps tmp/1k3x01413119860.png",intern=TRUE)) character(0) > try(system("convert tmp/27hwo1413119860.ps tmp/27hwo1413119860.png",intern=TRUE)) character(0) > try(system("convert tmp/3qkhd1413119860.ps tmp/3qkhd1413119860.png",intern=TRUE)) character(0) > try(system("convert tmp/4mgfd1413119860.ps tmp/4mgfd1413119860.png",intern=TRUE)) character(0) > try(system("convert tmp/5u96p1413119860.ps tmp/5u96p1413119860.png",intern=TRUE)) character(0) > try(system("convert tmp/6p5yn1413119860.ps tmp/6p5yn1413119860.png",intern=TRUE)) character(0) > try(system("convert tmp/7czao1413119860.ps tmp/7czao1413119860.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.415 0.465 2.899