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.64,100.93,101.41,102.07,102.42,102.53,102.43,102.6,102.65,102.74,102.82,103.2,102.75,103.09,103.71,104.3,104.58,104.71,104.44,104.57,104.95,105.49,106.03,106.48,106.25,106.7,107.6,108.05,108.72,109.17,109.08,109.04,109.34,109.37,108.96,108.77,108.11,108.67,109.05,109.43,109.62,109.85,109.34,109.65,109.69,109.91,110.09,110.44,109.9,110.25,111.26,111.74,111.91,111.95,111.63,111.85,112.16,112.49,112.66,113.39,112.92,113.44,114.68,115.38,115.48,115.41,114.92,115.16,115.89,116.25,116.43,116.83,116.17,116.78,117.98,118.53,118.43,118.29,117.85,118.27,119,119.33,119.17,119.57,118.62,119.09,120.19,120.17,120.29,120.35,119.88,120.04,120.52,120.43,120.34,120.75) > 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,] 100.64 102.75 106.25 108.11 109.90 112.92 116.17 118.62 NA [2,] 100.93 103.09 106.70 108.67 110.25 113.44 116.78 119.09 NA [3,] 101.41 103.71 107.60 109.05 111.26 114.68 117.98 120.19 NA [4,] 102.07 104.30 108.05 109.43 111.74 115.38 118.53 120.17 NA [5,] 102.42 104.58 108.72 109.62 111.91 115.48 118.43 120.29 NA [6,] 102.53 104.71 109.17 109.85 111.95 115.41 118.29 120.35 NA [7,] 102.43 104.44 109.08 109.34 111.63 114.92 117.85 119.88 NA [8,] 102.60 104.57 109.04 109.65 111.85 115.16 118.27 120.04 NA [9,] 102.65 104.95 109.34 109.69 112.16 115.89 119.00 120.52 NA [10,] 102.74 105.49 109.37 109.91 112.49 116.25 119.33 120.43 NA [11,] 102.82 106.03 108.96 110.09 112.66 116.43 119.17 120.34 NA [12,] 103.20 106.48 108.77 110.44 113.39 116.83 119.57 120.75 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.29 0.34 0.45 0.56 0.35 0.52 0.61 0.47 NA [2,] 0.48 0.62 0.90 0.38 1.01 1.24 1.20 1.10 NA [3,] 0.66 0.59 0.45 0.38 0.48 0.70 0.55 -0.02 NA [4,] 0.35 0.28 0.67 0.19 0.17 0.10 -0.10 0.12 NA [5,] 0.11 0.13 0.45 0.23 0.04 -0.07 -0.14 0.06 NA [6,] -0.10 -0.27 -0.09 -0.51 -0.32 -0.49 -0.44 -0.47 NA [7,] 0.17 0.13 -0.04 0.31 0.22 0.24 0.42 0.16 NA [8,] 0.05 0.38 0.30 0.04 0.31 0.73 0.73 0.48 NA [9,] 0.09 0.54 0.03 0.22 0.33 0.36 0.33 -0.09 NA [10,] 0.08 0.54 -0.41 0.18 0.17 0.18 -0.16 -0.09 NA [11,] 0.38 0.45 -0.19 0.35 0.73 0.40 0.40 0.41 NA [12,] -0.45 -0.23 -0.66 -0.54 -0.47 -0.66 -0.95 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/1dhom1424984393.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/2fis91424984393.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/3lk7w1424984393.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/4ttjj1424984393.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.640 100.930 101.410 102.070 102.420 102.53 102.430 102.600 102.650 [2,] 104.500 104.895 105.655 106.175 106.650 106.94 106.760 106.805 107.145 [3,] 109.005 109.460 110.155 110.585 110.765 110.90 110.485 110.750 110.925 [4,] 114.545 115.110 116.330 116.955 116.955 116.85 116.385 116.715 117.445 [5,] 118.620 119.090 120.190 120.170 120.290 120.35 119.880 120.040 120.520 [,10] [,11] [,12] [1,] 102.74 102.820 103.200 [2,] 107.43 107.495 107.625 [3,] 111.20 111.375 111.915 [4,] 117.79 117.800 118.200 [5,] 120.43 120.340 120.750 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.3937 103.7538 104.1918 104.5631 105.0085 105.3641 105.1083 105.2141 [2,] 114.6163 115.1662 116.1182 116.6069 116.5215 116.4359 115.8617 116.2859 [,9] [,10] [,11] [,12] [1,] 105.1713 105.4128 105.6185 106.0077 [2,] 116.6787 116.9872 117.1315 117.8223 $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(100.64, 104.5, 109.005, 114.545, 118.62, 100.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hgcf1424984393.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.290 0.380 0.380 -0.100 -0.140 -0.510 -0.040 0.040 -0.090 -0.410 0.350 [2,] 0.345 0.550 0.415 0.110 -0.015 -0.480 0.145 0.175 0.060 -0.125 0.365 [3,] 0.460 0.955 0.515 0.180 0.085 -0.380 0.195 0.345 0.275 0.125 0.400 [4,] 0.540 1.150 0.625 0.315 0.180 -0.185 0.275 0.605 0.345 0.180 0.430 [5,] 0.610 1.240 0.700 0.350 0.450 -0.090 0.420 0.730 0.540 0.540 0.450 [,12] [1,] -0.95 [2,] -0.66 [3,] -0.54 [4,] -0.46 [5,] -0.23 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3510702 0.6198314 0.397691 0.06548406 -0.0239298 -0.5447912 0.1223801 [2,] 0.5689298 1.2901686 0.632309 0.29451594 0.1939298 -0.2152088 0.2676199 [,8] [,9] [,10] [,11] [,12] [1,] 0.1047958 0.1157949 -0.04537738 0.3636901 -0.6594368 [2,] 0.5852042 0.4342051 0.29537738 0.4363099 -0.4205632 $out [1] -0.02 0.67 -0.19 0.73 $group [1] 3 4 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.290000000000006, 0.344999999999999, 0.460000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6w56z1424984393.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,] 100.640 102.750 106.250 108.670 110.250 112.920 116.170 119.88 NA [2,] 101.740 104.005 107.825 109.195 111.445 114.800 117.915 119.96 NA [3,] 102.480 104.575 108.865 109.635 111.880 115.395 118.360 120.24 NA [4,] 102.695 105.220 109.125 109.880 112.325 116.070 119.085 120.39 NA [5,] 103.200 106.480 109.370 110.440 113.390 116.830 119.570 120.75 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.0444 104.0208 108.2721 109.3226 111.4786 114.8157 117.8264 120.0439 [2,] 102.9156 105.1292 109.4579 109.9474 112.2814 115.9743 118.8936 120.4361 [,9] [1,] NA [2,] NA $out [1] 108.11 109.90 118.62 119.09 $group [1] 4 5 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(100.64, 101.74, 102.48, 102.695, 103.2, 102.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7r8dh1424984393.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,] 109.8688 109.4600 109.5538 [2,] 110.9656 110.3200 111.3531 [3,] 111.4144 110.7575 111.9406 [4,] 111.8881 111.0625 112.5631 [5,] 112.4287 111.9150 112.8563 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 110.9936 110.4188 111.3887 [2,] 111.8351 111.0962 112.4925 $out [1] 109.420 109.005 $group [1] 1 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(109.86875, 110.965625, 111.414375, 111.888125, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1dhom1424984393.ps tmp/1dhom1424984393.png",intern=TRUE)) character(0) > try(system("convert tmp/2fis91424984393.ps tmp/2fis91424984393.png",intern=TRUE)) character(0) > try(system("convert tmp/3lk7w1424984393.ps tmp/3lk7w1424984393.png",intern=TRUE)) character(0) > try(system("convert tmp/4ttjj1424984393.ps tmp/4ttjj1424984393.png",intern=TRUE)) character(0) > try(system("convert tmp/5hgcf1424984393.ps tmp/5hgcf1424984393.png",intern=TRUE)) character(0) > try(system("convert tmp/6w56z1424984393.ps tmp/6w56z1424984393.png",intern=TRUE)) character(0) > try(system("convert tmp/7r8dh1424984393.ps tmp/7r8dh1424984393.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.549 0.442 3.022