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(31.5,31.29,31.3,31.06,31.09,31.11,31.13,31.1,31.03,30.74,30.83,30.82,30.8,30.74,30.71,30.58,30.71,30.7,30.7,30.72,30.68,30.78,30.84,30.8,30.8,30.88,30.87,30.92,30.82,30.75,30.75,30.75,30.63,30.52,30.58,30.6,30.6,30.63,30.56,30.61,30.53,30.6,30.6,30.63,30.66,30.34,30.32,30.3,30.3,30.08,29.96,29.91,29.83,29.89,29.85,30.06,29.83,29.95,30.02,30.03,30.03,29.96,29.85,30.12,29.91,29.9,29.92,29.89,29.96,29.72,29.6,29.54,29.54,29.54,29.48,29.55,29.58,29.6,29.6,29.56,29.7,29.76,29.24,29.28) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 31.50 30.80 30.80 30.60 30.30 30.03 29.54 NA [2,] 31.29 30.74 30.88 30.63 30.08 29.96 29.54 NA [3,] 31.30 30.71 30.87 30.56 29.96 29.85 29.48 NA [4,] 31.06 30.58 30.92 30.61 29.91 30.12 29.55 NA [5,] 31.09 30.71 30.82 30.53 29.83 29.91 29.58 NA [6,] 31.11 30.70 30.75 30.60 29.89 29.90 29.60 NA [7,] 31.13 30.70 30.75 30.60 29.85 29.92 29.60 NA [8,] 31.10 30.72 30.75 30.63 30.06 29.89 29.56 NA [9,] 31.03 30.68 30.63 30.66 29.83 29.96 29.70 NA [10,] 30.74 30.78 30.52 30.34 29.95 29.72 29.76 NA [11,] 30.83 30.84 30.58 30.32 30.02 29.60 29.24 NA [12,] 30.82 30.80 30.60 30.30 30.03 29.54 29.28 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.21 -0.06 0.08 0.03 -0.22 -0.07 0.00 NA [2,] 0.01 -0.03 -0.01 -0.07 -0.12 -0.11 -0.06 NA [3,] -0.24 -0.13 0.05 0.05 -0.05 0.27 0.07 NA [4,] 0.03 0.13 -0.10 -0.08 -0.08 -0.21 0.03 NA [5,] 0.02 -0.01 -0.07 0.07 0.06 -0.01 0.02 NA [6,] 0.02 0.00 0.00 0.00 -0.04 0.02 0.00 NA [7,] -0.03 0.02 0.00 0.03 0.21 -0.03 -0.04 NA [8,] -0.07 -0.04 -0.12 0.03 -0.23 0.07 0.14 NA [9,] -0.29 0.10 -0.11 -0.32 0.12 -0.24 0.06 NA [10,] 0.09 0.06 0.06 -0.02 0.07 -0.12 -0.52 NA [11,] -0.01 -0.04 0.02 -0.02 0.01 -0.06 0.04 NA [12,] -0.02 0.00 0.00 0.00 0.00 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/fisher/rcomp/tmp/1wjd31383668986.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/2gb3q1383668986.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/3f2641383668987.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/4hjk21383668987.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,] 29.540 29.54 29.480 29.550 29.580 29.600 29.600 29.560 29.700 29.720 [2,] 30.165 30.02 29.905 30.015 29.870 29.895 29.885 29.975 29.895 29.855 [3,] 30.600 30.63 30.560 30.580 30.530 30.600 30.600 30.630 30.630 30.340 [4,] 30.800 30.81 30.790 30.765 30.765 30.725 30.725 30.735 30.670 30.630 [5,] 31.500 31.29 31.300 31.060 31.090 31.110 31.130 31.100 31.030 30.780 [,11] [,12] [1,] 29.240 29.280 [2,] 29.810 29.785 [3,] 30.320 30.300 [4,] 30.705 30.700 [5,] 30.840 30.820 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 30.22079 30.15822 30.03149 30.13211 29.99552 30.10434 30.09837 30.17614 [2,] 30.97921 31.10178 31.08851 31.02789 31.06448 31.09566 31.10163 31.08386 [,9] [,10] [,11] [,12] [1,] 30.16718 29.87718 29.78552 29.75358 [2,] 31.09282 30.80282 30.85448 30.84642 $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.54, 30.165, 30.6, 30.8, 31.5, 29.54, 30.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5nful1383668987.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] [1,] -0.220 -0.12 -0.24 -0.21 -0.07 0.00 -0.040 -0.230 -0.320 -0.120 -0.060 [2,] -0.140 -0.09 -0.09 -0.09 -0.01 0.00 -0.030 -0.095 -0.265 -0.070 -0.030 [3,] -0.060 -0.06 0.05 -0.08 0.02 0.00 0.000 -0.040 -0.110 0.060 -0.010 [4,] 0.015 -0.02 0.06 0.03 0.04 0.01 0.025 0.050 0.080 0.065 0.015 [5,] 0.080 0.01 0.27 0.13 0.07 0.02 0.030 0.140 0.120 0.090 0.040 [,12] [1,] 0 [2,] 0 [3,] 0 [4,] 0 [5,] 0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1525635 -0.10180287 -0.03957758 -0.151662064 -0.009859193 -0.005971839 [2,] 0.0325635 -0.01819713 0.13957758 -0.008337936 0.049859193 0.005971839 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.03284511 -0.12659166 -0.31602843 -0.02061982 -0.03687327 0 [2,] 0.03284511 0.04659166 0.09602843 0.14061982 0.01687327 0 $out [1] -0.04 0.21 -0.52 -0.02 $group [1] 6 7 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.220000000000002, -0.140000000000001, -0.0600000000000023, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6wj821383668987.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] [,8] [1,] 30.740 30.580 30.520 30.300 29.830 29.540 29.480 NA [2,] 30.930 30.700 30.615 30.435 29.870 29.785 29.510 NA [3,] 31.095 30.715 30.750 30.600 29.955 29.905 29.555 NA [4,] 31.210 30.790 30.845 30.620 30.045 29.960 29.600 NA [5,] 31.500 30.840 30.920 30.660 30.300 30.120 29.700 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 30.96729 30.67395 30.6451 30.51562 29.87518 29.82518 29.51395 NA [2,] 31.22271 30.75605 30.8549 30.68438 30.03482 29.98482 29.59605 NA $out [1] 29.76 29.24 29.28 $group [1] 7 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(30.74, 30.93, 31.095, 31.21, 31.5, 30.58, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7cj8d1383668987.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,] 30.19571 30.300 30.24250 [2,] 30.30571 30.435 30.27000 [3,] 30.36429 30.590 30.31375 [4,] 30.39143 30.615 30.37250 [5,] 30.51000 30.630 30.48250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 30.32519 30.5079 30.2670 [2,] 30.40338 30.6721 30.3605 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(30.1957142857143, 30.3057142857143, 30.3642857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wjd31383668986.ps tmp/1wjd31383668986.png",intern=TRUE)) character(0) > try(system("convert tmp/2gb3q1383668986.ps tmp/2gb3q1383668986.png",intern=TRUE)) character(0) > try(system("convert tmp/3f2641383668987.ps tmp/3f2641383668987.png",intern=TRUE)) character(0) > try(system("convert tmp/4hjk21383668987.ps tmp/4hjk21383668987.png",intern=TRUE)) character(0) > try(system("convert tmp/5nful1383668987.ps tmp/5nful1383668987.png",intern=TRUE)) character(0) > try(system("convert tmp/6wj821383668987.ps tmp/6wj821383668987.png",intern=TRUE)) character(0) > try(system("convert tmp/7cj8d1383668987.ps tmp/7cj8d1383668987.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.395 0.676 4.059