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(3167956.00,3001753.00,3571343.00,3990145.00,4472259.00,4487988.00,1.464,1.474,1.479,1.517,1.575,1.627,1.613,1.558,1.545,1.406,1.269,1.191,1.231,1.276,1.281,1.312,1.363,1.419,1.374,1.422,1.378,1.38,1.409,1.398,1.445,1.452,1.506,1.531,1.524,1.52,1.499,1.491,1.496,1.493,1.507,1.569,1.593,1.597,1.633,1.686,1.683,1.646,1.658,1.636,1.67,1.634,1.618,1.622,1.688,1.723,1.776,1.809,1.754,1.714,1.733,1.783,1.818,1.81,1.764,1.73,1.742,1.785,1.769,1.743,1.721,1.73,1.753,1.764,1.758,1.7,1.678,1.688) > 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] 78 > (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 7 7 7 7 7 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3167956.000 1.613 1.374 1.499 1.658 1.733 1.753 [2,] 3001753.000 1.558 1.422 1.491 1.636 1.783 1.764 [3,] 3571343.000 1.545 1.378 1.496 1.670 1.818 1.758 [4,] 3990145.000 1.406 1.380 1.493 1.634 1.810 1.700 [5,] 4472259.000 1.269 1.409 1.507 1.618 1.764 1.678 [6,] 4487988.000 1.191 1.398 1.569 1.622 1.730 1.688 [7,] 1.464 1.231 1.445 1.593 1.688 1.742 NA [8,] 1.474 1.276 1.452 1.597 1.723 1.785 NA [9,] 1.479 1.281 1.506 1.633 1.776 1.769 NA [10,] 1.517 1.312 1.531 1.686 1.809 1.743 NA [11,] 1.575 1.363 1.524 1.683 1.754 1.721 NA [12,] 1.627 1.419 1.520 1.646 1.714 1.730 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -166203.000 -0.055 0.048 -0.008 -0.022 0.050 0.011 [2,] 569590.000 -0.013 -0.044 0.005 0.034 0.035 -0.006 [3,] 418802.000 -0.139 0.002 -0.003 -0.036 -0.008 -0.058 [4,] 482114.000 -0.137 0.029 0.014 -0.016 -0.046 -0.022 [5,] 15729.000 -0.078 -0.011 0.062 0.004 -0.034 0.010 [6,] -4487986.536 0.040 0.047 0.024 0.066 0.012 NA [7,] 0.010 0.045 0.007 0.004 0.035 0.043 NA [8,] 0.005 0.005 0.054 0.036 0.053 -0.016 NA [9,] 0.038 0.031 0.025 0.053 0.033 -0.026 NA [10,] 0.058 0.051 -0.007 -0.003 -0.055 -0.022 NA [11,] 0.052 0.056 -0.004 -0.037 -0.040 0.009 NA [12,] -0.014 -0.045 -0.021 0.012 0.019 0.023 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/1v8tp1412840823.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/2fur91412840823.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/3hp3g1412840823.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/4si9c1412840823.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.374 1.4220 1.3780 1.3800 1.269 1.1910 1.2310 1.2760 1.2810 1.3120 1.363 [2,] 1.556 1.5245 1.5205 1.4495 1.458 1.4835 1.4450 1.4520 1.4790 1.5170 1.524 [3,] 1.658 1.6360 1.6700 1.6340 1.618 1.6220 1.5285 1.5355 1.5695 1.6085 1.629 [4,] 1.743 1.7735 1.7880 1.7550 1.721 1.7090 1.6880 1.7230 1.7690 1.7430 1.721 [5,] 1.753 1.7830 1.8180 1.8100 1.764 1.7300 1.7420 1.7850 1.7760 1.8090 1.754 [,12] [1,] 1.4190 [2,] 1.5200 [3,] 1.6365 [4,] 1.7140 [5,] 1.7300 $n [1] 7 7 7 7 7 7 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.546327 1.487301 1.510253 1.45156 1.460941 1.487335 1.371757 1.360696 [2,] 1.769673 1.784699 1.829747 1.81644 1.775059 1.756665 1.685243 1.710304 [,9] [,10] [,11] [,12] [1,] 1.382441 1.462723 1.501929 1.511364 [2,] 1.756559 1.754277 1.756071 1.761636 $out [1] 3167956 3001753 3571343 3990145 4472259 4487988 $group [1] 1 2 3 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.374, 1.556, 1.658, 1.743, 1.753, 1.422, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55chx1412840823.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] [1,] -0.0550 -0.0440 -0.0580 -0.0460 -0.0780 0.012 0.0040 -0.0160 0.025 -0.055 [2,] -0.0385 -0.0095 -0.0470 -0.0340 -0.0225 0.012 0.0070 0.0050 0.025 -0.022 [3,] -0.0080 0.0050 -0.0080 -0.0160 0.0040 0.032 0.0225 0.0205 0.032 -0.005 [4,] 0.0295 0.0345 -0.0005 0.0215 0.0360 0.047 0.0430 0.0530 0.038 0.051 [5,] 0.0500 0.0350 0.0020 0.0290 0.0620 0.066 0.0450 0.0540 0.053 0.058 [,11] [,12] [1,] -0.0400 -0.045 [2,] -0.0370 -0.021 [3,] 0.0025 -0.001 [4,] 0.0520 0.019 [5,] 0.0560 0.023 $n [1] 7 7 7 7 7 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.0486085 -0.02127609 -0.03576905 -0.0491437 -0.03093526 0.00942387 [2,] 0.0326085 0.03127609 0.01976905 0.0171437 0.03893526 0.05457613 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.0007211628 -0.01046155 0.02361458 -0.05208736 -0.05490787 -0.02680129 [2,] 0.0457211628 0.05146155 0.04038542 0.04208736 0.05990787 0.02480129 $out [1] -166203.000 569590.000 418802.000 -0.139 482114.000 [6] -0.137 15729.000 -4487986.536 -0.026 $group [1] 1 2 3 3 4 4 5 6 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0549999999999999, -0.0385, -0.00800000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6vjoy1412840823.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.464 1.1910 1.3740 1.4910 1.6180 1.7210 1.6780 [2,] 1.498 1.2725 1.3890 1.4975 1.6350 1.7315 1.6880 [3,] 1500877.313 1.3375 1.4335 1.5810 1.6790 1.7535 1.7265 [4,] 3780744.000 1.4820 1.5130 1.6395 1.7385 1.7840 1.7580 [5,] 4487988.000 1.6130 1.5310 1.6860 1.8090 1.8180 1.7640 $n [1] 12 12 12 12 12 12 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -223544.7 1.241946 1.376943 1.516233 1.631793 1.729554 1.681348 [2,] 3225299.3 1.433054 1.490057 1.645767 1.726207 1.777446 1.771652 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.464, 1.498, 1500877.3135, 3780744, 4487988, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/722l01412840823.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.527167e+00 1.52850 1.557000 [2,] 1.586833e+00 1.58900 1.592875 [3,] 2.144124e+05 1.62550 1.616125 [4,] 5.401076e+05 1.63625 1.636813 [5,] 6.411425e+05 1.67000 1.654250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] -31933.58 1.603949 1.596085 [2,] 460758.42 1.647051 1.636165 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.52716666666667, 1.58683333333333, 214412.422809524, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1v8tp1412840823.ps tmp/1v8tp1412840823.png",intern=TRUE)) character(0) > try(system("convert tmp/2fur91412840823.ps tmp/2fur91412840823.png",intern=TRUE)) character(0) > try(system("convert tmp/3hp3g1412840823.ps tmp/3hp3g1412840823.png",intern=TRUE)) character(0) > try(system("convert tmp/4si9c1412840823.ps tmp/4si9c1412840823.png",intern=TRUE)) character(0) > try(system("convert tmp/55chx1412840823.ps tmp/55chx1412840823.png",intern=TRUE)) character(0) > try(system("convert tmp/6vjoy1412840823.ps tmp/6vjoy1412840823.png",intern=TRUE)) character(0) > try(system("convert tmp/722l01412840823.ps tmp/722l01412840823.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.448 0.365 2.849