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(106.68,109.73,108.06,111.33,105.66,103.65,100.34,100.56,102.67,101.5,102.35,104.98,106.31,103.73,106.62,108.54,105.12,105.29,104.62,104.34,108.23,107.6,106.87,107.96,108.34,109.04,106.95,105.59,108.08,108.48,106.84,105.6,106.9,106.84,106.81,106.98,107.53,107.37,106.98,108.94,106.38,109.02,106.53,105.02,109.7,108.39,110.18,109.54,109.1,110.85,112.23,110.58,110.77,108.08,108.05,108.87,109.61,111.27,107.61,110.98,106.63,106.83,108.77,106.12,106.8,106.34,105.16,107.97,106.76,108.78,105.58,109.22,105.67,109.04,106.59,109.66,108.05,109.91,107.63,107.15,103.8,103.43,103.59,107.63) > 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,] 106.68 106.31 108.34 107.53 109.10 106.63 105.67 NA [2,] 109.73 103.73 109.04 107.37 110.85 106.83 109.04 NA [3,] 108.06 106.62 106.95 106.98 112.23 108.77 106.59 NA [4,] 111.33 108.54 105.59 108.94 110.58 106.12 109.66 NA [5,] 105.66 105.12 108.08 106.38 110.77 106.80 108.05 NA [6,] 103.65 105.29 108.48 109.02 108.08 106.34 109.91 NA [7,] 100.34 104.62 106.84 106.53 108.05 105.16 107.63 NA [8,] 100.56 104.34 105.60 105.02 108.87 107.97 107.15 NA [9,] 102.67 108.23 106.90 109.70 109.61 106.76 103.80 NA [10,] 101.50 107.60 106.84 108.39 111.27 108.78 103.43 NA [11,] 102.35 106.87 106.81 110.18 107.61 105.58 103.59 NA [12,] 104.98 107.96 106.98 109.54 110.98 109.22 107.63 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3.05 -2.58 0.70 -0.16 1.75 0.20 3.37 NA [2,] -1.67 2.89 -2.09 -0.39 1.38 1.94 -2.45 NA [3,] 3.27 1.92 -1.36 1.96 -1.65 -2.65 3.07 NA [4,] -5.67 -3.42 2.49 -2.56 0.19 0.68 -1.61 NA [5,] -2.01 0.17 0.40 2.64 -2.69 -0.46 1.86 NA [6,] -3.31 -0.67 -1.64 -2.49 -0.03 -1.18 -2.28 NA [7,] 0.22 -0.28 -1.24 -1.51 0.82 2.81 -0.48 NA [8,] 2.11 3.89 1.30 4.68 0.74 -1.21 -3.35 NA [9,] -1.17 -0.63 -0.06 -1.31 1.66 2.02 -0.37 NA [10,] 0.85 -0.73 -0.03 1.79 -3.66 -3.20 0.16 NA [11,] 2.63 1.09 0.17 -0.64 3.37 3.64 4.04 NA [12,] 1.33 0.38 0.55 -0.44 -4.35 -3.55 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/1wnvx1381738302.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/29vhd1381738302.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/3tlsx1381738302.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/42om51381738302.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,] 105.670 103.730 106.590 105.59 105.120 103.650 104.620 100.56 102.67 [2,] 106.470 107.100 106.785 107.33 106.020 105.815 104.890 104.68 105.28 [3,] 106.680 109.040 106.980 108.94 106.800 108.080 106.530 105.60 106.90 [4,] 107.935 109.385 108.415 110.12 108.065 108.750 107.235 107.56 108.92 [5,] 109.100 110.850 108.770 111.33 110.770 109.910 108.050 108.87 109.70 [,10] [,11] [,12] [1,] 101.500 102.350 104.980 [2,] 105.135 104.585 107.305 [3,] 107.600 106.810 107.960 [4,] 108.585 107.240 109.380 [5,] 111.270 110.180 110.980 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.8051 107.6754 106.0066 107.2739 105.5788 106.3273 105.1296 103.8801 [2,] 107.5549 110.4046 107.9534 110.6061 108.0212 109.8327 107.9304 107.3199 [,9] [,10] [,11] [,12] [1,] 104.7263 105.5397 105.2245 106.7208 [2,] 109.0737 109.6603 108.3955 109.1992 $out [1] 112.23 100.34 $group [1] 3 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(105.67, 106.47, 106.68, 107.935, 109.1, 103.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5jz2v1381738302.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,] -2.58 -2.45 -2.650 -5.670 -2.690 -3.310 -1.51 -3.350 -1.31 -3.660 -0.640 [2,] 0.02 -1.88 -1.505 -2.990 -1.235 -2.385 -0.86 -0.235 -0.90 -1.965 0.630 [3,] 0.70 -0.39 1.920 -1.610 0.170 -1.640 -0.28 1.300 -0.37 -0.030 2.630 [4,] 2.40 1.66 2.515 0.435 1.130 -0.925 0.52 3.000 0.80 0.505 3.505 [5,] 3.37 2.89 3.270 2.490 2.640 -0.030 0.82 4.680 2.02 1.790 4.040 [,12] [1,] -4.35 [2,] -3.55 [3,] -0.03 [4,] 0.55 [5,] 1.33 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.7212976 -2.504031 -0.4806791 -3.6553547 -1.24234 -2.5118884 -1.1041137 [2,] 2.1212976 1.724031 4.3206791 0.4353547 1.58234 -0.7681116 0.5441137 [,8] [,9] [,10] [,11] [,12] [1,] -0.6318898 -1.3852126 -1.505044 0.9130964 -2.674632 [2,] 3.2318898 0.6452126 1.445044 4.3469036 2.614632 $out [1] 2.81 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.58, 0.0200000000000031, 0.700000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qtpd1381738302.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,] 100.340 103.730 105.590 105.020 107.610 105.16 103.430 NA [2,] 101.925 104.870 106.825 106.755 108.475 106.23 104.735 NA [3,] 104.315 106.465 106.925 107.960 110.095 106.78 107.390 NA [4,] 107.370 107.780 108.210 109.280 110.915 108.37 108.545 NA [5,] 111.330 108.540 109.040 110.180 112.230 109.22 109.910 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.8315 105.1377 106.2933 106.8083 108.9821 105.8039 105.6522 NA [2,] 106.7985 107.7923 107.5567 109.1117 111.2079 107.7561 109.1278 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(100.34, 101.925, 104.315, 107.37, 111.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73s7j1381738302.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,] 105.5957 105.60 105.9125 [2,] 106.4757 106.74 106.4900 [3,] 107.2164 106.94 107.1513 [4,] 108.0564 108.02 107.9213 [5,] 108.6800 109.04 108.7250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 106.4955 106.3562 106.4984 [2,] 107.9374 107.5238 107.8041 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(105.595714285714, 106.475714285714, 107.216428571429, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wnvx1381738302.ps tmp/1wnvx1381738302.png",intern=TRUE)) character(0) > try(system("convert tmp/29vhd1381738302.ps tmp/29vhd1381738302.png",intern=TRUE)) character(0) > try(system("convert tmp/3tlsx1381738302.ps tmp/3tlsx1381738302.png",intern=TRUE)) character(0) > try(system("convert tmp/42om51381738302.ps tmp/42om51381738302.png",intern=TRUE)) character(0) > try(system("convert tmp/5jz2v1381738302.ps tmp/5jz2v1381738302.png",intern=TRUE)) character(0) > try(system("convert tmp/6qtpd1381738302.ps tmp/6qtpd1381738302.png",intern=TRUE)) character(0) > try(system("convert tmp/73s7j1381738302.ps tmp/73s7j1381738302.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.071 1.072 6.115