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(86.86,86.79,82.52,86.87,81.62,82.66,89.87,92.04,79.74,77.75,79.12,76.37,75.01,77.6,77.81,81.7,76.47,74.72,84.43,86.72,70.99,75.43,74.14,73.3,71.97,69.27,74.13,76.4,72.26,72.1,87.82,91.62,82.69,85.76,86.87,93.09,83.73,84.49,87.37,89.13,83.2,83.77,93.68,93.09,88.59,87.88,87.89,89.38,89.13,89.58,90.22,91.44,91.04,92.1,97.54,99.12,100,99.68,100.08,99.9,99.63,99.45,99.63,99.46,96.91,97.65,102.1,103.57,104.59,104.79,101.31,104.8) > 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,] 86.86 75.01 71.97 83.73 89.13 99.63 NA [2,] 86.79 77.60 69.27 84.49 89.58 99.45 NA [3,] 82.52 77.81 74.13 87.37 90.22 99.63 NA [4,] 86.87 81.70 76.40 89.13 91.44 99.46 NA [5,] 81.62 76.47 72.26 83.20 91.04 96.91 NA [6,] 82.66 74.72 72.10 83.77 92.10 97.65 NA [7,] 89.87 84.43 87.82 93.68 97.54 102.10 NA [8,] 92.04 86.72 91.62 93.09 99.12 103.57 NA [9,] 79.74 70.99 82.69 88.59 100.00 104.59 NA [10,] 77.75 75.43 85.76 87.88 99.68 104.79 NA [11,] 79.12 74.14 86.87 87.89 100.08 101.31 NA [12,] 76.37 73.30 93.09 89.38 99.90 104.80 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.07 2.59 -2.70 0.76 0.45 -0.18 NA [2,] -4.27 0.21 4.86 2.88 0.64 0.18 NA [3,] 4.35 3.89 2.27 1.76 1.22 -0.17 NA [4,] -5.25 -5.23 -4.14 -5.93 -0.40 -2.55 NA [5,] 1.04 -1.75 -0.16 0.57 1.06 0.74 NA [6,] 7.21 9.71 15.72 9.91 5.44 4.45 NA [7,] 2.17 2.29 3.80 -0.59 1.58 1.47 NA [8,] -12.30 -15.73 -8.93 -4.50 0.88 1.02 NA [9,] -1.99 4.44 3.07 -0.71 -0.32 0.20 NA [10,] 1.37 -1.29 1.11 0.01 0.40 -3.48 NA [11,] -2.75 -0.84 6.22 1.49 -0.18 3.49 NA [12,] -1.36 -1.33 -9.36 -0.25 -0.27 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/1qt4j1382615240.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/2fhzo1382615240.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/3x84o1382615240.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/4kmx21382615240.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,] 71.970 69.27 74.130 76.40 72.26 72.100 84.430 86.720 70.99 75.43 [2,] 75.010 77.60 77.810 81.70 76.47 74.720 87.820 91.620 79.74 77.75 [3,] 85.295 85.64 84.945 88.00 82.41 83.215 91.775 92.565 85.64 86.82 [4,] 89.130 89.58 90.220 91.44 91.04 92.100 97.540 99.120 100.00 99.68 [5,] 99.630 99.45 99.630 99.46 96.91 97.650 102.100 103.570 104.59 104.79 [,11] [,12] [1,] 74.14 73.300 [2,] 79.12 76.370 [3,] 87.38 91.235 [4,] 100.08 99.900 [5,] 101.31 104.800 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 76.18714 77.91251 76.94015 81.71739 73.01188 72.00434 85.50529 87.72726 [2,] 94.40286 93.36749 92.94985 94.28261 91.80812 94.42566 98.04471 97.40274 [,9] [,10] [,11] [,12] [1,] 72.57165 72.67444 73.86012 76.05739 [2,] 98.70835 100.96556 100.89988 106.41261 $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(71.97, 75.01, 85.295, 89.13, 99.63, 69.27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5k4kh1382615240.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.18 0.180 -0.170 -5.930 -1.750 4.45 1.470 -15.730 -1.99 -3.480 -2.750 [2,] -0.18 0.180 1.220 -5.250 -0.160 5.44 1.470 -12.300 -0.71 -1.290 -0.840 [3,] 0.19 0.425 2.015 -4.685 0.655 8.46 1.875 -6.715 -0.06 0.205 0.655 [4,] 0.76 2.880 3.890 -2.550 1.040 9.91 2.290 0.880 3.07 1.110 3.490 [5,] 0.76 4.860 4.350 -0.400 1.060 15.72 2.290 1.020 4.44 1.370 6.220 [,12] [1,] -1.36 [2,] -1.36 [3,] -1.33 [4,] -0.27 [5,] -0.25 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.4163304 -1.316587 0.2927638 -6.426587 -0.1190388 5.576706 1.346074 [2,] 0.7963304 2.166587 3.7372362 -2.943413 1.4290388 11.343294 2.403926 [,8] [,9] [,10] [,11] [,12] [1,] -15.216526 -2.498222 -1.343078 -2.13799 -2.1001913 [2,] 1.786526 2.378222 1.753078 3.44799 -0.5598087 $out [1] 2.59 -2.70 -4.27 3.80 -0.59 -9.36 $group [1] 1 1 2 7 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.179999999999993, -0.179999999999993, 0.190000000000005, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6020b1382615240.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,] 76.370 70.990 69.270 83.200 89.13 96.910 NA [2,] 79.430 74.430 72.180 84.130 90.63 99.455 NA [3,] 82.590 75.950 79.545 87.885 94.82 100.470 NA [4,] 86.865 79.755 87.345 89.255 99.79 104.080 NA [5,] 92.040 86.720 93.090 93.680 100.08 104.800 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 79.19885 73.52123 72.62814 85.54745 90.64206 98.36051 NA [2,] 85.98115 78.37877 86.46186 90.22255 98.99794 102.57949 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(76.37, 79.43, 82.59, 86.865, 92.04, 70.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7ufp31382615240.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,] 83.58333 82.4100 82.87625 [2,] 84.45917 85.1200 83.76062 [3,] 87.63333 86.2300 87.58438 [4,] 89.01083 89.6175 88.97750 [5,] 94.36000 92.5650 94.66875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 85.55729 84.17866 85.20492 [2,] 89.70938 88.28134 89.96383 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(83.5833333333333, 84.4591666666667, 87.6333333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qt4j1382615240.ps tmp/1qt4j1382615240.png",intern=TRUE)) character(0) > try(system("convert tmp/2fhzo1382615240.ps tmp/2fhzo1382615240.png",intern=TRUE)) character(0) > try(system("convert tmp/3x84o1382615240.ps tmp/3x84o1382615240.png",intern=TRUE)) character(0) > try(system("convert tmp/4kmx21382615240.ps tmp/4kmx21382615240.png",intern=TRUE)) character(0) > try(system("convert tmp/5k4kh1382615240.ps tmp/5k4kh1382615240.png",intern=TRUE)) character(0) > try(system("convert tmp/6020b1382615240.ps tmp/6020b1382615240.png",intern=TRUE)) character(0) > try(system("convert tmp/7ufp31382615240.ps tmp/7ufp31382615240.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.112 0.555 3.662