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(82.81,83.42,83.45,83.71,84.8,85.95,86.22,86.75,87.06,87.17,87.63,87.78,88.4,89.35,89.53,90.66,90.81,91.55,91.58,91.76,91.78,91.71,91.57,91.95,92.16,92.26,92.44,93.12,93.55,93.63,93.74,94.08,94.24,94.66,94.69,94.69,94.69,94.72,95.15,95.28,96.12,96.5,96.67,96.83,97.4,97.75,97.46,97.46,97.56,97.97,98.89,99.1,99.3,100,99.73,99.34,99.78,99.5,99.6,99.52,99.63,99.61,99.73,100.53,100.87,100.9,101.08,102.95,102.58,102.6,102.45,102.41,102.38,102.65,103.33,103.68,104.13,104.3,104.11,104.17,104.23,104.47,104.86,104.9) > 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,] 82.81 88.40 92.16 94.69 97.56 99.63 102.38 NA [2,] 83.42 89.35 92.26 94.72 97.97 99.61 102.65 NA [3,] 83.45 89.53 92.44 95.15 98.89 99.73 103.33 NA [4,] 83.71 90.66 93.12 95.28 99.10 100.53 103.68 NA [5,] 84.80 90.81 93.55 96.12 99.30 100.87 104.13 NA [6,] 85.95 91.55 93.63 96.50 100.00 100.90 104.30 NA [7,] 86.22 91.58 93.74 96.67 99.73 101.08 104.11 NA [8,] 86.75 91.76 94.08 96.83 99.34 102.95 104.17 NA [9,] 87.06 91.78 94.24 97.40 99.78 102.58 104.23 NA [10,] 87.17 91.71 94.66 97.75 99.50 102.60 104.47 NA [11,] 87.63 91.57 94.69 97.46 99.60 102.45 104.86 NA [12,] 87.78 91.95 94.69 97.46 99.52 102.41 104.90 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.61 0.95 0.10 0.03 0.41 -0.02 0.27 NA [2,] 0.03 0.18 0.18 0.43 0.92 0.12 0.68 NA [3,] 0.26 1.13 0.68 0.13 0.21 0.80 0.35 NA [4,] 1.09 0.15 0.43 0.84 0.20 0.34 0.45 NA [5,] 1.15 0.74 0.08 0.38 0.70 0.03 0.17 NA [6,] 0.27 0.03 0.11 0.17 -0.27 0.18 -0.19 NA [7,] 0.53 0.18 0.34 0.16 -0.39 1.87 0.06 NA [8,] 0.31 0.02 0.16 0.57 0.44 -0.37 0.06 NA [9,] 0.11 -0.07 0.42 0.35 -0.28 0.02 0.24 NA [10,] 0.46 -0.14 0.03 -0.29 0.10 -0.15 0.39 NA [11,] 0.15 0.38 0.00 0.00 -0.08 -0.04 0.04 NA [12,] 0.62 0.21 0.00 0.10 0.11 -0.03 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/1ce221381746251.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/2xjp71381746251.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/3ueaz1381746251.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/41vzu1381746251.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] [1,] 82.810 83.420 83.450 83.710 84.800 85.95 86.220 86.750 87.06 [2,] 90.280 90.805 90.985 91.890 92.180 92.59 92.660 92.920 93.01 [3,] 94.690 94.720 95.150 95.280 96.120 96.50 96.670 96.830 97.40 [4,] 98.595 98.790 99.310 99.815 100.085 100.45 100.405 101.145 101.18 [5,] 102.380 102.650 103.330 103.680 104.130 104.30 104.110 104.170 104.23 [,10] [,11] [,12] [1,] 87.170 87.630 87.780 [2,] 93.185 93.130 93.320 [3,] 97.750 97.460 97.460 [4,] 101.050 101.025 100.965 [5,] 104.470 104.860 104.900 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.72442 89.95149 90.17844 90.54732 91.39926 91.80613 92.04481 [2,] 99.65558 99.48851 100.12156 100.01268 100.84074 101.19387 101.29519 [,8] [,9] [,10] [,11] [,12] [1,] 91.91816 92.52101 93.05315 92.74523 92.89453 [2,] 101.74184 102.27899 102.44685 102.17477 102.02547 $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(82.81, 90.28, 94.69, 98.595, 102.38, 83.42, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50d5x1381746251.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.020 0.030 0.130 0.150 0.030 -0.270 0.060 -0.370 -0.280 -0.290 -0.080 [2,] 0.065 0.150 0.235 0.270 0.125 -0.080 0.110 0.040 -0.025 -0.145 -0.020 [3,] 0.270 0.180 0.350 0.430 0.380 0.110 0.180 0.160 0.110 0.030 0.000 [4,] 0.510 0.555 0.740 0.645 0.720 0.175 0.435 0.375 0.295 0.245 0.095 [5,] 0.950 0.920 1.130 1.090 1.150 0.270 0.530 0.570 0.420 0.460 0.150 [,12] [1,] -0.030 [2,] 0.000 [3,] 0.105 [4,] 0.210 [5,] 0.210 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.004253179 -0.06185947 0.04842215 0.206056 0.0246756 -0.04228189 [2,] 0.535746821 0.42185947 0.65157785 0.653944 0.7353244 0.26228189 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.01408476 -0.0400566 -0.08109884 -0.2029017 -0.06867614 -0.03045678 [2,] 0.37408476 0.3600566 0.30109884 0.2629017 0.06867614 0.24045678 $out [1] -0.39 1.87 0.38 0.62 $group [1] 7 7 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.019999999999996, 0.0650000000000048, 0.27000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xjpc1381746251.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,] 82.810 88.400 92.160 94.690 98.890 99.610 102.380 NA [2,] 83.580 90.095 92.780 95.215 98.995 100.130 103.505 NA [3,] 86.085 91.560 93.685 96.585 99.420 100.990 104.150 NA [4,] 87.115 91.735 94.450 97.430 99.665 102.515 104.385 NA [5,] 87.780 91.950 94.690 97.750 100.000 102.950 104.900 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 84.47266 90.81198 92.9233 95.57472 99.11441 99.90219 103.7486 NA [2,] 87.69734 92.30802 94.4467 97.59528 99.72559 102.07781 104.5514 NA $out [1] 97.56 97.97 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(82.81, 83.58, 86.085, 87.115, 87.78, 88.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ysrk1381746251.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,] 93.94714 94.690 94.43750 [2,] 94.90000 95.215 95.50000 [3,] 96.14000 96.585 96.52625 [4,] 96.78071 97.430 97.08625 [5,] 96.95857 97.750 97.14250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 95.28219 95.57472 95.80275 [2,] 96.99781 97.59528 97.24975 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.9471428571429, 94.9, 96.14, 96.7807142857143, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ce221381746251.ps tmp/1ce221381746251.png",intern=TRUE)) character(0) > try(system("convert tmp/2xjp71381746251.ps tmp/2xjp71381746251.png",intern=TRUE)) character(0) > try(system("convert tmp/3ueaz1381746251.ps tmp/3ueaz1381746251.png",intern=TRUE)) character(0) > try(system("convert tmp/41vzu1381746251.ps tmp/41vzu1381746251.png",intern=TRUE)) character(0) > try(system("convert tmp/50d5x1381746251.ps tmp/50d5x1381746251.png",intern=TRUE)) character(0) > try(system("convert tmp/6xjpc1381746251.ps tmp/6xjpc1381746251.png",intern=TRUE)) character(0) > try(system("convert tmp/7ysrk1381746251.ps tmp/7ysrk1381746251.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.632 0.803 4.421