R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(107.2,107.56,107.72,108.14,108.16,108.16,108.16,108.1,108.95,110.49,110.72,110.82,110.82,110.75,110.71,110.86,110.84,110.84,110.84,110.92,111.46,112.46,113.04,113.15,113.15,113.21,113.37,113.47,113.71,113.71,113.71,113.8,115.46,117,117.94,118.08,118.08,118.47,118.49,118.45,118.54,118.55,118.55,118.55,119.04,121.37,122,122.14,122.14,122.03,121.91,122.23,121.73,121.83,121.83,122.49,123.02,125.98,126.13,126.39,126.39,126.57,126.87,127.26,126.82,126.7,126.7,126.7,128.53,130.37,130.39,130.65,130.65,130.65,130.85,130.89,130.85,131.6,131.6,131.6,132.53,133.05,133.49,133.46) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.20 110.82 113.15 118.08 122.14 126.39 130.65 NA [2,] 107.56 110.75 113.21 118.47 122.03 126.57 130.65 NA [3,] 107.72 110.71 113.37 118.49 121.91 126.87 130.85 NA [4,] 108.14 110.86 113.47 118.45 122.23 127.26 130.89 NA [5,] 108.16 110.84 113.71 118.54 121.73 126.82 130.85 NA [6,] 108.16 110.84 113.71 118.55 121.83 126.70 131.60 NA [7,] 108.16 110.84 113.71 118.55 121.83 126.70 131.60 NA [8,] 108.10 110.92 113.80 118.55 122.49 126.70 131.60 NA [9,] 108.95 111.46 115.46 119.04 123.02 128.53 132.53 NA [10,] 110.49 112.46 117.00 121.37 125.98 130.37 133.05 NA [11,] 110.72 113.04 117.94 122.00 126.13 130.39 133.49 NA [12,] 110.82 113.15 118.08 122.14 126.39 130.65 133.46 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.36 -0.07 0.06 0.39 -0.11 0.18 0.00 NA [2,] 0.16 -0.04 0.16 0.02 -0.12 0.30 0.20 NA [3,] 0.42 0.15 0.10 -0.04 0.32 0.39 0.04 NA [4,] 0.02 -0.02 0.24 0.09 -0.50 -0.44 -0.04 NA [5,] 0.00 0.00 0.00 0.01 0.10 -0.12 0.75 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] -0.06 0.08 0.09 0.00 0.66 0.00 0.00 NA [8,] 0.85 0.54 1.66 0.49 0.53 1.83 0.93 NA [9,] 1.54 1.00 1.54 2.33 2.96 1.84 0.52 NA [10,] 0.23 0.58 0.94 0.63 0.15 0.02 0.44 NA [11,] 0.10 0.11 0.14 0.14 0.26 0.26 -0.03 NA [12,] 0.00 0.00 0.00 0.00 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/fisher/rcomp/tmp/124sr1381916825.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/fisher/rcomp/tmp/20hg71381916825.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/fisher/rcomp/tmp/37j8e1381916825.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/fisher/rcomp/tmp/4jdbn1381916825.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,] 107.200 107.56 107.72 108.140 108.160 108.160 108.160 108.100 108.950 [2,] 111.985 111.98 112.04 112.165 112.275 112.275 112.275 112.360 113.460 [3,] 118.080 118.47 118.49 118.450 118.540 118.550 118.550 118.550 119.040 [4,] 124.265 124.30 124.39 124.745 124.275 124.265 124.265 124.595 125.775 [5,] 130.650 130.65 130.85 130.890 130.850 131.600 131.600 131.600 132.530 [,10] [,11] [,12] [1,] 110.490 110.72 110.820 [2,] 114.730 115.49 115.615 [3,] 121.370 122.00 122.140 [4,] 128.175 128.26 128.520 [5,] 133.050 133.49 133.460 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 110.7466 111.1127 111.1148 110.9374 111.3738 111.3898 111.3898 111.2435 [2,] 125.4134 125.8273 125.8652 125.9626 125.7062 125.7102 125.7102 125.8565 [,9] [,10] [,11] [,12] [1,] 111.6857 113.3409 114.374 114.4333 [2,] 126.3943 129.3991 129.626 129.8467 $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(107.2, 111.985, 118.08, 124.265, 130.65, 107.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5vpl71381916825.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] [1,] -0.110 -0.12 -0.040 -0.500 0.000 0 -0.060 0.490 0.520 0.020 -0.030 [2,] -0.035 -0.01 0.070 -0.240 0.000 0 0.000 0.535 1.270 0.190 0.105 [3,] 0.060 0.16 0.150 -0.020 0.000 0 0.000 0.850 1.540 0.440 0.140 [4,] 0.270 0.18 0.355 0.055 0.055 0 0.085 1.295 2.085 0.605 0.200 [5,] 0.390 0.30 0.420 0.240 0.100 0 0.090 1.830 2.960 0.940 0.260 [,12] [1,] 0 [2,] 0 [3,] 0 [4,] 0 [5,] 0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.1221411 0.04653507 -0.0201974 -0.1961692 -0.03284511 0 -0.05076063 [2,] 0.2421411 0.27346493 0.3201974 0.1561692 0.03284511 0 0.05076063 [,8] [,9] [,10] [,11] [,12] [1,] 0.3961403 1.053295 0.1921687 0.08326753 0 [2,] 1.3038597 2.026705 0.6878313 0.19673247 0 $out [1] -0.12 0.75 0.66 $group [1] 5 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.109999999999999, -0.0349999999999966, 0.0599999999999881, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/621g31381916825.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] [1,] 107.20 110.71 113.15 118.080 121.730 126.390 130.65 NA [2,] 107.91 110.83 113.42 118.480 121.870 126.700 130.85 NA [3,] 108.16 110.85 113.71 118.550 122.185 126.845 131.60 NA [4,] 109.72 111.96 116.23 120.205 124.500 129.450 132.79 NA [5,] 110.82 113.15 118.08 122.140 126.390 130.650 133.49 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.3344 110.3346 112.4283 117.7632 120.9854 125.5907 130.7152 NA [2,] 108.9856 111.3654 114.9917 119.3368 123.3846 128.0993 132.4848 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(107.2, 107.91, 108.16, 109.72, 110.82, 110.71, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7w3ux1381916825.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,] 118.3471 118.080 118.1250 [2,] 118.6121 118.480 118.2425 [3,] 118.7700 118.550 118.3650 [4,] 120.6936 120.205 120.5350 [5,] 122.0986 122.140 122.0675 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 117.8206 117.7632 117.3194 [2,] 119.7194 119.3368 119.4106 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(118.347142857143, 118.612142857143, 118.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/124sr1381916825.ps tmp/124sr1381916825.png",intern=TRUE)) character(0) > try(system("convert tmp/20hg71381916825.ps tmp/20hg71381916825.png",intern=TRUE)) character(0) > try(system("convert tmp/37j8e1381916825.ps tmp/37j8e1381916825.png",intern=TRUE)) character(0) > try(system("convert tmp/4jdbn1381916825.ps tmp/4jdbn1381916825.png",intern=TRUE)) character(0) > try(system("convert tmp/5vpl71381916825.ps tmp/5vpl71381916825.png",intern=TRUE)) character(0) > try(system("convert tmp/621g31381916825.ps tmp/621g31381916825.png",intern=TRUE)) character(0) > try(system("convert tmp/7w3ux1381916825.ps tmp/7w3ux1381916825.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.444 0.624 4.059