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(1.93,2.02,1.85,1.77,1.81,1.67,1.55,1.62,1.79,1.73,1.77,1.95,2.08,2.26,2.02,1.9,1.97,1.76,1.93,1.91,1.96,1.99,1.98,1.96,1.95,2.26,2.07,2.02,2.07,1.88,1.75,1.78,1.87,1.94,2.03,2.13,2.04,2.18,2.02,1.99,2.09,1.88,1.8,1.77,1.85,1.9,2.03,2.02,2.09,2.3,2.16,2.02,2.31,1.98,1.74,1.82,2.07,2.04,2.07,2.13,2.14,2.43,2.26,2.11,2.19,2.04,2.04,2.05,2.08,1.98,2.07,2.12,2.15,2.35,2.19,2.17,2.3,2.09,1.95,1.89,1.95,1.98,1.95,2.06) > 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,] 1.93 2.08 1.95 2.04 2.09 2.14 2.15 NA [2,] 2.02 2.26 2.26 2.18 2.30 2.43 2.35 NA [3,] 1.85 2.02 2.07 2.02 2.16 2.26 2.19 NA [4,] 1.77 1.90 2.02 1.99 2.02 2.11 2.17 NA [5,] 1.81 1.97 2.07 2.09 2.31 2.19 2.30 NA [6,] 1.67 1.76 1.88 1.88 1.98 2.04 2.09 NA [7,] 1.55 1.93 1.75 1.80 1.74 2.04 1.95 NA [8,] 1.62 1.91 1.78 1.77 1.82 2.05 1.89 NA [9,] 1.79 1.96 1.87 1.85 2.07 2.08 1.95 NA [10,] 1.73 1.99 1.94 1.90 2.04 1.98 1.98 NA [11,] 1.77 1.98 2.03 2.03 2.07 2.07 1.95 NA [12,] 1.95 1.96 2.13 2.02 2.13 2.12 2.06 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.09 0.18 0.31 0.14 0.21 0.29 0.20 NA [2,] -0.17 -0.24 -0.19 -0.16 -0.14 -0.17 -0.16 NA [3,] -0.08 -0.12 -0.05 -0.03 -0.14 -0.15 -0.02 NA [4,] 0.04 0.07 0.05 0.10 0.29 0.08 0.13 NA [5,] -0.14 -0.21 -0.19 -0.21 -0.33 -0.15 -0.21 NA [6,] -0.12 0.17 -0.13 -0.08 -0.24 0.00 -0.14 NA [7,] 0.07 -0.02 0.03 -0.03 0.08 0.01 -0.06 NA [8,] 0.17 0.05 0.09 0.08 0.25 0.03 0.06 NA [9,] -0.06 0.03 0.07 0.05 -0.03 -0.10 0.03 NA [10,] 0.04 -0.01 0.09 0.13 0.03 0.09 -0.03 NA [11,] 0.18 -0.02 0.10 -0.01 0.06 0.05 0.11 NA [12,] 0.13 -0.01 -0.09 0.07 0.01 0.03 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/1o7351386680937.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/21wr61386680937.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/3e5u71386680937.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/4dd221386680937.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,] 1.930 2.180 1.850 1.770 1.810 1.67 1.550 1.620 1.790 1.900 1.950 1.950 [2,] 1.995 2.220 2.020 1.945 2.020 1.82 1.745 1.775 1.860 1.920 1.965 1.990 [3,] 2.080 2.260 2.070 2.020 2.090 1.88 1.800 1.820 1.950 1.980 2.030 2.060 [4,] 2.115 2.325 2.175 2.065 2.245 2.01 1.940 1.900 2.015 1.985 2.050 2.125 [5,] 2.150 2.430 2.260 2.170 2.310 2.09 2.040 2.050 2.080 2.040 2.070 2.130 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.008338 2.197296 1.977437 1.948338 1.955634 1.766535 1.683549 1.745352 [2,] 2.151662 2.322704 2.162563 2.091662 2.224366 1.993465 1.916451 1.894648 [,9] [,10] [,11] [,12] [1,] 1.857437 1.941183 1.979239 1.97938 [2,] 2.042563 2.018817 2.080761 2.14062 $out [1] 2.02 1.73 1.77 $group [1] 2 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.93, 1.995, 2.08, 2.115, 2.15, 2.18, 2.22, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5a4sr1386680937.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.09 -0.19 -0.15 0.040 -0.21 -0.240 -0.060 0.030 -0.100 -0.03 -0.020 -0.09 [2,] 0.16 -0.18 -0.13 0.060 -0.21 -0.135 -0.025 0.055 -0.045 0.01 0.020 -0.01 [3,] 0.20 -0.17 -0.08 0.080 -0.21 -0.120 0.010 0.080 0.030 0.04 0.060 0.02 [4,] 0.25 -0.16 -0.04 0.115 -0.17 -0.040 0.050 0.130 0.040 0.09 0.105 0.07 [5,] 0.31 -0.14 -0.02 0.130 -0.14 0.000 0.080 0.170 0.070 0.13 0.180 0.13 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.1462535 -0.1819437 -0.13374655 0.04715489 -0.2338874 -0.17673247 [2,] 0.2537465 -0.1580563 -0.02625345 0.11284511 -0.1861126 -0.06326753 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.03478879 0.03521121 -0.02076063 -0.007774709 0.009239371 -0.03160258 [2,] 0.05478879 0.12478879 0.08076063 0.087774709 0.110760629 0.07160258 $out [1] -0.24 0.29 -0.33 0.17 0.25 $group [1] 2 4 5 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0900000000000001, 0.16, 0.2, 0.25, 0.31, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/660d51386680937.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,] 1.55 1.900 1.750 1.770 1.820 1.980 1.890 NA [2,] 1.70 1.920 1.875 1.865 2.000 2.045 1.950 NA [3,] 1.78 1.965 1.985 2.005 2.070 2.095 2.075 NA [4,] 1.89 2.005 2.070 2.035 2.145 2.165 2.180 NA [5,] 2.02 2.080 2.260 2.180 2.310 2.260 2.350 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.69334 1.926231 1.896059 1.927462 2.003865 2.040267 1.970095 NA [2,] 1.86666 2.003769 2.073941 2.082538 2.136135 2.149733 2.179905 NA $out [1] 2.26 1.76 1.74 2.43 $group [1] 2 2 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.55, 1.7, 1.78, 1.89, 2.02, 1.9, 1.92, 1.965, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/78gvp1386680937.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,] 1.822857 1.800 1.83750 [2,] 1.918571 1.915 1.92625 [3,] 1.991429 2.025 2.00625 [4,] 2.067857 2.075 2.07750 [5,] 2.257143 2.260 2.27250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.923338 1.952023 1.937264 [2,] 2.059519 2.097977 2.075236 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.82285714285714, 1.91857142857143, 1.99142857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o7351386680937.ps tmp/1o7351386680937.png",intern=TRUE)) character(0) > try(system("convert tmp/21wr61386680937.ps tmp/21wr61386680937.png",intern=TRUE)) character(0) > try(system("convert tmp/3e5u71386680937.ps tmp/3e5u71386680937.png",intern=TRUE)) character(0) > try(system("convert tmp/4dd221386680937.ps tmp/4dd221386680937.png",intern=TRUE)) character(0) > try(system("convert tmp/5a4sr1386680937.ps tmp/5a4sr1386680937.png",intern=TRUE)) character(0) > try(system("convert tmp/660d51386680937.ps tmp/660d51386680937.png",intern=TRUE)) character(0) > try(system("convert tmp/78gvp1386680937.ps tmp/78gvp1386680937.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.187 1.016 6.181