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(1.005,1.026,1.043,1.068,1.07,1.091,1.102,1.091,1.121,1.134,1.225,1.191,1.184,1.207,1.271,1.299,1.411,1.437,1.462,1.36,1.33,1.234,1.142,1.017,1.016,1.013,1,1.018,1.024,1.075,1.055,1.091,1.062,1.083,1.099,1.097,1.138,1.138,1.181,1.223,1.23,1.232,1.209,1.209,1.218,1.225,1.242,1.294,1.33,1.357,1.407,1.42,1.386,1.377,1.393,1.371,1.393,1.405,1.438,1.424,1.47,1.481,1.506,1.503,1.478,1.433,1.459,1.51,1.526,1.543,1.529,1.499) > 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,] 1.005 1.184 1.016 1.138 1.330 1.470 NA [2,] 1.026 1.207 1.013 1.138 1.357 1.481 NA [3,] 1.043 1.271 1.000 1.181 1.407 1.506 NA [4,] 1.068 1.299 1.018 1.223 1.420 1.503 NA [5,] 1.070 1.411 1.024 1.230 1.386 1.478 NA [6,] 1.091 1.437 1.075 1.232 1.377 1.433 NA [7,] 1.102 1.462 1.055 1.209 1.393 1.459 NA [8,] 1.091 1.360 1.091 1.209 1.371 1.510 NA [9,] 1.121 1.330 1.062 1.218 1.393 1.526 NA [10,] 1.134 1.234 1.083 1.225 1.405 1.543 NA [11,] 1.225 1.142 1.099 1.242 1.438 1.529 NA [12,] 1.191 1.017 1.097 1.294 1.424 1.499 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.021 0.023 -0.003 0.000 0.027 0.011 NA [2,] 0.017 0.064 -0.013 0.043 0.050 0.025 NA [3,] 0.025 0.028 0.018 0.042 0.013 -0.003 NA [4,] 0.002 0.112 0.006 0.007 -0.034 -0.025 NA [5,] 0.021 0.026 0.051 0.002 -0.009 -0.045 NA [6,] 0.011 0.025 -0.020 -0.023 0.016 0.026 NA [7,] -0.011 -0.102 0.036 0.000 -0.022 0.051 NA [8,] 0.030 -0.030 -0.029 0.009 0.022 0.016 NA [9,] 0.013 -0.096 0.021 0.007 0.012 0.017 NA [10,] 0.091 -0.092 0.016 0.017 0.033 -0.014 NA [11,] -0.034 -0.125 -0.002 0.052 -0.014 -0.030 NA [12,] -0.007 -0.001 0.041 0.036 0.046 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/1wu631393875360.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/2rlse1393875360.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/3vurk1393875360.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/4fzkr1393875360.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,] 1.005 1.0130 1.000 1.018 1.024 1.0750 1.055 1.0910 1.062 1.0830 1.0990 [2,] 1.016 1.0260 1.043 1.068 1.070 1.0910 1.102 1.0910 1.121 1.1340 1.1420 [3,] 1.161 1.1725 1.226 1.261 1.308 1.3045 1.301 1.2845 1.274 1.2295 1.2335 [4,] 1.330 1.3570 1.407 1.420 1.411 1.4330 1.459 1.3710 1.393 1.4050 1.4380 [5,] 1.470 1.4810 1.506 1.503 1.478 1.4370 1.462 1.5100 1.526 1.5430 1.5290 [,12] [1,] 1.0170 [2,] 1.0970 [3,] 1.2425 [4,] 1.4240 [5,] 1.4990 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.9584599 0.9589943 0.9912082 1.033949 1.088044 1.083899 1.070723 1.103891 [2,] 1.3635401 1.3860057 1.4607918 1.488051 1.527956 1.525101 1.531277 1.465109 [,9] [,10] [,11] [,12] [1,] 1.098551 1.054696 1.04257 1.031574 [2,] 1.449449 1.404304 1.42443 1.453426 $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(1.005, 1.016, 1.161, 1.33, 1.47, 1.013, 1.026, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5dsfr1393875360.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] [1,] -0.003 -0.013 -0.0030 -0.034 -0.0450 -0.0230 -0.1020 -0.0300 0.0070 [2,] 0.000 0.017 0.0130 -0.025 -0.0090 -0.0200 -0.0220 -0.0290 0.0070 [3,] 0.016 0.034 0.0215 0.004 0.0115 0.0135 -0.0055 0.0125 0.0125 [4,] 0.023 0.050 0.0280 0.007 0.0260 0.0250 0.0360 0.0220 0.0170 [5,] 0.027 0.064 0.0420 0.007 0.0510 0.0260 0.0510 0.0300 0.0210 [,10] [,11] [,12] [1,] -0.0140 -0.034 -0.007 [2,] -0.0140 -0.034 -0.001 [3,] 0.0165 -0.022 0.036 [4,] 0.0330 -0.002 0.041 [5,] 0.0910 -0.002 0.046 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.001164257 0.01271393 0.01182452 -0.01664103 -0.01107613 -0.01552645 [2,] 0.030835743 0.05528607 0.03117548 0.02464103 0.03407613 0.04252645 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.04291187 -0.02039665 0.006049677 -0.01381652 -0.042641034 0.006322906 [2,] 0.03191187 0.04539665 0.018950323 0.04681652 -0.001358966 0.065677094 $out [1] 0.112 -0.096 -0.092 -0.125 0.052 $group [1] 4 9 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.00300000000000011, 0, 0.0160000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kle81393875360.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,] 1.0050 1.0170 1.0000 1.1810 1.3300 1.433 NA [2,] 1.0555 1.1955 1.0170 1.1950 1.3740 1.474 NA [3,] 1.0910 1.2850 1.0585 1.2205 1.3930 1.501 NA [4,] 1.1275 1.3855 1.0870 1.2310 1.4135 1.518 NA [5,] 1.2250 1.4620 1.0990 1.2420 1.4380 1.543 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.05816 1.19834 1.026573 1.20408 1.374984 1.480931 NA [2,] 1.12384 1.37166 1.090427 1.23692 1.411016 1.521069 NA $out [1] 1.138 1.138 1.294 $group [1] 4 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.005, 1.0555, 1.091, 1.1275, 1.225, 1.017, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7fxai1393875360.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,] 1.203667 1.16100 1.186750 [2,] 1.244167 1.22775 1.234812 [3,] 1.268583 1.25175 1.256688 [4,] 1.274583 1.29275 1.266938 [5,] 1.280000 1.30800 1.285625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.254710 1.222103 1.242035 [2,] 1.282457 1.281397 1.271340 $out [1] 1.1905 1.1700 $group [1] 1 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.20366666666667, 1.24416666666667, 1.26858333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wu631393875360.ps tmp/1wu631393875360.png",intern=TRUE)) character(0) > try(system("convert tmp/2rlse1393875360.ps tmp/2rlse1393875360.png",intern=TRUE)) character(0) > try(system("convert tmp/3vurk1393875360.ps tmp/3vurk1393875360.png",intern=TRUE)) character(0) > try(system("convert tmp/4fzkr1393875360.ps tmp/4fzkr1393875360.png",intern=TRUE)) character(0) > try(system("convert tmp/5dsfr1393875360.ps tmp/5dsfr1393875360.png",intern=TRUE)) character(0) > try(system("convert tmp/6kle81393875360.ps tmp/6kle81393875360.png",intern=TRUE)) character(0) > try(system("convert tmp/7fxai1393875360.ps tmp/7fxai1393875360.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.032 0.935 5.996