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.41,1.42,1.43,1.43,1.43,1.43,1.43,1.44,1.44,1.45,1.46,1.46,1.47,1.47,1.47,1.49,1.49,1.49,1.49,1.5,1.52,1.54,1.56,1.56,1.57,1.58,1.59,1.6,1.59,1.6,1.61,1.61,1.61,1.62,1.62,1.61,1.62,1.62,1.63,1.64,1.64,1.64,1.64,1.64,1.65,1.65,1.65,1.65,1.65,1.66,1.66,1.67,1.67,1.67,1.67,1.67,1.67,1.69,1.69,1.69,1.7,1.71,1.72,1.71,1.71,1.71,1.72,1.72,1.72,1.73,1.73,1.73,1.74,1.74,1.75,1.76,1.76,1.77,1.78,1.79,1.8,1.8,1.8,1.81) > 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.41 1.47 1.57 1.62 1.65 1.70 1.74 NA [2,] 1.42 1.47 1.58 1.62 1.66 1.71 1.74 NA [3,] 1.43 1.47 1.59 1.63 1.66 1.72 1.75 NA [4,] 1.43 1.49 1.60 1.64 1.67 1.71 1.76 NA [5,] 1.43 1.49 1.59 1.64 1.67 1.71 1.76 NA [6,] 1.43 1.49 1.60 1.64 1.67 1.71 1.77 NA [7,] 1.43 1.49 1.61 1.64 1.67 1.72 1.78 NA [8,] 1.44 1.50 1.61 1.64 1.67 1.72 1.79 NA [9,] 1.44 1.52 1.61 1.65 1.67 1.72 1.80 NA [10,] 1.45 1.54 1.62 1.65 1.69 1.73 1.80 NA [11,] 1.46 1.56 1.62 1.65 1.69 1.73 1.80 NA [12,] 1.46 1.56 1.61 1.65 1.69 1.73 1.81 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.01 0.00 0.01 0.00 0.01 0.01 0.00 NA [2,] 0.01 0.00 0.01 0.01 0.00 0.01 0.01 NA [3,] 0.00 0.02 0.01 0.01 0.01 -0.01 0.01 NA [4,] 0.00 0.00 -0.01 0.00 0.00 0.00 0.00 NA [5,] 0.00 0.00 0.01 0.00 0.00 0.00 0.01 NA [6,] 0.00 0.00 0.01 0.00 0.00 0.01 0.01 NA [7,] 0.01 0.01 0.00 0.00 0.00 0.00 0.01 NA [8,] 0.00 0.02 0.00 0.01 0.00 0.00 0.01 NA [9,] 0.01 0.02 0.01 0.00 0.02 0.01 0.00 NA [10,] 0.01 0.02 0.00 0.00 0.00 0.00 0.00 NA [11,] 0.00 0.00 -0.01 0.00 0.00 0.00 0.01 NA [12,] 0.01 0.01 0.01 0.00 0.01 0.01 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/1u01v1381933569.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/2keiu1381933569.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/3krgy1381933569.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/4j7jy1381933569.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.410 1.420 1.43 1.430 1.43 1.430 1.430 1.440 1.440 1.45 1.46 1.460 [2,] 1.520 1.525 1.53 1.545 1.54 1.545 1.550 1.555 1.565 1.58 1.59 1.585 [3,] 1.620 1.620 1.63 1.640 1.64 1.640 1.640 1.640 1.650 1.65 1.65 1.650 [4,] 1.675 1.685 1.69 1.690 1.69 1.690 1.695 1.695 1.695 1.71 1.71 1.710 [5,] 1.740 1.740 1.75 1.760 1.76 1.770 1.780 1.790 1.800 1.80 1.80 1.810 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.527437 1.524451 1.534451 1.553408 1.550422 1.553408 1.553408 1.556394 [2,] 1.712563 1.715549 1.725549 1.726592 1.729578 1.726592 1.726592 1.723606 [,9] [,10] [,11] [,12] [1,] 1.572366 1.572366 1.578338 1.575352 [2,] 1.727634 1.727634 1.721662 1.724648 $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(1.41, 1.52, 1.62, 1.675, 1.74, 1.42, 1.525, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59e1x1381933569.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.00 0.000 0.000 0 0.000 0.00 0.00 0.00 0.000 0.000 0 0.01 [2,] 0.00 0.005 0.005 0 0.000 0.00 0.00 0.00 0.005 0.000 0 0.01 [3,] 0.01 0.010 0.010 0 0.000 0.00 0.00 0.00 0.010 0.000 0 0.01 [4,] 0.01 0.010 0.010 0 0.005 0.01 0.01 0.01 0.015 0.005 0 0.01 [5,] 0.01 0.010 0.010 0 0.010 0.01 0.01 0.02 0.020 0.010 0 0.01 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.004028161 0.007014081 0.007014081 0 -0.002985919 -0.005971839 [2,] 0.015971839 0.012985919 0.012985919 0 0.002985919 0.005971839 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.005971839 -0.005971839 0.004028161 -0.002985919 0 0.01 [2,] 0.005971839 0.005971839 0.015971839 0.002985919 0 0.01 $out [1] 0.02 -0.01 -0.01 0.02 -0.01 0.01 0.00 $group [1] 3 3 4 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0.01, 0.01, 0.01, 0, 0.00499999999999989, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/650ip1381933569.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.410 1.47 1.570 1.620 1.650 1.700 1.740 NA [2,] 1.430 1.48 1.590 1.635 1.665 1.710 1.755 NA [3,] 1.430 1.49 1.605 1.640 1.670 1.720 1.775 NA [4,] 1.445 1.53 1.610 1.650 1.680 1.725 1.800 NA [5,] 1.460 1.56 1.620 1.650 1.690 1.730 1.810 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.423158 1.467195 1.595878 1.633158 1.663158 1.713158 1.754475 NA [2,] 1.436842 1.512805 1.614122 1.646842 1.676842 1.726842 1.795525 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.41, 1.43, 1.43, 1.445, 1.46, 1.47, 1.48, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7s7bk1381933569.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.594286 1.620 1.5975 [2,] 1.610000 1.635 1.6125 [3,] 1.617857 1.640 1.6200 [4,] 1.635000 1.650 1.6375 [5,] 1.644286 1.650 1.6500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.606454 1.633158 1.608597 [2,] 1.629260 1.646842 1.631403 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.59428571428571, 1.61, 1.61785714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1u01v1381933569.ps tmp/1u01v1381933569.png",intern=TRUE)) character(0) > try(system("convert tmp/2keiu1381933569.ps tmp/2keiu1381933569.png",intern=TRUE)) character(0) > try(system("convert tmp/3krgy1381933569.ps tmp/3krgy1381933569.png",intern=TRUE)) character(0) > try(system("convert tmp/4j7jy1381933569.ps tmp/4j7jy1381933569.png",intern=TRUE)) character(0) > try(system("convert tmp/59e1x1381933569.ps tmp/59e1x1381933569.png",intern=TRUE)) character(0) > try(system("convert tmp/650ip1381933569.ps tmp/650ip1381933569.png",intern=TRUE)) character(0) > try(system("convert tmp/7s7bk1381933569.ps tmp/7s7bk1381933569.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.376 0.991 5.346