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(98.68,99.06,99.84,100.3,100.38,100.02,99.83,100.36,100.74,100.49,100.33,99.96,100.08,100.54,101.63,102.12,102.19,101.77,101.29,101.47,102.07,102.11,102.26,101.83,102.11,102.8,103.82,104.2,104.57,104.38,104.54,104.74,105.19,104.95,104.57,103.81,104.08,104.81,105.86,106.1,106.24,105.87,104.74,105.03,105.59,105.69,105.58,104.96,104.93,105.68,106.93,107.29,107.25,106.74,106.44,106.6,107.26,107.35,107.22,106.99,106.87,107.68,108.9,109.48,109.57,109.03,109.58,109.76,110.15,110.2,109.86,109.58,109.52,110.35,111.61,112.06,111.9,111.36,112.09,112.24,112.7,113.36,112.9,112.74,112.77,113.66,114.87,114.97,115,114.57,115.54,115.39,115.46,115.13,114.56,114.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] 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,] 98.68 100.08 102.11 104.08 104.93 106.87 109.52 112.77 NA [2,] 99.06 100.54 102.80 104.81 105.68 107.68 110.35 113.66 NA [3,] 99.84 101.63 103.82 105.86 106.93 108.90 111.61 114.87 NA [4,] 100.30 102.12 104.20 106.10 107.29 109.48 112.06 114.97 NA [5,] 100.38 102.19 104.57 106.24 107.25 109.57 111.90 115.00 NA [6,] 100.02 101.77 104.38 105.87 106.74 109.03 111.36 114.57 NA [7,] 99.83 101.29 104.54 104.74 106.44 109.58 112.09 115.54 NA [8,] 100.36 101.47 104.74 105.03 106.60 109.76 112.24 115.39 NA [9,] 100.74 102.07 105.19 105.59 107.26 110.15 112.70 115.46 NA [10,] 100.49 102.11 104.95 105.69 107.35 110.20 113.36 115.13 NA [11,] 100.33 102.26 104.57 105.58 107.22 109.86 112.90 114.56 NA [12,] 99.96 101.83 103.81 104.96 106.99 109.58 112.74 114.62 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.38 0.46 0.69 0.73 0.75 0.81 0.83 0.89 NA [2,] 0.78 1.09 1.02 1.05 1.25 1.22 1.26 1.21 NA [3,] 0.46 0.49 0.38 0.24 0.36 0.58 0.45 0.10 NA [4,] 0.08 0.07 0.37 0.14 -0.04 0.09 -0.16 0.03 NA [5,] -0.36 -0.42 -0.19 -0.37 -0.51 -0.54 -0.54 -0.43 NA [6,] -0.19 -0.48 0.16 -1.13 -0.30 0.55 0.73 0.97 NA [7,] 0.53 0.18 0.20 0.29 0.16 0.18 0.15 -0.15 NA [8,] 0.38 0.60 0.45 0.56 0.66 0.39 0.46 0.07 NA [9,] -0.25 0.04 -0.24 0.10 0.09 0.05 0.66 -0.33 NA [10,] -0.16 0.15 -0.38 -0.11 -0.13 -0.34 -0.46 -0.57 NA [11,] -0.37 -0.43 -0.76 -0.62 -0.23 -0.28 -0.16 0.06 NA [12,] 0.12 0.28 0.27 -0.03 -0.12 -0.06 0.03 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/1uw651432123079.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/2m3or1432123079.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/3onae1432123079.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/4u6st1432123079.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,] 98.680 99.060 99.840 100.300 100.380 100.020 99.830 100.360 100.740 [2,] 101.095 101.670 102.725 103.160 103.380 103.075 102.915 103.105 103.630 [3,] 104.505 105.245 106.395 106.695 106.745 106.305 105.590 105.815 106.425 [4,] 108.195 109.015 110.255 110.770 110.735 110.195 110.835 111.000 111.425 [5,] 112.770 113.660 114.870 114.970 115.000 114.570 115.540 115.390 115.460 [,10] [,11] [,12] [1,] 100.49 100.330 99.960 [2,] 103.53 103.415 102.820 [3,] 106.52 106.400 105.975 [4,] 111.78 111.380 111.160 [5,] 115.13 114.560 114.620 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.5388 101.142 102.1886 102.4439 102.6364 102.3277 101.1658 101.4047 [2,] 108.4712 109.348 110.6014 110.9461 110.8536 110.2823 110.0142 110.2253 [,9] [,10] [,11] [,12] [1,] 102.0706 101.9114 101.9506 101.3162 [2,] 110.7794 111.1286 110.8494 110.6338 $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(98.68, 101.095, 104.505, 108.195, 112.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tj2u1432123079.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.380 0.780 0.100 -0.160 -0.540 -1.130 0.150 0.380 -0.330 -0.57 -0.760 [2,] 0.575 1.035 0.300 -0.005 -0.525 -0.390 0.155 0.385 -0.245 -0.42 -0.525 [3,] 0.740 1.150 0.415 0.075 -0.425 -0.015 0.180 0.455 0.045 -0.25 -0.325 [4,] 0.820 1.235 0.475 0.115 -0.365 0.640 0.245 0.580 0.095 -0.12 -0.195 [5,] 0.890 1.260 0.580 0.140 -0.190 0.970 0.290 0.660 0.100 0.15 0.060 [,12] [1,] -0.120 [2,] -0.045 [3,] 0.030 [4,] 0.195 [5,] 0.280 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.6031395 1.038277 0.3172425 0.007966277 -0.5143783 -0.5903728 0.1297247 [2,] 0.8768605 1.261723 0.5127575 0.142033723 -0.3356217 0.5603728 0.2302753 [,8] [,9] [,10] [,11] [,12] [1,] 0.3460702 -0.1449289 -0.41758431 -0.5093427 -0.1133241 [2,] 0.5639298 0.2349289 -0.08241569 -0.1406573 0.1733241 $out [1] 0.37 0.53 -0.15 0.07 0.66 $group [1] 4 7 7 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.379999999999995, 0.575000000000003, 0.740000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qxnw1432123079.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,] 99.060 100.540 102.800 104.080 105.680 108.900 110.350 113.660 NA [2,] 99.835 101.380 103.815 104.885 106.520 108.965 111.485 114.565 NA [3,] 100.160 101.800 104.460 105.585 106.960 109.575 112.075 114.920 NA [4,] 100.370 102.115 104.655 105.865 107.255 109.810 112.720 115.260 NA [5,] 100.740 102.260 105.190 106.240 107.350 110.200 113.360 115.540 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 99.91598 101.4648 104.0769 105.138 106.6248 109.1896 111.5117 114.603 [2,] 100.40402 102.1352 104.8431 106.032 107.2952 109.9604 112.6383 115.237 [,9] [1,] NA [2,] NA $out [1] 98.68 100.08 102.11 104.93 106.87 107.68 109.52 112.77 $group [1] 1 2 3 5 6 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(99.06, 99.835, 100.16, 100.37, 100.74, 100.54, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7hzpz1432123079.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,] 106.6825 105.2450 106.4250 [2,] 106.7000 105.7025 106.5475 [3,] 106.8800 106.3500 106.9350 [4,] 107.1488 106.4725 107.2288 [5,] 107.4100 106.7450 107.6150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 106.6753 105.9988 106.6243 [2,] 107.0847 106.7012 107.2457 $out [1] 104.8800 105.5725 104.5050 104.5675 105.2912 $group [1] 1 1 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(106.6825, 106.7, 106.88, 107.14875, 107.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1uw651432123079.ps tmp/1uw651432123079.png",intern=TRUE)) character(0) > try(system("convert tmp/2m3or1432123079.ps tmp/2m3or1432123079.png",intern=TRUE)) character(0) > try(system("convert tmp/3onae1432123079.ps tmp/3onae1432123079.png",intern=TRUE)) character(0) > try(system("convert tmp/4u6st1432123079.ps tmp/4u6st1432123079.png",intern=TRUE)) character(0) > try(system("convert tmp/5tj2u1432123079.ps tmp/5tj2u1432123079.png",intern=TRUE)) character(0) > try(system("convert tmp/6qxnw1432123079.ps tmp/6qxnw1432123079.png",intern=TRUE)) character(0) > try(system("convert tmp/7hzpz1432123079.ps tmp/7hzpz1432123079.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.425 0.432 2.888