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(18.3,18.6,18.7,20.1,18.9,20.1,19.8,15.9,19.9,19.6,15.6,14.2,13.6,13.9,15,14.1,13.5,15.3,14.7,12.5,16.1,15.9,15.9,15.7,14.7,15.3,18.4,16.8,16.5,19.3,17.1,15.7,19.1,18.6,18.4,17.1,18.3,19.4,22.3,19.4,21.3,20.3,19.3,17.5,19.9,19.6,19.7,18.1,19.1,20.7,22.5,20,20.2,20.4,19.6,18.1,19.3,21,19.9,17.7,19.4,19.3,21.5,20.9,20.8,20.3,21.4,17.4,21.1,22,20.4,19) > 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,] 18.3 13.6 14.7 18.3 19.1 19.4 NA [2,] 18.6 13.9 15.3 19.4 20.7 19.3 NA [3,] 18.7 15.0 18.4 22.3 22.5 21.5 NA [4,] 20.1 14.1 16.8 19.4 20.0 20.9 NA [5,] 18.9 13.5 16.5 21.3 20.2 20.8 NA [6,] 20.1 15.3 19.3 20.3 20.4 20.3 NA [7,] 19.8 14.7 17.1 19.3 19.6 21.4 NA [8,] 15.9 12.5 15.7 17.5 18.1 17.4 NA [9,] 19.9 16.1 19.1 19.9 19.3 21.1 NA [10,] 19.6 15.9 18.6 19.6 21.0 22.0 NA [11,] 15.6 15.9 18.4 19.7 19.9 20.4 NA [12,] 14.2 15.7 17.1 18.1 17.7 19.0 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3 0.3 0.6 1.1 1.6 -0.1 NA [2,] 0.1 1.1 3.1 2.9 1.8 2.2 NA [3,] 1.4 -0.9 -1.6 -2.9 -2.5 -0.6 NA [4,] -1.2 -0.6 -0.3 1.9 0.2 -0.1 NA [5,] 1.2 1.8 2.8 -1.0 0.2 -0.5 NA [6,] -0.3 -0.6 -2.2 -1.0 -0.8 1.1 NA [7,] -3.9 -2.2 -1.4 -1.8 -1.5 -4.0 NA [8,] 4.0 3.6 3.4 2.4 1.2 3.7 NA [9,] -0.3 -0.2 -0.5 -0.3 1.7 0.9 NA [10,] -4.0 0.0 -0.2 0.1 -1.1 -1.6 NA [11,] -1.4 -0.2 -1.3 -1.6 -2.2 -1.4 NA [12,] -0.6 -1.0 1.2 1.0 1.7 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/1iaic1413375871.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/2btn41413375871.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/3h29f1413375871.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/4qn5y1413375871.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,] 13.6 13.90 15.0 14.1 13.50 19.3 14.70 15.70 19.1 15.9 15.60 14.2 [2,] 14.7 15.30 18.4 16.8 16.50 19.3 17.10 15.70 19.1 18.6 15.90 15.7 [3,] 18.3 18.95 20.1 19.7 19.55 20.2 19.45 16.65 19.6 19.6 19.05 17.4 [4,] 19.1 19.40 22.3 20.1 20.80 20.3 19.80 17.50 19.9 21.0 19.90 18.1 [5,] 19.4 20.70 22.5 20.9 21.30 20.4 21.40 18.10 19.9 22.0 20.40 19.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.46186 16.30537 17.58437 17.57139 16.77636 19.55497 17.70841 15.48894 [2,] 21.13814 21.59463 22.61563 21.82861 22.32364 20.84503 21.19159 17.81106 [,9] [,10] [,11] [,12] [1,] 19.08397 18.05192 16.46987 15.85192 [2,] 20.11603 21.14808 21.63013 18.94808 $out [1] 15.3 12.5 16.1 21.1 $group [1] 6 8 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(13.6, 14.7, 18.3, 19.1, 19.4, 13.9, 15.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vxcl1413375871.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.10 0.1 -2.90 -1.2 -1.0 -1.0 -4.0 1.2 -0.50 -4.00 -1.6 -1.0 [2,] 0.30 1.1 -2.50 -0.6 -0.5 -1.0 -3.9 2.4 -0.30 -1.60 -1.6 -0.6 [3,] 0.45 2.0 -1.25 -0.2 0.7 -0.7 -2.0 3.5 -0.25 -0.65 -1.4 1.0 [4,] 1.10 2.9 -0.60 0.2 1.8 -0.3 -1.5 3.7 0.90 0.00 -1.3 1.2 [5,] 1.60 3.1 1.40 0.2 2.8 -0.3 -1.4 4.0 1.70 0.10 -1.3 1.7 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.06602584 0.8389419 -2.47556137 -0.7160258 -0.7835743 -1.1515226 [2,] 0.96602584 3.1610581 -0.02443863 0.3160258 2.1835743 -0.2484774 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -3.5480775 2.661458 -1.0240388 -1.6820517 -1.59351 -0.2718755 [2,] -0.4519225 4.338542 0.5240388 0.3820517 -1.20649 2.2718755 $out [1] 1.9 -2.2 1.1 -0.2 -2.2 $group [1] 4 6 6 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0999999999999979, 0.300000000000001, 0.450000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67c3m1413375871.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,] 14.20 12.50 14.7 17.5 17.70 17.40 NA [2,] 17.10 13.75 16.1 18.8 19.20 19.35 NA [3,] 18.80 14.85 17.1 19.5 19.95 20.60 NA [4,] 19.85 15.80 18.5 20.1 20.55 21.25 NA [5,] 20.10 16.10 19.3 21.3 22.50 22.00 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 17.54571 13.91498 16.00534 18.90706 19.33426 19.7334 NA [2,] 20.05429 15.78502 18.19466 20.09294 20.56574 21.4666 NA $out [1] 22.3 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(14.2, 17.1, 18.8, 19.85, 20.1, 12.5, 13.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7r3121413375871.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,] 16.18333 17.400 16.61250 [2,] 17.55000 18.625 17.50000 [3,] 18.54167 19.500 18.73125 [4,] 19.25833 19.650 19.63750 [5,] 19.73333 20.200 20.28750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 17.76248 19.03249 17.75632 [2,] 19.32085 19.96751 19.70618 $out [1] 16.65 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16.1833333333333, 17.55, 18.5416666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1iaic1413375871.ps tmp/1iaic1413375871.png",intern=TRUE)) character(0) > try(system("convert tmp/2btn41413375871.ps tmp/2btn41413375871.png",intern=TRUE)) character(0) > try(system("convert tmp/3h29f1413375871.ps tmp/3h29f1413375871.png",intern=TRUE)) character(0) > try(system("convert tmp/4qn5y1413375871.ps tmp/4qn5y1413375871.png",intern=TRUE)) character(0) > try(system("convert tmp/5vxcl1413375871.ps tmp/5vxcl1413375871.png",intern=TRUE)) character(0) > try(system("convert tmp/67c3m1413375871.ps tmp/67c3m1413375871.png",intern=TRUE)) character(0) > try(system("convert tmp/7r3121413375871.ps tmp/7r3121413375871.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.488 0.435 2.944