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(68.906,39.556,50.669,36.432,40.891,48.428,36.222,33.425,39.401,37.967,34.801,12.657,69.116,41.519,51.321,38.529,41.547,52.073,38.401,40.898,40.439,41.888,37.898,8.771,68.184,50.530,47.221,41.756,45.633,48.138,39.486,39.341,41.117,41.629,29.722,7.054,56.676,34.870,35.117,30.169,30.936,35.699,33.228,27.733,33.666,35.429,27.438,8.170,63.410,38.040,45.389,37.353,37.024,50.957,37.994,36.454,46.080,43.373,37.395,10.963,76.058,50.179,57.452,47.568,50.050,50.856,41.992,39.284,44.521,43.832,41.153,17.100) > 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,] 68.906 69.116 68.184 56.676 63.410 76.058 NA [2,] 39.556 41.519 50.530 34.870 38.040 50.179 NA [3,] 50.669 51.321 47.221 35.117 45.389 57.452 NA [4,] 36.432 38.529 41.756 30.169 37.353 47.568 NA [5,] 40.891 41.547 45.633 30.936 37.024 50.050 NA [6,] 48.428 52.073 48.138 35.699 50.957 50.856 NA [7,] 36.222 38.401 39.486 33.228 37.994 41.992 NA [8,] 33.425 40.898 39.341 27.733 36.454 39.284 NA [9,] 39.401 40.439 41.117 33.666 46.080 44.521 NA [10,] 37.967 41.888 41.629 35.429 43.373 43.832 NA [11,] 34.801 37.898 29.722 27.438 37.395 41.153 NA [12,] 12.657 8.771 7.054 8.170 10.963 17.100 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -29.350 -27.597 -17.654 -21.806 -25.370 -25.879 NA [2,] 11.113 9.802 -3.309 0.247 7.349 7.273 NA [3,] -14.237 -12.792 -5.465 -4.948 -8.036 -9.884 NA [4,] 4.459 3.018 3.877 0.767 -0.329 2.482 NA [5,] 7.537 10.526 2.505 4.763 13.933 0.806 NA [6,] -12.206 -13.672 -8.652 -2.471 -12.963 -8.864 NA [7,] -2.797 2.497 -0.145 -5.495 -1.540 -2.708 NA [8,] 5.976 -0.459 1.776 5.933 9.626 5.237 NA [9,] -1.434 1.449 0.512 1.763 -2.707 -0.689 NA [10,] -3.166 -3.990 -11.907 -7.991 -5.978 -2.679 NA [11,] -22.144 -29.127 -22.668 -19.268 -26.432 -24.053 NA [12,] 56.459 59.413 49.622 55.240 65.095 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/1cmlj1363116651.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/24wwh1363116651.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/3d4g21363116651.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/4sa5b1363116651.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,] 56.676 34.8700 45.389 30.169 30.936 48.138 33.2280 27.733 33.666 35.4290 [2,] 63.410 38.0400 45.389 36.432 37.024 48.138 36.2220 33.425 39.401 37.9670 [3,] 68.545 40.5375 48.945 37.941 41.219 49.642 38.1975 37.869 40.778 41.7585 [4,] 69.116 50.1790 51.321 41.756 45.633 50.957 39.4860 39.341 44.521 43.3730 [5,] 76.058 50.5300 57.452 47.568 50.050 52.073 41.9920 40.898 46.080 43.8320 [,11] [,12] [1,] 27.438 7.054 [2,] 29.722 8.170 [3,] 36.098 9.867 [4,] 37.898 12.657 [5,] 41.153 17.100 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 64.86445 32.70745 45.11867 34.50685 35.66592 47.82365 36.09211 34.05299 [2,] 72.22555 48.36755 52.77133 41.37515 46.77208 51.46035 40.30289 41.68501 [,9] [,10] [,11] [,12] [1,] 37.47543 38.27146 30.82422 6.97274 [2,] 44.08057 45.24554 41.37178 12.76126 $out [1] 35.117 35.699 $group [1] 3 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(56.676, 63.41, 68.545, 69.116, 76.058, 34.87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59uhq1363116651.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,] -29.3500 -3.309 -14.237 -0.329 0.806 -13.672 -5.495 -0.459 -2.7070 [2,] -27.5970 0.247 -12.792 0.767 2.505 -12.963 -2.797 1.776 -1.4340 [3,] -25.6245 7.311 -8.960 2.750 6.150 -10.535 -2.124 5.585 -0.0885 [4,] -21.8060 9.802 -5.465 3.877 10.526 -8.652 -0.145 5.976 1.4490 [5,] -17.6540 11.113 -4.948 4.459 13.933 -2.471 2.497 9.626 1.7630 [,10] [,11] [,12] [1,] -11.907 -29.1270 49.622 [2,] -7.991 -26.4320 55.240 [3,] -4.984 -23.3605 56.459 [4,] -3.166 -22.1440 59.413 [5,] -2.679 -19.2680 65.095 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -29.35988 1.147716 -13.686152 0.7439496 0.9761959 -13.315734 -3.8346257 [2,] -21.88912 13.474284 -4.233848 4.7560504 11.3238041 -7.754266 -0.4133743 [,8] [,9] [,10] [,11] [,12] [1,] 2.875864 -1.948128 -8.096281 -26.1264 53.51037 [2,] 8.294136 1.771128 -1.871719 -20.5946 59.40763 $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(-29.35, -27.597, -25.6245, -21.806, -17.654, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tt051363116651.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,] 33.4250 37.8980 29.7220 27.438 36.4540 39.2840 NA [2,] 35.5115 38.4650 39.4135 28.951 37.1885 41.5725 NA [3,] 38.6840 41.2085 41.6925 33.447 38.0170 46.0445 NA [4,] 44.6595 46.6045 47.6795 35.273 45.7345 50.5175 NA [5,] 50.6690 52.0730 50.5300 35.699 50.9570 57.4520 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 34.51154 37.49602 37.92232 30.56349 34.11911 41.96463 NA [2,] 42.85646 44.92098 45.46268 36.33051 41.91489 50.12437 NA $out [1] 68.906 12.657 69.116 8.771 68.184 7.054 56.676 8.170 63.410 10.963 [11] 76.058 17.100 $group [1] 1 1 2 2 3 3 4 4 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(33.425, 35.5115, 38.684, 44.6595, 50.669, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7oue31363116651.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,] 34.73450 36.09800 34.38200 [2,] 37.03817 37.90500 37.34719 [3,] 40.77850 40.65775 41.12163 [4,] 45.07042 45.35175 45.85950 [5,] 47.86150 49.64200 49.57112 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 37.11494 37.26124 37.23910 [2,] 44.44206 44.05426 45.00415 $out [1] 67.05833 10.78583 68.54500 9.86700 66.83350 10.27688 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(34.7345, 37.0381666666667, 40.7785, 45.0704166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cmlj1363116651.ps tmp/1cmlj1363116651.png",intern=TRUE)) character(0) > try(system("convert tmp/24wwh1363116651.ps tmp/24wwh1363116651.png",intern=TRUE)) character(0) > try(system("convert tmp/3d4g21363116651.ps tmp/3d4g21363116651.png",intern=TRUE)) character(0) > try(system("convert tmp/4sa5b1363116651.ps tmp/4sa5b1363116651.png",intern=TRUE)) character(0) > try(system("convert tmp/59uhq1363116651.ps tmp/59uhq1363116651.png",intern=TRUE)) character(0) > try(system("convert tmp/6tt051363116651.ps tmp/6tt051363116651.png",intern=TRUE)) character(0) > try(system("convert tmp/7oue31363116651.ps tmp/7oue31363116651.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.102 0.601 4.689