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(3.875,3.863,3.876,3.878,3.881,3.883,3.884,3.885,3.895,3.903,3.911,3.929,3.946,3.965,3.992,4.010,4.015,4.020,4.037,4.059,4.083,4.102,4.126,4.145,4.162,4.169,4.178,4.174,4.168,4.170,4.159,4.159,4.143,4.159,4.167,4.176,4.185,4.195,4.210,4.226,4.250,4.259,4.270,4.277,4.286,4.303,4.320,4.336,4.352,4.371,4.392,4.415,4.442,4.457,4.472,4.474,4.461,4.453,4.446,4.450,4.459,4.474,4.492,4.509,4.526,4.541,4.550,4.562,4.555,4.554,4.551,4.553) > 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,] 3.875 3.946 4.162 4.185 4.352 4.459 NA [2,] 3.863 3.965 4.169 4.195 4.371 4.474 NA [3,] 3.876 3.992 4.178 4.210 4.392 4.492 NA [4,] 3.878 4.010 4.174 4.226 4.415 4.509 NA [5,] 3.881 4.015 4.168 4.250 4.442 4.526 NA [6,] 3.883 4.020 4.170 4.259 4.457 4.541 NA [7,] 3.884 4.037 4.159 4.270 4.472 4.550 NA [8,] 3.885 4.059 4.159 4.277 4.474 4.562 NA [9,] 3.895 4.083 4.143 4.286 4.461 4.555 NA [10,] 3.903 4.102 4.159 4.303 4.453 4.554 NA [11,] 3.911 4.126 4.167 4.320 4.446 4.551 NA [12,] 3.929 4.145 4.176 4.336 4.450 4.553 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.012 0.019 0.007 0.010 0.019 0.015 NA [2,] 0.013 0.027 0.009 0.015 0.021 0.018 NA [3,] 0.002 0.018 -0.004 0.016 0.023 0.017 NA [4,] 0.003 0.005 -0.006 0.024 0.027 0.017 NA [5,] 0.002 0.005 0.002 0.009 0.015 0.015 NA [6,] 0.001 0.017 -0.011 0.011 0.015 0.009 NA [7,] 0.001 0.022 0.000 0.007 0.002 0.012 NA [8,] 0.010 0.024 -0.016 0.009 -0.013 -0.007 NA [9,] 0.008 0.019 0.016 0.017 -0.008 -0.001 NA [10,] 0.008 0.024 0.008 0.017 -0.007 -0.003 NA [11,] 0.018 0.019 0.009 0.016 0.004 0.002 NA [12,] 0.017 0.017 0.009 0.016 0.009 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/fisher/rcomp/tmp/16jn21382099043.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/fisher/rcomp/tmp/249xu1382099043.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/fisher/rcomp/tmp/3lgt01382099043.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/fisher/rcomp/tmp/4f3if1382099043.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,] 3.8750 3.863 3.876 3.878 3.881 3.8830 3.8840 3.885 3.8950 3.903 3.9110 [2,] 3.9460 3.965 3.992 4.010 4.015 4.0200 4.0370 4.059 4.0830 4.102 4.1260 [3,] 4.1735 4.182 4.194 4.200 4.209 4.2145 4.2145 4.218 4.2145 4.231 4.2435 [4,] 4.3520 4.371 4.392 4.415 4.442 4.4570 4.4720 4.474 4.4610 4.453 4.4460 [5,] 4.4590 4.474 4.492 4.509 4.526 4.5410 4.5500 4.562 4.5550 4.554 4.5510 [,12] [1,] 3.929 [2,] 4.145 [3,] 4.256 [4,] 4.450 [5,] 4.553 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3.911617 3.920117 3.935987 3.938762 3.933571 3.932621 3.933911 3.950312 [2,] 4.435383 4.443883 4.452013 4.461238 4.484429 4.496379 4.495089 4.485688 [,9] [,10] [,11] [,12] [1,] 3.970678 4.004594 4.03709 4.059265 [2,] 4.458322 4.457406 4.44991 4.452735 $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(3.875, 3.946, 4.1735, 4.352, 4.459, 3.863, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5rp3f1382099043.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.0070 0.0090 -0.0040 -0.006 0.002 -0.011 0.0000 -0.016 -0.008 -0.007 [2,] 0.0070 0.0130 0.0020 0.003 0.002 0.001 0.0010 -0.013 -0.001 -0.003 [3,] 0.0125 0.0165 0.0165 0.011 0.007 0.010 0.0045 0.001 0.012 0.008 [4,] 0.0190 0.0210 0.0180 0.024 0.015 0.015 0.0120 0.010 0.017 0.017 [5,] 0.0190 0.0270 0.0230 0.027 0.015 0.017 0.0220 0.024 0.019 0.024 [,11] [,12] [1,] 0.0020 0.009 [2,] 0.0040 0.009 [3,] 0.0125 0.016 [4,] 0.0180 0.017 [5,] 0.0190 0.017 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.004759612 0.01133974 0.006179483 -0.002545678 -0.00138542 0.0009695478 [2,] 0.020240388 0.02166026 0.026820517 0.024545678 0.01538542 0.0190304522 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.002595355 -0.01383574 0.0003894186 -0.004900646 0.003469548 0.01034722 [2,] 0.011595355 0.01583574 0.0236105814 0.020900646 0.021530452 0.02165278 $out [1] -0.012 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.00699999999999967, 0.00699999999999967, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ryvo1382099043.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,] 3.8630 3.9460 4.1430 4.1850 4.3520 4.4590 NA [2,] 3.8770 4.0010 4.1590 4.2180 4.4035 4.5005 NA [3,] 3.8835 4.0285 4.1675 4.2645 4.4480 4.5455 NA [4,] 3.8990 4.0925 4.1720 4.2945 4.4590 4.5535 NA [5,] 3.9290 4.1450 4.1780 4.3360 4.4740 4.5620 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.873466 3.986766 4.161571 4.229608 4.422686 4.521326 NA [2,] 3.893534 4.070234 4.173429 4.299392 4.473314 4.569674 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(3.863, 3.877, 3.8835, 3.899, 3.929, 3.946, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7ibat1382099043.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,] 4.163167 4.1735 4.155125 [2,] 4.196000 4.1970 4.200938 [3,] 4.225167 4.2145 4.238500 [4,] 4.241417 4.2245 4.261750 [5,] 4.264833 4.2560 4.287125 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.204452 4.201957 4.210763 [2,] 4.245882 4.227043 4.266237 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(4.16316666666667, 4.196, 4.22516666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16jn21382099043.ps tmp/16jn21382099043.png",intern=TRUE)) character(0) > try(system("convert tmp/249xu1382099043.ps tmp/249xu1382099043.png",intern=TRUE)) character(0) > try(system("convert tmp/3lgt01382099043.ps tmp/3lgt01382099043.png",intern=TRUE)) character(0) > try(system("convert tmp/4f3if1382099043.ps tmp/4f3if1382099043.png",intern=TRUE)) character(0) > try(system("convert tmp/5rp3f1382099043.ps tmp/5rp3f1382099043.png",intern=TRUE)) character(0) > try(system("convert tmp/6ryvo1382099043.ps tmp/6ryvo1382099043.png",intern=TRUE)) character(0) > try(system("convert tmp/7ibat1382099043.ps tmp/7ibat1382099043.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.257 0.593 3.838