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(101.94,102.62,102.71,103.39,104.51,104.09,104.29,104.57,105.39,105.15,106.13,105.46,106.47,106.62,106.52,108.04,107.15,107.32,107.76,107.26,107.89,109.08,110.4,111.03,112.05,112.28,112.8,114.17,114.92,114.65,115.49,114.67,114.71,115.15,115.03,115.07,116.46,116.37,116.2,116.5,116.38,115.44,114.96,114.48,114.3,114.66,114.97,114.79,116.16,116.52,117.14,117.27,117.58,117.21,117.08,117.06,117.55,117.61,117.74,117.87,118.59,119.09,118.93,119.62,120.09,120.38,120.49,120.02,120.17,120.58,121.54,121.51,121.81,122.85,122.97,122.96,123.4,123.23,123.24,123.72,123.99,125.1,125.4,125.35,126.37,127.17,127.66,128.48,129.21,129.48,128.63,128.16,128.1,128.08,128.14,128.19) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 101.94 106.47 112.05 116.46 116.16 118.59 121.81 126.37 NA [2,] 102.62 106.62 112.28 116.37 116.52 119.09 122.85 127.17 NA [3,] 102.71 106.52 112.80 116.20 117.14 118.93 122.97 127.66 NA [4,] 103.39 108.04 114.17 116.50 117.27 119.62 122.96 128.48 NA [5,] 104.51 107.15 114.92 116.38 117.58 120.09 123.40 129.21 NA [6,] 104.09 107.32 114.65 115.44 117.21 120.38 123.23 129.48 NA [7,] 104.29 107.76 115.49 114.96 117.08 120.49 123.24 128.63 NA [8,] 104.57 107.26 114.67 114.48 117.06 120.02 123.72 128.16 NA [9,] 105.39 107.89 114.71 114.30 117.55 120.17 123.99 128.10 NA [10,] 105.15 109.08 115.15 114.66 117.61 120.58 125.10 128.08 NA [11,] 106.13 110.40 115.03 114.97 117.74 121.54 125.40 128.14 NA [12,] 105.46 111.03 115.07 114.79 117.87 121.51 125.35 128.19 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.68 0.15 0.23 -0.09 0.36 0.50 1.04 0.80 NA [2,] 0.09 -0.10 0.52 -0.17 0.62 -0.16 0.12 0.49 NA [3,] 0.68 1.52 1.37 0.30 0.13 0.69 -0.01 0.82 NA [4,] 1.12 -0.89 0.75 -0.12 0.31 0.47 0.44 0.73 NA [5,] -0.42 0.17 -0.27 -0.94 -0.37 0.29 -0.17 0.27 NA [6,] 0.20 0.44 0.84 -0.48 -0.13 0.11 0.01 -0.85 NA [7,] 0.28 -0.50 -0.82 -0.48 -0.02 -0.47 0.48 -0.47 NA [8,] 0.82 0.63 0.04 -0.18 0.49 0.15 0.27 -0.06 NA [9,] -0.24 1.19 0.44 0.36 0.06 0.41 1.11 -0.02 NA [10,] 0.98 1.32 -0.12 0.31 0.13 0.96 0.30 0.06 NA [11,] -0.67 0.63 0.04 -0.18 0.13 -0.03 -0.05 0.05 NA [12,] 1.01 1.02 1.39 1.37 0.72 0.30 1.02 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/1bc0o1425419779.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/29y5q1425419779.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/31xbj1425419779.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/4ixsr1425419779.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,] 101.94 102.620 102.71 103.390 104.510 104.090 104.290 104.570 105.390 [2,] 109.26 109.450 109.66 111.105 111.035 110.985 111.360 110.870 111.095 [3,] 116.31 116.445 116.67 116.885 116.980 116.325 116.285 115.865 116.130 [4,] 120.20 120.970 120.95 121.290 121.745 121.805 121.865 121.870 122.080 [5,] 126.37 127.170 127.66 128.480 129.210 129.480 128.630 128.160 128.100 [,10] [,11] [,12] [1,] 105.15 106.130 105.46 [2,] 111.87 112.685 112.91 [3,] 116.38 116.385 116.47 [4,] 122.84 123.470 123.43 [5,] 128.08 128.140 128.19 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 110.1988 110.0098 110.3632 111.1955 110.9972 110.2808 110.4168 109.7202 [2,] 122.4212 122.8802 122.9768 122.5745 122.9628 122.3692 122.1532 122.0098 [,9] [,10] [,11] [,12] [1,] 109.9936 110.252 110.3603 110.5934 [2,] 122.2664 122.508 122.4097 122.3466 $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(101.94, 109.26, 116.31, 120.2, 126.37, 102.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gg6o1425419779.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.09 -0.170 -0.010 -0.120 -0.940 -0.850 -0.82 -0.18 -0.240 -0.120 -0.180 [2,] 0.19 -0.130 0.215 0.095 -0.395 -0.305 -0.49 -0.01 0.020 0.095 -0.115 [3,] 0.43 0.105 0.685 0.455 -0.220 0.060 -0.47 0.21 0.385 0.305 0.005 [4,] 0.74 0.505 1.095 0.740 0.220 0.320 0.13 0.56 0.775 0.970 0.090 [5,] 1.04 0.620 1.520 1.120 0.290 0.840 0.48 0.82 1.190 1.320 0.130 [,12] [1,] 0.720 [2,] 0.865 [3,] 1.020 [4,] 1.195 [5,] 1.390 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.1227621 -0.2497201 0.1934194 0.09469374 -0.5635478 -0.289134 -0.8163409 [2,] 0.7372379 0.4597201 1.1765806 0.81530626 0.1235478 0.409134 -0.1236591 [,8] [,9] [,10] [,11] [,12] [1,] -0.1084102 -0.03675384 -0.1837876 -0.1095159 0.8229293 [2,] 0.5284102 0.80675384 0.7937876 0.1195159 1.2170707 $out [1] -0.89 -0.67 0.63 0.30 $group [1] 4 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0899999999999892, 0.190000000000005, 0.43, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rsh61425419779.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] [,9] [1,] 101.94 106.470 112.050 114.300 116.520 118.590 121.810 127.170 NA [2,] 103.05 106.885 113.485 114.725 117.070 119.355 122.965 127.870 NA [3,] 104.40 107.540 114.690 115.205 117.240 120.130 123.320 128.150 NA [4,] 105.27 108.560 115.050 116.375 117.595 120.535 124.545 128.555 NA [5,] 106.13 111.030 115.490 116.500 117.870 121.540 125.400 129.480 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.3874 106.776 113.9762 114.4524 117.0005 119.5918 122.5994 127.8376 [2,] 105.4126 108.304 115.4038 115.9576 117.4795 120.6682 124.0406 128.4624 [,9] [1,] NA [2,] NA $out [1] 116.16 126.37 $group [1] 5 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(101.94, 103.05, 104.4, 105.27, 106.13, 106.47, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7i6391425419779.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,] 114.9813 116.1300 115.0250 [2,] 115.9294 116.2975 116.0656 [3,] 116.4837 116.3825 116.9294 [4,] 116.7906 116.5700 117.3281 [5,] 117.4188 116.8850 118.1662 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 116.0909 116.2582 116.3535 [2,] 116.8766 116.5068 117.5052 $out [1] 116.980 115.865 $group [1] 2 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(114.98125, 115.929375, 116.48375, 116.790625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bc0o1425419779.ps tmp/1bc0o1425419779.png",intern=TRUE)) character(0) > try(system("convert tmp/29y5q1425419779.ps tmp/29y5q1425419779.png",intern=TRUE)) character(0) > try(system("convert tmp/31xbj1425419779.ps tmp/31xbj1425419779.png",intern=TRUE)) character(0) > try(system("convert tmp/4ixsr1425419779.ps tmp/4ixsr1425419779.png",intern=TRUE)) character(0) > try(system("convert tmp/5gg6o1425419779.ps tmp/5gg6o1425419779.png",intern=TRUE)) character(0) > try(system("convert tmp/6rsh61425419779.ps tmp/6rsh61425419779.png",intern=TRUE)) character(0) > try(system("convert tmp/7i6391425419779.ps tmp/7i6391425419779.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.582 0.462 3.066