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(104.31,104.76,105.68,106.22,106.69,107.17,107.46,107.16,107.35,107.65,107.75,108.22,108.68,109.35,109.54,109.46,108.86,108.63,107.55,106.8,106.07,106.44,106.38,107.07,106.54,107.83,108.06,108.49,107.9,108.02,108.46,108.31,107.69,107.71,107.74,108.15,107.39,109.16,109.65,110.4,110.26,110.5,110.31,109.85,109.4,109.75,109.79,110.27,109.19,111.78,111.58,111.71,111.59,112.14,111.73,111.32,111.29,112.45,112.61,114.3,113.32,114.85,115.35,114.9,115.49,115.55,115.44,114.81,113.83,113.64,113.26,114.68) > 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,] 104.31 108.68 106.54 107.39 109.19 113.32 NA [2,] 104.76 109.35 107.83 109.16 111.78 114.85 NA [3,] 105.68 109.54 108.06 109.65 111.58 115.35 NA [4,] 106.22 109.46 108.49 110.40 111.71 114.90 NA [5,] 106.69 108.86 107.90 110.26 111.59 115.49 NA [6,] 107.17 108.63 108.02 110.50 112.14 115.55 NA [7,] 107.46 107.55 108.46 110.31 111.73 115.44 NA [8,] 107.16 106.80 108.31 109.85 111.32 114.81 NA [9,] 107.35 106.07 107.69 109.40 111.29 113.83 NA [10,] 107.65 106.44 107.71 109.75 112.45 113.64 NA [11,] 107.75 106.38 107.74 109.79 112.61 113.26 NA [12,] 108.22 107.07 108.15 110.27 114.30 114.68 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.45 0.67 1.29 1.77 2.59 1.53 NA [2,] 0.92 0.19 0.23 0.49 -0.20 0.50 NA [3,] 0.54 -0.08 0.43 0.75 0.13 -0.45 NA [4,] 0.47 -0.60 -0.59 -0.14 -0.12 0.59 NA [5,] 0.48 -0.23 0.12 0.24 0.55 0.06 NA [6,] 0.29 -1.08 0.44 -0.19 -0.41 -0.11 NA [7,] -0.30 -0.75 -0.15 -0.46 -0.41 -0.63 NA [8,] 0.19 -0.73 -0.62 -0.45 -0.03 -0.98 NA [9,] 0.30 0.37 0.02 0.35 1.16 -0.19 NA [10,] 0.10 -0.06 0.03 0.04 0.16 -0.38 NA [11,] 0.47 0.69 0.41 0.48 1.69 1.42 NA [12,] 0.46 -0.53 -0.76 -1.08 -0.98 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/12l8l1413044298.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/24qpi1413044298.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/3b6bn1413044298.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/4dcwu1413044298.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,] 104.310 104.760 105.680 106.22 106.69 107.170 107.460 106.80 106.070 [2,] 106.540 107.830 108.060 108.49 107.90 108.020 107.550 107.16 107.350 [3,] 108.035 109.255 109.595 109.93 109.56 109.565 109.385 109.08 108.545 [4,] 109.190 111.780 111.580 111.71 111.59 112.140 111.730 111.32 111.290 [5,] 109.190 114.850 115.350 114.90 115.49 115.550 115.440 114.81 113.830 [,10] [,11] [,12] [1,] 106.44 106.38 107.070 [2,] 107.65 107.74 108.150 [3,] 108.73 108.77 109.245 [4,] 112.45 112.61 114.300 [5,] 113.64 113.26 114.680 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 106.3257 106.7071 107.3245 107.853 107.1798 106.9075 106.6888 106.3967 [2,] 109.7443 111.8029 111.8655 112.007 111.9402 112.2225 112.0812 111.7633 [,9] [,10] [,11] [,12] [1,] 106.0036 105.6338 105.6287 105.2781 [2,] 111.0864 111.8262 111.9113 113.2119 $out [1] 113.32 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(104.31, 106.54, 108.035, 109.19, 109.19, 104.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5h5zs1413044298.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.45 -0.20 -0.45 -0.60 -0.23 -1.08 -0.750 -0.980 -0.190 -0.060 0.410 -1.08 [2,] 0.67 0.19 -0.08 -0.59 0.06 -0.41 -0.630 -0.730 0.020 -0.060 0.470 -0.98 [3,] 1.41 0.36 0.28 -0.13 0.18 -0.15 -0.435 -0.535 0.325 0.035 0.585 -0.76 [4,] 1.77 0.50 0.54 0.47 0.48 0.29 -0.300 -0.030 0.370 0.100 1.420 -0.53 [5,] 2.59 0.92 0.75 0.59 0.55 0.44 -0.150 0.190 0.370 0.160 1.690 -0.53 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.7004645 0.16004 -0.11992 -0.8137342 -0.09091357 -0.6015226 -0.6478607 [2,] 2.1195355 0.55996 0.67992 0.5537342 0.45091357 0.3015226 -0.2221393 [,8] [,9] [,10] [,11] [,12] [1,] -0.98652261 0.0992387 -0.06820517 -0.02778068 -1.0779689 [2,] -0.08347739 0.5507613 0.13820517 1.19778068 -0.4420311 $out [1] 1.16 -0.38 0.46 $group [1] 9 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.450000000000003, 0.669999999999987, 1.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6nbow1413044298.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,] 104.310 106.070 107.690 109.160 111.290 113.260 NA [2,] 105.950 106.620 107.725 109.525 111.450 113.735 NA [3,] 107.165 108.090 107.960 109.820 111.720 114.830 NA [4,] 107.555 109.105 108.230 110.290 112.295 115.395 NA [5,] 108.220 109.540 108.490 110.500 112.610 115.550 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 106.4329 106.9566 107.7297 109.4711 111.3346 114.0729 NA [2,] 107.8971 109.2234 108.1903 110.1689 112.1054 115.5871 NA $out [1] 106.54 107.39 109.19 114.30 $group [1] 3 4 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(104.31, 105.95, 107.165, 107.555, 108.22, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7m3671413044298.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,] 109.2717 108.0350 109.1262 [2,] 109.5975 108.7500 109.3881 [3,] 109.8425 109.2500 109.7094 [4,] 110.1775 109.5625 109.8875 [5,] 110.4483 109.9300 110.0575 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 109.578 108.8794 109.4816 [2,] 110.107 109.6206 109.9371 $out [1] 108.2383 107.9075 110.7300 $group [1] 1 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(109.271666666667, 109.5975, 109.8425, 110.1775, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12l8l1413044298.ps tmp/12l8l1413044298.png",intern=TRUE)) character(0) > try(system("convert tmp/24qpi1413044298.ps tmp/24qpi1413044298.png",intern=TRUE)) character(0) > try(system("convert tmp/3b6bn1413044298.ps tmp/3b6bn1413044298.png",intern=TRUE)) character(0) > try(system("convert tmp/4dcwu1413044298.ps tmp/4dcwu1413044298.png",intern=TRUE)) character(0) > try(system("convert tmp/5h5zs1413044298.ps tmp/5h5zs1413044298.png",intern=TRUE)) character(0) > try(system("convert tmp/6nbow1413044298.ps tmp/6nbow1413044298.png",intern=TRUE)) character(0) > try(system("convert tmp/7m3671413044298.ps tmp/7m3671413044298.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.448 0.432 2.919