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(63.52,61.71,63.01,68.18,72.03,69.75,74.41,74.33,64.24,60.03,59.44,62.5,55.04,58.34,61.92,67.65,67.68,70.3,75.26,71.44,76.36,81.71,92.6,90.6,92.23,94.09,102.79,109.65,124.05,132.69,135.81,116.07,101.42,75.73,55.48,43.8,45.29,44.01,47.48,51.07,57.84,69.04,65.61,72.87,68.41,73.25,77.43,75.28,77.33,74.31,79.7,85.47,77.98,75.69,75.2,77.21,77.85,83.53,85.99,91.77,96.59,103.57,114.46,122.54,115.08,113.93,116.29,110.12,110.86,108.53,110.61,108.1) > 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,] 63.52 55.04 92.23 45.29 77.33 96.59 NA [2,] 61.71 58.34 94.09 44.01 74.31 103.57 NA [3,] 63.01 61.92 102.79 47.48 79.70 114.46 NA [4,] 68.18 67.65 109.65 51.07 85.47 122.54 NA [5,] 72.03 67.68 124.05 57.84 77.98 115.08 NA [6,] 69.75 70.30 132.69 69.04 75.69 113.93 NA [7,] 74.41 75.26 135.81 65.61 75.20 116.29 NA [8,] 74.33 71.44 116.07 72.87 77.21 110.12 NA [9,] 64.24 76.36 101.42 68.41 77.85 110.86 NA [10,] 60.03 81.71 75.73 73.25 83.53 108.53 NA [11,] 59.44 92.60 55.48 77.43 85.99 110.61 NA [12,] 62.50 90.60 43.80 75.28 91.77 108.10 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.81 3.30 1.86 -1.28 -3.02 6.98 NA [2,] 1.30 3.58 8.70 3.47 5.39 10.89 NA [3,] 5.17 5.73 6.86 3.59 5.77 8.08 NA [4,] 3.85 0.03 14.40 6.77 -7.49 -7.46 NA [5,] -2.28 2.62 8.64 11.20 -2.29 -1.15 NA [6,] 4.66 4.96 3.12 -3.43 -0.49 2.36 NA [7,] -0.08 -3.82 -19.74 7.26 2.01 -6.17 NA [8,] -10.09 4.92 -14.65 -4.46 0.64 0.74 NA [9,] -4.21 5.35 -25.69 4.84 5.68 -2.33 NA [10,] -0.59 10.89 -20.25 4.18 2.46 2.08 NA [11,] 3.06 -2.00 -11.68 -2.15 5.78 -2.51 NA [12,] -7.46 1.63 1.49 2.05 4.82 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/16u5e1363129212.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/2m73u1363129212.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/3tpvt1363129212.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/4kmwg1363129212.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,] 45.290 44.01 47.480 51.070 57.840 69.040 65.61 71.44 64.240 60.03 [2,] 55.040 58.34 61.920 67.650 67.680 69.750 74.41 72.87 68.410 73.25 [3,] 70.425 68.01 71.355 76.825 75.005 72.995 75.23 75.77 77.105 78.72 [4,] 92.230 94.09 102.790 109.650 115.080 113.930 116.29 110.12 101.420 83.53 [5,] 96.590 103.57 114.460 122.540 124.050 132.690 135.81 116.07 110.860 83.53 [,11] [,12] [1,] 55.48 43.80 [2,] 59.44 62.50 [3,] 81.71 82.94 [4,] 92.60 91.77 [5,] 110.61 108.10 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 46.43625 44.9501 44.99253 49.73364 44.43047 44.49747 48.21605 51.74255 [2,] 94.41375 91.0699 97.71747 103.91636 105.57953 101.49253 102.24395 99.79745 [,9] [,10] [,11] [,12] [1,] 55.81248 72.08907 60.32073 64.0599 [2,] 98.39752 85.35093 103.09927 101.8201 $out [1] 108.53 $group [1] 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(45.29, 55.04, 70.425, 92.23, 96.59, 44.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/544601363129212.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,] -3.02 1.300 3.59 -7.49 -2.290 -3.43 -6.17 -14.65 -4.210 -0.59 -2.510 [2,] -1.81 3.470 5.17 -7.46 -2.280 -0.49 -6.17 -10.09 -4.210 -0.59 -2.510 [3,] 0.29 4.485 5.75 1.94 0.735 2.74 -1.95 -1.91 1.255 2.27 -2.075 [4,] 3.30 8.700 6.86 6.77 8.640 4.66 2.01 0.74 5.350 4.18 3.060 [5,] 6.98 10.890 8.08 14.40 11.200 4.96 7.26 4.92 5.680 10.89 5.780 [,12] [1,] 1.49 [2,] 1.49 [3,] 1.63 [4,] 2.05 [5,] 2.05 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3.006115 1.111481 4.659895 -7.23881 -6.308753 -0.5819163 -7.226364 [2,] 3.586115 7.858519 6.840105 11.11881 7.778753 6.0619163 3.326364 [,8] [,9] [,10] [,11] [,12] [1,] -8.8957 -4.911509 -0.8068041 -5.66783 1.234305 [2,] 5.0757 7.421509 5.3468041 1.51783 2.025695 $out [1] -19.74 -25.69 -20.25 -11.68 -7.46 4.82 $group [1] 7 9 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3.02, -1.81, 0.289999999999999, 3.3, 6.97999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/60oyq1363129212.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,] 59.440 55.040 43.800 44.010 74.310 103.570 NA [2,] 62.105 64.785 83.980 49.275 76.450 108.315 NA [3,] 63.880 70.870 102.105 67.010 77.915 110.735 NA [4,] 70.890 79.035 120.060 73.060 84.500 114.770 NA [5,] 74.410 92.600 135.810 77.430 91.770 122.540 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 59.8731 64.37048 85.64867 56.1615 74.24334 107.7908 NA [2,] 67.8869 77.36952 118.56133 77.8585 81.58666 113.6792 NA $out [1] 96.59 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(59.44, 62.105, 63.88, 70.89, 74.41, 55.04, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7ikgs1363129212.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,] 71.66667 68.0100 72.83250 [2,] 78.45083 72.1750 77.95750 [3,] 81.82667 75.5000 81.28375 [4,] 86.39167 77.9125 87.20750 [5,] 90.43000 82.9400 90.32000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 78.20480 72.88309 77.06476 [2,] 85.44853 78.11691 85.50274 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(71.6666666666667, 78.4508333333333, 81.8266666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16u5e1363129212.ps tmp/16u5e1363129212.png",intern=TRUE)) character(0) > try(system("convert tmp/2m73u1363129212.ps tmp/2m73u1363129212.png",intern=TRUE)) character(0) > try(system("convert tmp/3tpvt1363129212.ps tmp/3tpvt1363129212.png",intern=TRUE)) character(0) > try(system("convert tmp/4kmwg1363129212.ps tmp/4kmwg1363129212.png",intern=TRUE)) character(0) > try(system("convert tmp/544601363129212.ps tmp/544601363129212.png",intern=TRUE)) character(0) > try(system("convert tmp/60oyq1363129212.ps tmp/60oyq1363129212.png",intern=TRUE)) character(0) > try(system("convert tmp/7ikgs1363129212.ps tmp/7ikgs1363129212.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.567 0.531 4.088