R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(100.05,100.05,100.05,100.05,100.05,108.77,111.32,111.6,108.52,103.13,102.87,102.75,102.75,102.75,102.75,102.75,102.75,115.22,115.53,115.4,111.99,107.93,107.43,106.98,106.98,106.98,106.98,106.98,106.98,113.71,118.77,118.54,116.16,110.52,110.06,109.9,109.9,110.72,110.09,110.07,112.45,113.06,119.83,119.84,113.73,110.5,110.12,109.86,110.36,110.36,110.59,112.52,112.1,115.9,122.96,121.26,114.55,111.57,110.65,109.77,112.38,112.35,112.2,114.46,116.26,119.57,127.77,126.59,120.45,116.38,116.3,115.05,115.05,115.22,115.19,116.07,120.42,121.88,130.74,130.74,124.64,120.5,120.1,119.62) > 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,] 100.05 102.75 106.98 109.90 110.36 112.38 115.05 NA [2,] 100.05 102.75 106.98 110.72 110.36 112.35 115.22 NA [3,] 100.05 102.75 106.98 110.09 110.59 112.20 115.19 NA [4,] 100.05 102.75 106.98 110.07 112.52 114.46 116.07 NA [5,] 100.05 102.75 106.98 112.45 112.10 116.26 120.42 NA [6,] 108.77 115.22 113.71 113.06 115.90 119.57 121.88 NA [7,] 111.32 115.53 118.77 119.83 122.96 127.77 130.74 NA [8,] 111.60 115.40 118.54 119.84 121.26 126.59 130.74 NA [9,] 108.52 111.99 116.16 113.73 114.55 120.45 124.64 NA [10,] 103.13 107.93 110.52 110.50 111.57 116.38 120.50 NA [11,] 102.87 107.43 110.06 110.12 110.65 116.30 120.10 NA [12,] 102.75 106.98 109.90 109.86 109.77 115.05 119.62 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.00 0.00 0.00 0.82 0.00 -0.03 0.17 NA [2,] 0.00 0.00 0.00 -0.63 0.23 -0.15 -0.03 NA [3,] 0.00 0.00 0.00 -0.02 1.93 2.26 0.88 NA [4,] 0.00 0.00 0.00 2.38 -0.42 1.80 4.35 NA [5,] 8.72 12.47 6.73 0.61 3.80 3.31 1.46 NA [6,] 2.55 0.31 5.06 6.77 7.06 8.20 8.86 NA [7,] 0.28 -0.13 -0.23 0.01 -1.70 -1.18 0.00 NA [8,] -3.08 -3.41 -2.38 -6.11 -6.71 -6.14 -6.10 NA [9,] -5.39 -4.06 -5.64 -3.23 -2.98 -4.07 -4.14 NA [10,] -0.26 -0.50 -0.46 -0.38 -0.92 -0.08 -0.40 NA [11,] -0.12 -0.45 -0.16 -0.26 -0.88 -1.25 -0.48 NA [12,] 0.00 0.00 0.00 0.50 2.61 0.00 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/1ovnl1424979638.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/2wkc31424979638.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/3ah1o1424979638.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/41g5p1424979638.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,] 100.050 100.050 100.050 100.050 100.050 108.770 111.320 111.600 108.520 [2,] 104.865 104.865 104.865 104.865 104.865 113.385 117.150 116.970 112.860 [3,] 109.900 110.360 110.090 110.070 112.100 115.220 119.830 119.840 114.550 [4,] 111.370 111.535 111.395 113.490 114.355 117.735 125.365 123.925 118.305 [5,] 115.050 115.220 115.190 116.070 120.420 121.880 130.740 130.740 124.640 [,10] [,11] [,12] [1,] 103.130 102.870 102.750 [2,] 109.215 108.745 108.375 [3,] 110.520 110.120 109.860 [4,] 113.975 113.475 112.475 [5,] 120.500 120.100 115.050 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 106.0153 106.3768 106.1904 104.9193 106.4327 112.6223 114.9241 115.6866 [2,] 113.7847 114.3432 113.9896 115.2207 117.7673 117.8177 124.7359 123.9934 [,9] [,10] [,11] [,12] [1,] 111.2983 107.6774 107.2953 107.4115 [2,] 117.8017 113.3626 112.9447 112.3085 $out [1] 119.62 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(100.05, 104.865, 109.9, 111.37, 115.05, 100.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/587us1424979638.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.030 -0.15 -0.020 -0.42 0.610 0.310 -1.700 -6.710 -5.640 -0.50 -1.25 [2,] 0.000 -0.09 0.000 0.00 2.385 3.805 -0.705 -6.125 -4.765 -0.48 -0.68 [3,] 0.000 0.00 0.000 0.00 3.800 6.770 -0.130 -6.100 -4.070 -0.40 -0.45 [4,] 0.085 0.00 1.405 2.09 7.725 7.630 0.005 -3.245 -3.645 -0.32 -0.21 [5,] 0.170 0.00 2.260 4.35 12.470 8.860 0.280 -2.380 -2.980 -0.08 -0.12 [,12] [1,] 0.0 [2,] 0.0 [3,] 0.0 [4,] 0.5 [5,] 0.5 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.05076063 -0.05374655 -0.8390433 -1.248114 0.6110381 4.485772 -0.5540005 [2,] 0.05076063 0.05374655 0.8390433 1.248114 6.9889619 9.054228 0.2940005 [,8] [,9] [,10] [,11] [,12] [1,] -7.81989 -4.738846 -0.4955494 -0.7306764 -0.3225161 [2,] -4.38011 -3.401154 -0.3044506 -0.1693236 0.3225161 $out [1] 0.82 -0.63 0.23 -0.92 2.61 $group [1] 1 2 2 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0300000000000011, 0, 0, 0.0850000000000009, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6a8do1424979638.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.050 102.750 106.980 109.860 109.770 112.20 115.050 NA [2,] 100.050 102.750 106.980 110.080 110.475 113.42 115.645 NA [3,] 102.810 107.205 109.980 110.610 111.835 116.28 120.260 NA [4,] 108.645 113.605 114.935 113.395 115.225 120.01 123.260 NA [5,] 111.600 115.530 118.770 113.730 121.260 127.77 130.740 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.88976 102.254 106.3517 109.098 109.6685 113.2743 116.7867 NA [2,] 106.73024 112.156 113.6083 112.122 114.0015 119.2857 123.7333 NA $out [1] 119.83 119.84 122.96 $group [1] 4 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(100.05, 100.05, 102.81, 108.645, 111.6, 102.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7c2pa1424979638.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,] 108.2100 109.860 108.1175 [2,] 108.6664 110.080 108.6887 [3,] 110.8186 110.440 110.7675 [4,] 115.5821 114.885 115.5713 [5,] 120.9886 119.840 121.2575 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 107.6643 108.2484 107.6283 [2,] 113.9729 112.6316 113.9067 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(108.21, 108.666428571429, 110.818571428571, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ovnl1424979638.ps tmp/1ovnl1424979638.png",intern=TRUE)) character(0) > try(system("convert tmp/2wkc31424979638.ps tmp/2wkc31424979638.png",intern=TRUE)) character(0) > try(system("convert tmp/3ah1o1424979638.ps tmp/3ah1o1424979638.png",intern=TRUE)) character(0) > try(system("convert tmp/41g5p1424979638.ps tmp/41g5p1424979638.png",intern=TRUE)) character(0) > try(system("convert tmp/587us1424979638.ps tmp/587us1424979638.png",intern=TRUE)) character(0) > try(system("convert tmp/6a8do1424979638.ps tmp/6a8do1424979638.png",intern=TRUE)) character(0) > try(system("convert tmp/7c2pa1424979638.ps tmp/7c2pa1424979638.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.592 0.516 3.132