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(105.38,105.38,108.37,112.21,112.05,112.05,112.06,112.05,111.36,111.36,111.36,111.36,111.78,111.89,111.89,111.89,112.02,112.02,112.02,112.02,112.02,112.02,112.02,111.28,111.28,111.28,111.28,110.56,110.56,110.56,110.56,110.56,111.37,109.43,109.43,109.57,109.57,109.57,109.57,109.57,109.39,111.68,111.68,111.68,111.93,111.93,111.93,111.93,111.56,111.89,111.89,111.89,110.82,110.82,110.82,110.82,110.98,110.98,111.78,111.78,111.78,111.78,112.6,112.6,112.6,112.6,112.6,113.25,113.25,113.25,113.25,113.25) > 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,] 105.38 111.78 111.28 109.57 111.56 111.78 NA [2,] 105.38 111.89 111.28 109.57 111.89 111.78 NA [3,] 108.37 111.89 111.28 109.57 111.89 112.60 NA [4,] 112.21 111.89 110.56 109.57 111.89 112.60 NA [5,] 112.05 112.02 110.56 109.39 110.82 112.60 NA [6,] 112.05 112.02 110.56 111.68 110.82 112.60 NA [7,] 112.06 112.02 110.56 111.68 110.82 112.60 NA [8,] 112.05 112.02 110.56 111.68 110.82 113.25 NA [9,] 111.36 112.02 111.37 111.93 110.98 113.25 NA [10,] 111.36 112.02 109.43 111.93 110.98 113.25 NA [11,] 111.36 112.02 109.43 111.93 111.78 113.25 NA [12,] 111.36 111.28 109.57 111.93 111.78 113.25 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 0.11 0.00 0.00 0.33 0.00 NA [2,] 2.99 0.00 0.00 0.00 0.00 0.82 NA [3,] 3.84 0.00 -0.72 0.00 0.00 0.00 NA [4,] -0.16 0.13 0.00 -0.18 -1.07 0.00 NA [5,] 0.00 0.00 0.00 2.29 0.00 0.00 NA [6,] 0.01 0.00 0.00 0.00 0.00 0.00 NA [7,] -0.01 0.00 0.00 0.00 0.00 0.65 NA [8,] -0.69 0.00 0.81 0.25 0.16 0.00 NA [9,] 0.00 0.00 -1.94 0.00 0.00 0.00 NA [10,] 0.00 0.00 0.00 0.00 0.80 0.00 NA [11,] 0.00 -0.74 0.14 0.00 0.00 0.00 NA [12,] 0.42 0.00 0.00 -0.37 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/10ck91381822937.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/2dc1j1381822937.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/3bymr1381822937.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/48d6d1381822937.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,] 109.57 109.57 108.370 109.57 109.39 110.56 110.56 110.56 110.98 109.430 [2,] 109.57 109.57 109.570 110.56 110.56 110.82 110.82 110.82 111.36 110.980 [3,] 111.42 111.53 111.585 111.89 111.42 111.85 111.85 111.85 111.65 111.645 [4,] 111.78 111.89 111.890 112.21 112.05 112.05 112.06 112.05 112.02 112.020 [5,] 111.78 111.89 112.600 112.60 112.60 112.60 112.60 113.25 112.02 113.250 [,11] [,12] [1,] 111.360 111.28 [2,] 111.360 111.28 [3,] 111.855 111.57 [4,] 112.020 111.93 [5,] 112.020 111.93 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 109.9945 110.0335 110.0885 110.8257 110.4589 111.0566 111.0502 111.0566 [2,] 112.8455 113.0265 113.0815 112.9543 112.3811 112.6434 112.6498 112.6434 [,9] [,10] [,11] [,12] [1,] 111.2243 110.9742 111.4293 111.1507 [2,] 112.0757 112.3158 112.2807 111.9893 $out [1] 105.38 105.38 113.25 109.43 113.25 109.57 113.25 $group [1] 1 2 9 11 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(109.57, 109.57, 111.42, 111.78, 111.78, 109.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nmbu1381822937.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.00 0 -0.18 0 0 0 0.00 0 0 0 0 [2,] 0.00 0.00 0 -0.18 0 0 0 0.00 0 0 0 0 [3,] 0.00 0.00 0 -0.08 0 0 0 0.08 0 0 0 0 [4,] 0.11 0.82 0 0.00 0 0 0 0.25 0 0 0 0 [5,] 0.11 0.82 0 0.13 0 0 0 0.25 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] [1,] -0.07095355 -0.5289265 0 -0.19610581 0 0 0 -0.08125807 0 [2,] 0.07095355 0.5289265 0 0.03610581 0 0 0 0.24125807 0 [,10] [,11] [,12] [1,] 0 0 0 [2,] 0 0 0 $out [1] 0.33 2.99 3.84 -0.72 -1.07 2.29 0.01 -0.01 0.65 -0.69 0.81 -1.94 [13] 0.80 -0.74 0.14 0.42 -0.37 $group [1] 1 2 3 3 4 5 6 7 7 8 8 9 10 11 11 12 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, 0.109999999999999, 0.109999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65hmt1381822937.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,] 108.370 111.78 109.430 109.39 110.820 111.78 NA [2,] 109.865 111.89 110.065 109.57 110.820 112.60 NA [3,] 111.360 112.02 110.560 111.68 111.270 112.60 NA [4,] 112.050 112.02 111.280 111.93 111.835 113.25 NA [5,] 112.210 112.02 111.370 111.93 111.890 113.25 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 110.3634 111.9607 110.0058 110.6036 110.8071 112.3035 NA [2,] 112.3566 112.0793 111.1142 112.7564 111.7329 112.8965 NA $out [1] 105.38 105.38 111.28 $group [1] 1 1 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(108.37, 109.865, 111.36, 112.05, 112.21, 111.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7x3en1381822937.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,] 110.2983 111.4200 110.8613 [2,] 111.0867 111.5500 111.1387 [3,] 111.5117 111.6475 111.5375 [4,] 111.6258 111.8500 111.5694 [5,] 111.8183 111.8900 111.7313 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 111.2657 111.5107 111.3411 [2,] 111.7576 111.7843 111.7339 $out [1] 110.225 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(110.298333333333, 111.086666666667, 111.511666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10ck91381822937.ps tmp/10ck91381822937.png",intern=TRUE)) character(0) > try(system("convert tmp/2dc1j1381822937.ps tmp/2dc1j1381822937.png",intern=TRUE)) character(0) > try(system("convert tmp/3bymr1381822937.ps tmp/3bymr1381822937.png",intern=TRUE)) character(0) > try(system("convert tmp/48d6d1381822937.ps tmp/48d6d1381822937.png",intern=TRUE)) character(0) > try(system("convert tmp/5nmbu1381822937.ps tmp/5nmbu1381822937.png",intern=TRUE)) character(0) > try(system("convert tmp/65hmt1381822937.ps tmp/65hmt1381822937.png",intern=TRUE)) character(0) > try(system("convert tmp/7x3en1381822937.ps tmp/7x3en1381822937.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.615 0.732 4.332