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(26.73,26.85,27.01,27.09,27.11,27.16,27.13,27.19,27.49,27.63,27.72,27.77,27.81,27.92,28.07,28.14,28.17,28.20,28.21,28.20,28.19,28.24,28.25,28.26,28.33,28.67,28.81,28.99,29.16,29.25,29.25,29.38,29.48,29.65,29.69,29.73,29.81,30.05,30.29,30.37,30.50,30.67,30.76,30.84,30.86,31.09,31.20,31.19,31.18,31.31,31.39,31.39,31.37,31.36,31.37,31.35,31.34,31.47,31.48,31.54,31.55,31.55,31.57,31.66,31.74,31.78,31.80,31.68,31.70,31.70,31.75,31.73,31.82,31.90,31.82,31.51,31.42,30.97,30.99,30.92,30.95,30.82,30.72,30.73) > 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,] 26.73 27.81 28.33 29.81 31.18 31.55 31.82 NA [2,] 26.85 27.92 28.67 30.05 31.31 31.55 31.90 NA [3,] 27.01 28.07 28.81 30.29 31.39 31.57 31.82 NA [4,] 27.09 28.14 28.99 30.37 31.39 31.66 31.51 NA [5,] 27.11 28.17 29.16 30.50 31.37 31.74 31.42 NA [6,] 27.16 28.20 29.25 30.67 31.36 31.78 30.97 NA [7,] 27.13 28.21 29.25 30.76 31.37 31.80 30.99 NA [8,] 27.19 28.20 29.38 30.84 31.35 31.68 30.92 NA [9,] 27.49 28.19 29.48 30.86 31.34 31.70 30.95 NA [10,] 27.63 28.24 29.65 31.09 31.47 31.70 30.82 NA [11,] 27.72 28.25 29.69 31.20 31.48 31.75 30.72 NA [12,] 27.77 28.26 29.73 31.19 31.54 31.73 30.73 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.12 0.11 0.34 0.24 0.13 0.00 0.08 NA [2,] 0.16 0.15 0.14 0.24 0.08 0.02 -0.08 NA [3,] 0.08 0.07 0.18 0.08 0.00 0.09 -0.31 NA [4,] 0.02 0.03 0.17 0.13 -0.02 0.08 -0.09 NA [5,] 0.05 0.03 0.09 0.17 -0.01 0.04 -0.45 NA [6,] -0.03 0.01 0.00 0.09 0.01 0.02 0.02 NA [7,] 0.06 -0.01 0.13 0.08 -0.02 -0.12 -0.07 NA [8,] 0.30 -0.01 0.10 0.02 -0.01 0.02 0.03 NA [9,] 0.14 0.05 0.17 0.23 0.13 0.00 -0.13 NA [10,] 0.09 0.01 0.04 0.11 0.01 0.05 -0.10 NA [11,] 0.05 0.01 0.04 -0.01 0.06 -0.02 0.01 NA [12,] 0.04 0.07 0.08 -0.01 0.01 0.09 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/13f8y1382204728.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/2gzc91382204728.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/333g91382204728.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/4v2m01382204728.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] [,11] [1,] 26.730 26.850 27.01 27.090 27.110 27.160 27.13 27.190 27.490 27.630 27.72 [2,] 28.070 28.295 28.44 28.565 28.665 28.725 28.73 28.790 28.835 28.945 28.97 [3,] 29.810 30.050 30.29 30.370 30.500 30.670 30.76 30.840 30.860 30.820 30.72 [4,] 31.365 31.430 31.48 31.450 31.395 31.165 31.18 31.135 31.145 31.280 31.34 [5,] 31.820 31.900 31.82 31.660 31.740 31.780 31.80 31.680 31.700 31.700 31.75 [,12] [1,] 27.770 [2,] 28.995 [3,] 30.730 [4,] 31.365 [5,] 31.730 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 27.84228 28.17783 28.47456 28.64712 28.86969 29.21287 29.2969 29.4396 [2,] 31.77772 31.92217 32.10544 32.09288 32.13031 32.12713 32.2231 32.2404 [,9] [,10] [,11] [,12] [1,] 29.48051 29.42558 29.30467 29.31467 [2,] 32.23949 32.21442 32.13533 32.14533 $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(26.73, 28.07, 29.81, 31.365, 31.82, 26.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/56cbp1382204728.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] [1,] 0.000 -0.080 0.000 -0.090 -0.01 0.000 -0.120 -0.010 -0.130 0.01 [2,] 0.095 0.050 0.035 0.000 0.01 0.005 -0.045 0.005 0.025 0.01 [3,] 0.120 0.140 0.080 0.030 0.04 0.010 -0.010 0.020 0.130 0.04 [4,] 0.185 0.155 0.085 0.105 0.07 0.020 0.070 0.065 0.155 0.07 [5,] 0.240 0.240 0.090 0.170 0.09 0.020 0.130 0.100 0.230 0.11 [,11] [,12] [1,] -2.000000e-02 -0.010 [2,] 1.776357e-15 0.010 [3,] 1.000000e-02 0.055 [4,] 4.500000e-02 0.080 [5,] 6.000000e-02 0.090 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.06625345 0.07729569 0.05014081 -0.03270431 0.004168968 0.001042242 [2,] 0.17374655 0.20270431 0.10985919 0.09270431 0.075831032 0.018957758 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.07867614 -0.01583103 0.0523661 0.004168968 -0.01687327 0.009847739 [2,] 0.05867614 0.05583103 0.2076339 0.075831032 0.03687327 0.100152261 $out [1] 0.34 0.18 -0.31 0.17 -0.45 -0.03 0.09 0.30 -0.10 $group [1] 1 3 3 5 5 6 6 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0.0950000000000006, 0.120000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/61osm1382204728.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,] 26.730 28.070 28.330 29.810 31.310 31.550 30.720 NA [2,] 27.050 28.105 28.900 30.330 31.345 31.615 30.870 NA [3,] 27.145 28.195 29.250 30.715 31.370 31.700 30.980 NA [4,] 27.560 28.225 29.565 30.975 31.430 31.745 31.665 NA [5,] 27.770 28.260 29.730 31.200 31.540 31.800 31.900 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 26.91239 28.14027 28.94669 30.42081 31.33123 31.64071 30.6174 NA [2,] 27.37761 28.24973 29.55331 31.00919 31.40877 31.75929 31.3426 NA $out [1] 27.81 27.92 31.18 $group [1] 2 2 5 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(26.73, 27.05, 27.145, 27.56, 27.77, 28.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/71r5m1382204728.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,] 29.60429 29.810 29.86250 [2,] 29.86500 30.330 29.95000 [3,] 29.92714 30.695 29.97625 [4,] 30.04357 30.790 30.07125 [5,] 30.13571 30.860 30.18000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 29.84570 30.48519 29.92095 [2,] 30.00859 30.90481 30.03155 $out [1] 29.7175 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(29.6042857142857, 29.865, 29.9271428571429, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13f8y1382204728.ps tmp/13f8y1382204728.png",intern=TRUE)) character(0) > try(system("convert tmp/2gzc91382204728.ps tmp/2gzc91382204728.png",intern=TRUE)) character(0) > try(system("convert tmp/333g91382204728.ps tmp/333g91382204728.png",intern=TRUE)) character(0) > try(system("convert tmp/4v2m01382204728.ps tmp/4v2m01382204728.png",intern=TRUE)) character(0) > try(system("convert tmp/56cbp1382204728.ps tmp/56cbp1382204728.png",intern=TRUE)) character(0) > try(system("convert tmp/61osm1382204728.ps tmp/61osm1382204728.png",intern=TRUE)) character(0) > try(system("convert tmp/71r5m1382204728.ps tmp/71r5m1382204728.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.113 0.553 3.659