R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(67.66,68,68.02,68.11,68.41,68.4,68.4,68.55,68.54,68.99,68.97,68.98,68.98,68.94,69.21,69.21,69.67,69.66,69.66,69.66,69.77,70.32,70.34,70.38,70.38,70.29,70.42,70.29,70.59,70.64,70.64,70.68,70.78,70.9,71.04,71.15,71.15,71.15,71.07,71.17,71.24,71.23,71.23,71.23,71.24,71.28,71.52,71.52,71.52,71.6,71.61,71.78,71.66,71.86,71.86,71.82,71.8,72.22,72.51,72.56,72.56,72.78,72.88,73.05,73.02,73.08,73.08,73.24,73.82,74,74.37,74.38) > 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,] 67.66 68.98 70.38 71.15 71.52 72.56 NA [2,] 68.00 68.94 70.29 71.15 71.60 72.78 NA [3,] 68.02 69.21 70.42 71.07 71.61 72.88 NA [4,] 68.11 69.21 70.29 71.17 71.78 73.05 NA [5,] 68.41 69.67 70.59 71.24 71.66 73.02 NA [6,] 68.40 69.66 70.64 71.23 71.86 73.08 NA [7,] 68.40 69.66 70.64 71.23 71.86 73.08 NA [8,] 68.55 69.66 70.68 71.23 71.82 73.24 NA [9,] 68.54 69.77 70.78 71.24 71.80 73.82 NA [10,] 68.99 70.32 70.90 71.28 72.22 74.00 NA [11,] 68.97 70.34 71.04 71.52 72.51 74.37 NA [12,] 68.98 70.38 71.15 71.52 72.56 74.38 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.34 -0.04 -0.09 0.00 0.08 0.22 NA [2,] 0.02 0.27 0.13 -0.08 0.01 0.10 NA [3,] 0.09 0.00 -0.13 0.10 0.17 0.17 NA [4,] 0.30 0.46 0.30 0.07 -0.12 -0.03 NA [5,] -0.01 -0.01 0.05 -0.01 0.20 0.06 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.15 0.00 0.04 0.00 -0.04 0.16 NA [8,] -0.01 0.11 0.10 0.01 -0.02 0.58 NA [9,] 0.45 0.55 0.12 0.04 0.42 0.18 NA [10,] -0.02 0.02 0.14 0.24 0.29 0.37 NA [11,] 0.01 0.04 0.11 0.00 0.05 0.01 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/148xo1363082318.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/2ihch1363082318.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/3nk591363082318.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/4j4x41363082318.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,] 67.660 68.00 68.020 68.11 68.410 68.400 68.400 68.550 68.54 68.99 68.97 [2,] 68.980 68.94 69.210 69.21 69.670 69.660 69.660 69.660 69.77 70.32 70.34 [3,] 70.765 70.72 70.745 70.73 70.915 70.935 70.935 70.955 71.01 71.09 71.28 [4,] 71.520 71.60 71.610 71.78 71.660 71.860 71.860 71.820 71.80 72.22 72.51 [5,] 72.560 72.78 72.880 73.05 73.020 73.080 73.080 73.240 73.82 74.00 74.37 [,12] [1,] 68.980 [2,] 70.380 [3,] 71.335 [4,] 72.560 [5,] 74.380 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 69.12662 69.00421 69.19692 69.07227 69.63139 69.51593 69.51593 69.56173 [2,] 72.40338 72.43579 72.29308 72.38773 72.19861 72.35407 72.35407 72.34827 [,9] [,10] [,11] [,12] [1,] 69.70058 69.86444 69.88028 69.92883 [2,] 72.31942 72.31556 72.67972 72.74117 $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(67.66, 68.98, 70.765, 71.52, 72.56, 68, 68.94, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/501zx1363082318.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.09 -0.08 -0.130 -0.120 -0.01 0 -0.04 -0.020 0.04 -0.02 0.000 0 [2,] -0.04 0.01 0.000 -0.030 -0.01 0 0.00 -0.010 0.12 0.02 0.010 0 [3,] 0.04 0.06 0.095 0.185 0.02 0 0.02 0.055 0.30 0.19 0.025 0 [4,] 0.22 0.13 0.170 0.300 0.06 0 0.15 0.110 0.45 0.29 0.050 0 [5,] 0.34 0.27 0.170 0.460 0.06 0 0.16 0.110 0.55 0.37 0.110 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1277084 -0.01740388 -0.01465549 -0.02786066 -0.02515226 0 [2,] 0.2077084 0.13740388 0.20465549 0.39786066 0.06515226 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.07675484 -0.02240388 0.08713934 0.01584128 -0.000801292 0 [2,] 0.11675484 0.13240388 0.51286066 0.36415872 0.050801292 0 $out [1] 0.20 0.58 $group [1] 5 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0899999999999892, -0.0400000000000063, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kv5o1363082318.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,] 67.660 68.940 70.29 71.07 71.520 72.56 NA [2,] 68.065 69.210 70.40 71.16 71.635 72.95 NA [3,] 68.405 69.660 70.64 71.23 71.810 73.08 NA [4,] 68.760 70.045 70.84 71.26 72.040 73.91 NA [5,] 68.990 70.380 71.15 71.28 72.560 74.38 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 68.08801 69.27915 70.43931 71.18439 71.62528 72.64214 NA [2,] 68.72199 70.04085 70.84069 71.27561 71.99472 73.51786 NA $out [1] 71.52 71.52 $group [1] 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(67.66, 68.065, 68.405, 68.76, 68.99, 68.94, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7dabt1363082318.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,] 70.37500 70.720 70.37875 [2,] 70.56833 70.755 70.52375 [3,] 70.81167 70.935 70.79875 [4,] 71.13833 71.050 71.03312 [5,] 71.49500 71.335 71.43625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 70.55169 70.80045 70.56642 [2,] 71.07165 71.06955 71.03108 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(70.375, 70.5683333333333, 70.8116666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/148xo1363082318.ps tmp/148xo1363082318.png",intern=TRUE)) character(0) > try(system("convert tmp/2ihch1363082318.ps tmp/2ihch1363082318.png",intern=TRUE)) character(0) > try(system("convert tmp/3nk591363082318.ps tmp/3nk591363082318.png",intern=TRUE)) character(0) > try(system("convert tmp/4j4x41363082318.ps tmp/4j4x41363082318.png",intern=TRUE)) character(0) > try(system("convert tmp/501zx1363082318.ps tmp/501zx1363082318.png",intern=TRUE)) character(0) > try(system("convert tmp/6kv5o1363082318.ps tmp/6kv5o1363082318.png",intern=TRUE)) character(0) > try(system("convert tmp/7dabt1363082318.ps tmp/7dabt1363082318.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.368 0.552 3.914