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 = '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,] 105.86 107.98 110.37 112.24 115.21 113.62 NA [2,] 105.97 107.83 110.41 112.21 115.18 113.72 NA [3,] 106.08 108.69 110.64 112.35 115.24 113.53 NA [4,] 106.04 108.91 110.88 112.71 116.24 113.69 NA [5,] 106.65 109.67 110.91 113.08 116.68 114.61 NA [6,] 106.85 109.72 110.99 113.26 116.77 114.46 NA [7,] 106.85 109.72 110.99 113.26 116.77 114.68 NA [8,] 106.95 109.72 110.99 113.27 116.84 114.72 NA [9,] 107.29 109.74 111.28 113.85 116.94 115.62 NA [10,] 107.65 109.78 112.37 114.92 117.83 115.40 NA [11,] 107.87 110.49 112.35 115.24 118.16 115.43 NA [12,] 107.98 110.37 112.24 115.21 118.27 115.44 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.11 -0.15 0.04 -0.03 -0.03 0.10 NA [2,] 0.11 0.86 0.23 0.14 0.06 -0.19 NA [3,] -0.04 0.22 0.24 0.36 1.00 0.16 NA [4,] 0.61 0.76 0.03 0.37 0.44 0.92 NA [5,] 0.20 0.05 0.08 0.18 0.09 -0.15 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.22 NA [7,] 0.10 0.00 0.00 0.01 0.07 0.04 NA [8,] 0.34 0.02 0.29 0.58 0.10 0.90 NA [9,] 0.36 0.04 1.09 1.07 0.89 -0.22 NA [10,] 0.22 0.71 -0.02 0.32 0.33 0.03 NA [11,] 0.11 -0.12 -0.11 -0.03 0.11 0.01 NA [12,] 0.00 0.00 0.00 0.00 -4.65 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/1yvgn1413123271.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/2158x1413123271.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/3ucx91413123271.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/4ckfg1413123271.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,] 105.860 105.97 106.080 106.040 106.650 106.850 106.850 106.95 107.290 [2,] 107.980 107.83 108.690 108.910 109.670 109.720 109.720 109.72 109.740 [3,] 111.305 111.31 111.495 111.795 111.995 112.125 112.125 112.13 112.565 [4,] 113.620 113.72 113.530 113.690 114.610 114.460 114.680 114.72 115.620 [5,] 115.210 115.18 115.240 116.240 116.680 116.770 116.770 116.84 116.940 [,10] [,11] [,12] [1,] 107.650 107.870 107.980 [2,] 109.780 110.490 110.370 [3,] 113.645 113.795 113.725 [4,] 115.400 115.430 115.440 [5,] 117.830 118.160 118.270 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.667 107.5108 108.373 108.7117 108.8085 109.0675 108.9256 108.9048 [2,] 114.943 115.1092 114.617 114.8783 115.1815 115.1825 115.3244 115.3552 [,9] [,10] [,11] [,12] [1,] 108.7722 110.0199 110.6085 110.4547 [2,] 116.3578 117.2701 116.9815 116.9953 $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(105.86, 107.98, 111.305, 113.62, 115.21, 105.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54f5q1413123271.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.150 -0.190 -0.04 0.030 0.050 0 0.000 0.020 -0.220 -0.02 -0.12 0 [2,] -0.030 0.060 0.16 0.370 0.050 0 0.000 0.100 0.040 0.03 -0.11 0 [3,] 0.005 0.125 0.23 0.525 0.085 0 0.025 0.315 0.625 0.27 -0.01 0 [4,] 0.100 0.230 0.36 0.760 0.180 0 0.070 0.580 1.070 0.33 0.11 0 [5,] 0.110 0.230 0.36 0.920 0.200 0 0.100 0.900 1.090 0.71 0.11 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.0788542 0.01534451 0.1009935 0.2734374 0.001145801 0 -0.02015226 [2,] 0.0888542 0.23465549 0.3590065 0.7765626 0.168854199 0 0.07015226 [,8] [,9] [,10] [,11] [,12] [1,] 0.005384497 -0.03938327 0.07649031 -0.1519071 0 [2,] 0.624615503 1.28938327 0.46350969 0.1319071 0 $out [1] 0.86 1.00 -0.15 0.22 -4.65 $group [1] 2 3 5 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.150000000000006, -0.0300000000000011, 0.00500000000000256, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dw8s1413123271.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,] 105.86 107.83 110.37 112.210 115.180 113.530 NA [2,] 106.06 108.80 110.76 112.530 115.740 113.705 NA [3,] 106.85 109.72 110.99 113.260 116.770 114.645 NA [4,] 107.47 109.76 111.76 114.385 117.385 115.415 NA [5,] 107.98 110.49 112.37 115.240 118.270 115.620 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 106.2069 109.2821 110.5339 112.4139 116.0197 113.8651 NA [2,] 107.4931 110.1579 111.4461 114.1061 117.5203 115.4249 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(105.86, 106.06, 106.85, 107.47, 107.98, 107.83, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7buq11413123271.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,] 110.8800 111.305 110.9087 [2,] 111.2500 111.645 111.3150 [3,] 112.0267 112.125 112.1425 [4,] 112.7225 113.105 112.7525 [5,] 113.2567 113.795 113.1687 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 111.3550 111.4591 111.4868 [2,] 112.6983 112.7909 112.7982 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(110.88, 111.25, 112.026666666667, 112.7225, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yvgn1413123271.ps tmp/1yvgn1413123271.png",intern=TRUE)) character(0) > try(system("convert tmp/2158x1413123271.ps tmp/2158x1413123271.png",intern=TRUE)) character(0) > try(system("convert tmp/3ucx91413123271.ps tmp/3ucx91413123271.png",intern=TRUE)) character(0) > try(system("convert tmp/4ckfg1413123271.ps tmp/4ckfg1413123271.png",intern=TRUE)) character(0) > try(system("convert tmp/54f5q1413123271.ps tmp/54f5q1413123271.png",intern=TRUE)) character(0) > try(system("convert tmp/6dw8s1413123271.ps tmp/6dw8s1413123271.png",intern=TRUE)) character(0) > try(system("convert tmp/7buq11413123271.ps tmp/7buq11413123271.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.509 0.432 2.968