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(122.5,123.1,123.1,124.4,124.4,124.6,124.5,125.9,125.9,125.9,125.9,125.9,125.9,128.2,129.3,129.3,129.3,129.3,129.4,129.6,129.6,129.6,130,130,129.4,130.2,130.2,130.2,130.3,130.3,130.3,130.7,130.7,130.7,130.9,130.9,130.9,131.2,131.8,131.8,131.8,131.9,132,132.3,132.3,132.4,132.8,132.8,132.8,133,133.5,133.5,134.4,134.4,134.5,134.6,135.6,135.6,135.6,135.6,135.6,135.7,136.2,136.2,136.2,136.2,136.2,136.3,136.3,136.3,136.3,136.3,136.3) > 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] 73 > (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] 7 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 122.5 125.9 129.4 130.9 132.8 135.6 136.3 [2,] 123.1 128.2 130.2 131.2 133.0 135.7 NA [3,] 123.1 129.3 130.2 131.8 133.5 136.2 NA [4,] 124.4 129.3 130.2 131.8 133.5 136.2 NA [5,] 124.4 129.3 130.3 131.8 134.4 136.2 NA [6,] 124.6 129.3 130.3 131.9 134.4 136.2 NA [7,] 124.5 129.4 130.3 132.0 134.5 136.2 NA [8,] 125.9 129.6 130.7 132.3 134.6 136.3 NA [9,] 125.9 129.6 130.7 132.3 135.6 136.3 NA [10,] 125.9 129.6 130.7 132.4 135.6 136.3 NA [11,] 125.9 130.0 130.9 132.8 135.6 136.3 NA [12,] 125.9 130.0 130.9 132.8 135.6 136.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.6 2.3 0.8 0.3 0.2 0.1 NA [2,] 0.0 1.1 0.0 0.6 0.5 0.5 NA [3,] 1.3 0.0 0.0 0.0 0.0 0.0 NA [4,] 0.0 0.0 0.1 0.0 0.9 0.0 NA [5,] 0.2 0.0 0.0 0.1 0.0 0.0 NA [6,] -0.1 0.1 0.0 0.1 0.1 0.0 NA [7,] 1.4 0.2 0.4 0.3 0.1 0.1 NA [8,] 0.0 0.0 0.0 0.0 1.0 0.0 NA [9,] 0.0 0.0 0.0 0.1 0.0 0.0 NA [10,] 0.0 0.4 0.2 0.4 0.0 0.0 NA [11,] 0.0 0.0 0.0 0.0 0.0 0.0 NA [12,] 0.0 -0.6 0.0 0.0 0.0 0.0 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/1kowu1412934988.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/2d7mw1412934988.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/3fkjd1412934988.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/493rx1412934988.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,] 122.50 123.1 123.1 124.4 124.40 124.6 124.50 125.9 125.9 125.90 125.90 [2,] 127.65 128.2 129.3 129.3 129.30 129.3 129.40 129.6 129.6 129.60 130.00 [3,] 130.90 130.7 131.0 131.0 131.05 131.1 131.15 131.5 131.5 131.55 131.85 [4,] 134.20 133.0 133.5 133.5 134.40 134.4 134.50 134.6 135.6 135.60 135.60 [5,] 136.30 135.7 136.2 136.2 136.20 136.2 136.20 136.3 136.3 136.30 136.30 [,12] [1,] 125.90 [2,] 130.00 [3,] 131.85 [4,] 135.60 [5,] 136.30 $n [1] 7 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 126.9884 127.6038 128.2909 128.2909 127.7603 127.8103 127.8603 128.2748 [2,] 134.8116 133.7962 133.7091 133.7091 134.3397 134.3897 134.4397 134.7252 [,9] [,10] [,11] [,12] [1,] 127.6298 127.6798 128.2378 128.2378 [2,] 135.3702 135.4202 135.4622 135.4622 $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(122.5, 127.65, 130.9, 134.2, 136.3, 123.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hyht1412934988.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.0 0 0.0 0.0 -0.10 0.10 0 0 0.0 0 0 [2,] 0.20 0.0 0 0.0 0.0 0.00 0.10 0 0 0.0 0 0 [3,] 0.45 0.5 0 0.0 0.0 0.05 0.25 0 0 0.1 0 0 [4,] 0.80 0.6 0 0.1 0.1 0.10 0.40 0 0 0.4 0 0 [5,] 0.80 1.1 0 0.1 0.2 0.10 0.40 0 0 0.4 0 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.06298062 0.1129806 0 -0.06450323 -0.06450323 -0.01450323 0.05649031 [2,] 0.83701938 0.8870194 0 0.06450323 0.06450323 0.11450323 0.44350969 [,8] [,9] [,10] [,11] [,12] [1,] 0 0 -0.1580129 0 0 [2,] 0 0 0.3580129 0 0 $out [1] 2.3 1.3 0.9 1.4 1.0 0.1 -0.6 $group [1] 1 3 4 7 8 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0999999999999943, 0.199999999999989, 0.449999999999989, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60f7s1412934988.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,] 122.50 129.30 130.2 131.20 132.80 136.2 136.3 [2,] 123.75 129.30 130.2 131.80 133.50 136.2 136.3 [3,] 124.55 129.35 130.3 131.95 134.45 136.2 136.3 [4,] 125.90 129.60 130.7 132.35 135.60 136.3 136.3 [5,] 125.90 130.00 130.9 132.80 135.60 136.3 136.3 $n [1] 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 123.5694 129.2132 130.0719 131.6991 133.4922 136.1544 136.3 [2,] 125.5306 129.4868 130.5281 132.2009 135.4078 136.2456 136.3 $out [1] 125.9 128.2 129.4 130.9 135.6 135.7 $group [1] 2 2 3 4 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(122.5, 123.75, 124.55, 125.9, 125.9, 129.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ynis1412934988.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,] 130.2333 130.700 130.6250 [2,] 130.7917 131.000 131.3000 [3,] 131.1333 131.125 131.7063 [4,] 131.7417 131.525 132.3312 [5,] 131.9167 131.850 132.5625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 130.7000 130.8855 131.2359 [2,] 131.5666 131.3645 132.1766 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(130.233333333333, 130.791666666667, 131.133333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1kowu1412934988.ps tmp/1kowu1412934988.png",intern=TRUE)) character(0) > try(system("convert tmp/2d7mw1412934988.ps tmp/2d7mw1412934988.png",intern=TRUE)) character(0) > try(system("convert tmp/3fkjd1412934988.ps tmp/3fkjd1412934988.png",intern=TRUE)) character(0) > try(system("convert tmp/493rx1412934988.ps tmp/493rx1412934988.png",intern=TRUE)) character(0) > try(system("convert tmp/5hyht1412934988.ps tmp/5hyht1412934988.png",intern=TRUE)) character(0) > try(system("convert tmp/60f7s1412934988.ps tmp/60f7s1412934988.png",intern=TRUE)) character(0) > try(system("convert tmp/7ynis1412934988.ps tmp/7ynis1412934988.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.452 0.382 2.872