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(16.3,16.37,16.38,16.37,16.42,16.43,16.44,16.53,16.55,16.56,16.6,16.61,16.62,16.64,16.61,16.74,16.87,16.89,16.89,16.99,17.06,17.1,17.11,17.17,17.17,17.21,17.37,17.43,17.44,17.46,17.42,17.47,17.45,17.44,17.46,17.47,17.47,17.56,17.61,17.61,17.6,17.57,17.59,17.59,17.68,17.73,17.75,17.75,17.75,17.85,18.06,18.05,18.16,18.2,18.21,18.33,18.36,18.37,18.4,18.47,18.49,18.5,18.53,18.56,18.6,18.61,18.62,18.61,18.65,18.77,18.78,18.78,18.8,18.85,18.85,18.98,19.06,19.08,19.19,19.21,19.29,19.3,19.36,19.36) > 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,] 16.30 16.62 17.17 17.47 17.75 18.49 18.80 NA [2,] 16.37 16.64 17.21 17.56 17.85 18.50 18.85 NA [3,] 16.38 16.61 17.37 17.61 18.06 18.53 18.85 NA [4,] 16.37 16.74 17.43 17.61 18.05 18.56 18.98 NA [5,] 16.42 16.87 17.44 17.60 18.16 18.60 19.06 NA [6,] 16.43 16.89 17.46 17.57 18.20 18.61 19.08 NA [7,] 16.44 16.89 17.42 17.59 18.21 18.62 19.19 NA [8,] 16.53 16.99 17.47 17.59 18.33 18.61 19.21 NA [9,] 16.55 17.06 17.45 17.68 18.36 18.65 19.29 NA [10,] 16.56 17.10 17.44 17.73 18.37 18.77 19.30 NA [11,] 16.60 17.11 17.46 17.75 18.40 18.78 19.36 NA [12,] 16.61 17.17 17.47 17.75 18.47 18.78 19.36 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.07 0.02 0.04 0.09 0.10 0.01 0.05 NA [2,] 0.01 -0.03 0.16 0.05 0.21 0.03 0.00 NA [3,] -0.01 0.13 0.06 0.00 -0.01 0.03 0.13 NA [4,] 0.05 0.13 0.01 -0.01 0.11 0.04 0.08 NA [5,] 0.01 0.02 0.02 -0.03 0.04 0.01 0.02 NA [6,] 0.01 0.00 -0.04 0.02 0.01 0.01 0.11 NA [7,] 0.09 0.10 0.05 0.00 0.12 -0.01 0.02 NA [8,] 0.02 0.07 -0.02 0.09 0.03 0.04 0.08 NA [9,] 0.01 0.04 -0.01 0.05 0.01 0.12 0.01 NA [10,] 0.04 0.01 0.02 0.02 0.03 0.01 0.06 NA [11,] 0.01 0.06 0.01 0.00 0.07 0.00 0.00 NA [12,] 0.01 0.00 0.00 0.00 0.02 0.02 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/18vv31381919130.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/2gm1n1381919130.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/3v9oj1381919130.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/4t5m41381919130.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] [1,] 16.300 16.370 16.380 16.370 16.420 16.430 16.440 16.53 16.550 16.56 16.600 [2,] 16.895 16.925 16.990 17.085 17.155 17.175 17.155 17.23 17.255 17.27 17.285 [3,] 17.470 17.560 17.610 17.610 17.600 17.570 17.590 17.59 17.680 17.73 17.750 [4,] 18.120 18.175 18.295 18.305 18.380 18.405 18.415 18.47 18.505 18.57 18.590 [5,] 18.800 18.850 18.850 18.980 19.060 19.080 19.190 19.21 19.290 19.30 19.360 [,12] [1,] 16.610 [2,] 17.320 [3,] 17.750 [4,] 18.625 [5,] 19.360 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.73845 16.81352 16.83068 16.88144 16.86845 16.83546 16.83755 16.84949 [2,] 18.20155 18.30648 18.38932 18.33856 18.33155 18.30454 18.34245 18.33051 [,9] [,10] [,11] [,12] [1,] 16.93352 16.95366 16.97068 16.97068 [2,] 18.42648 18.50634 18.52932 18.52932 $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(16.3, 16.895, 17.47, 18.12, 18.8, 16.37, 16.925, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5k7ax1381919130.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.01 -0.030 -0.010 -0.010 0.01 0.000 -0.010 -0.020 -0.010 0.010 0.000 [2,] 0.03 0.005 -0.005 0.025 0.01 0.005 0.010 0.025 0.010 0.015 0.000 [3,] 0.05 0.030 0.030 0.050 0.02 0.010 0.050 0.040 0.010 0.020 0.010 [4,] 0.08 0.105 0.095 0.095 0.02 0.015 0.095 0.075 0.045 0.035 0.035 [5,] 0.10 0.210 0.130 0.130 0.02 0.020 0.120 0.090 0.050 0.060 0.070 [,12] [1,] 0.000 [2,] 0.000 [3,] 0.005 [4,] 0.020 [5,] 0.020 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.02014081 -0.02971839 -0.02971839 0.008197129 0.01402816 0.004028161 [2,] 0.07985919 0.08971839 0.08971839 0.091802871 0.02597184 0.015971839 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.0007606287 0.01014081 -0.01090144 0.008056323 -0.01090144 -0.007900646 [2,] 0.1007606287 0.06985919 0.03090144 0.031943677 0.03090144 0.017900646 $out [1] -0.03 0.04 -0.04 0.11 0.12 $group [1] 5 5 6 6 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0100000000000016, 0.0299999999999994, 0.0500000000000007, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jo6u1381919130.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,] 16.300 16.61 17.370 17.470 17.750 18.490 18.800 NA [2,] 16.375 16.69 17.395 17.580 18.055 18.545 18.915 NA [3,] 16.435 16.89 17.440 17.605 18.205 18.610 19.135 NA [4,] 16.555 17.08 17.460 17.705 18.365 18.710 19.295 NA [5,] 16.610 17.17 17.470 17.750 18.470 18.780 19.360 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.3529 16.71212 17.41035 17.54799 18.06361 18.53474 18.96168 NA [2,] 16.5171 17.06788 17.46965 17.66201 18.34639 18.68526 19.30832 NA $out [1] 17.17 17.21 $group [1] 3 3 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(16.3, 16.375, 16.435, 16.555, 16.61, 16.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7sz721381919130.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,] 17.51429 17.470 17.50750 [2,] 17.65357 17.580 17.66875 [3,] 17.75714 17.605 17.78750 [4,] 17.87929 17.705 17.90000 [5,] 17.94429 17.750 17.97250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 17.65419 17.54799 17.68203 [2,] 17.86009 17.66201 17.89297 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(17.5142857142857, 17.6535714285714, 17.7571428571429, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/18vv31381919130.ps tmp/18vv31381919130.png",intern=TRUE)) character(0) > try(system("convert tmp/2gm1n1381919130.ps tmp/2gm1n1381919130.png",intern=TRUE)) character(0) > try(system("convert tmp/3v9oj1381919130.ps tmp/3v9oj1381919130.png",intern=TRUE)) character(0) > try(system("convert tmp/4t5m41381919130.ps tmp/4t5m41381919130.png",intern=TRUE)) character(0) > try(system("convert tmp/5k7ax1381919130.ps tmp/5k7ax1381919130.png",intern=TRUE)) character(0) > try(system("convert tmp/6jo6u1381919130.ps tmp/6jo6u1381919130.png",intern=TRUE)) character(0) > try(system("convert tmp/7sz721381919130.ps tmp/7sz721381919130.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.235 1.144 6.364