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(102.78,102.78,102.78,102.78,102.78,102.78,102.78,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,104.47,104.47,104.47,104.47,104.47,104.47,104.47,104.47,105.5,105.5,105.5,105.5,106.61,106.61,106.61,106.61,106.61,106.61,106.61,106.61,112.06,112.06,112.06,112.06,111.18,111.18,111.18,111.18,111.18,111.18,111.18,111.18,117.21,117.21,117.21,117.21,107.98,107.98,107.98,107.98,107.98) > 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,] 102.78 101.67 105.79 104.47 106.61 111.18 NA [2,] 102.78 101.67 105.79 104.47 106.61 111.18 NA [3,] 102.78 101.67 105.79 104.47 106.61 111.18 NA [4,] 102.78 101.67 105.79 105.50 112.06 117.21 NA [5,] 102.78 101.67 105.79 105.50 112.06 117.21 NA [6,] 102.78 101.67 105.79 105.50 112.06 117.21 NA [7,] 102.78 101.67 105.79 105.50 112.06 117.21 NA [8,] 101.67 105.79 104.47 106.61 111.18 107.98 NA [9,] 101.67 105.79 104.47 106.61 111.18 107.98 NA [10,] 101.67 105.79 104.47 106.61 111.18 107.98 NA [11,] 101.67 105.79 104.47 106.61 111.18 107.98 NA [12,] 101.67 105.79 104.47 106.61 111.18 107.98 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [2,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [3,] 0.00 0.00 0.00 1.03 5.45 6.03 NA [4,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [5,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] -1.11 4.12 -1.32 1.11 -0.88 -9.23 NA [8,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [9,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [10,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [11,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [12,] 0.00 0.00 0.00 0.00 0.00 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/13x0k1385055940.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/28lj41385055940.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/3kag51385055940.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/4nfvw1385055940.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] [1,] 101.67 101.67 101.67 101.670 101.670 101.670 101.670 101.67 101.67 101.67 [2,] 102.78 102.78 102.78 102.780 102.780 102.780 102.780 104.47 104.47 104.47 [3,] 105.13 105.13 105.13 105.645 105.645 105.645 105.645 106.20 106.20 106.20 [4,] 106.61 106.61 106.61 112.060 112.060 112.060 112.060 107.98 107.98 107.98 [5,] 111.18 111.18 111.18 117.210 117.210 117.210 117.210 111.18 111.18 111.18 [,11] [,12] [1,] 101.67 101.67 [2,] 104.47 104.47 [3,] 106.20 106.20 [4,] 107.98 107.98 [5,] 111.18 111.18 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.6595 102.6595 102.6595 99.6591 99.6591 99.6591 99.6591 103.9359 [2,] 107.6005 107.6005 107.6005 111.6309 111.6309 111.6309 111.6309 108.4641 [,9] [,10] [,11] [,12] [1,] 103.9359 103.9359 103.9359 103.9359 [2,] 108.4641 108.4641 108.4641 108.4641 $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(101.67, 102.78, 105.13, 106.61, 111.18, 101.67, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5cexh1385055940.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 0 0.000 0 0 0 -1.320 0 0 0 0 0 [2,] 0 0 0.000 0 0 0 -1.320 0 0 0 0 0 [3,] 0 0 0.515 0 0 0 -0.995 0 0 0 0 0 [4,] 0 0 5.450 0 0 0 1.110 0 0 0 0 0 [5,] 0 0 6.030 0 0 0 4.120 0 0 0 0 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0 0 -3.000426 0 0 0 -2.5624285 0 0 0 0 0 [2,] 0 0 4.030426 0 0 0 0.5724285 0 0 0 0 0 $out [1] -9.23 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.515000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jpax1385055940.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,] 101.67 101.67 104.47 104.470 106.610 107.98 NA [2,] 101.67 101.67 104.47 104.985 108.895 107.98 NA [3,] 102.78 101.67 105.79 105.500 111.180 111.18 NA [4,] 102.78 105.79 105.79 106.610 112.060 117.21 NA [5,] 102.78 105.79 105.79 106.610 112.060 117.21 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 102.2737 99.79084 105.1879 104.7588 109.7364 106.9701 NA [2,] 103.2863 103.54916 106.3921 106.2412 112.6236 115.3899 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(101.67, 101.67, 102.78, 102.78, 102.78, 101.67, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79h261385055940.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,] 105.4167 105.1300 104.8038 [2,] 105.8500 105.3875 105.5113 [3,] 106.2833 105.6450 106.2188 [4,] 107.5017 106.2000 106.9763 [5,] 107.5017 106.2000 106.9763 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 105.5300 105.2744 105.5506 [2,] 107.0367 106.0156 106.8869 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(105.416666666667, 105.85, 106.283333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13x0k1385055940.ps tmp/13x0k1385055940.png",intern=TRUE)) character(0) > try(system("convert tmp/28lj41385055940.ps tmp/28lj41385055940.png",intern=TRUE)) character(0) > try(system("convert tmp/3kag51385055940.ps tmp/3kag51385055940.png",intern=TRUE)) character(0) > try(system("convert tmp/4nfvw1385055940.ps tmp/4nfvw1385055940.png",intern=TRUE)) character(0) > try(system("convert tmp/5cexh1385055940.ps tmp/5cexh1385055940.png",intern=TRUE)) character(0) > try(system("convert tmp/6jpax1385055940.ps tmp/6jpax1385055940.png",intern=TRUE)) character(0) > try(system("convert tmp/79h261385055940.ps tmp/79h261385055940.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.823 0.812 4.620