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(96.01,96.39,97.16,97.46,97.6,97.02,96.95,97.23,98,98.04,97.76,96.99,97.44,98,98.84,98.98,98.92,98.63,98.52,98.97,99.74,99.68,99.45,98.97,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,107,107.74,109.02,109.54,109.71,109.18,109.23,109.38,110.17,110.15,110.01,109.54,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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 96.01 97.44 98.68 100.08 102.11 104.08 104.93 107.00 109.52 112.77 NA [2,] 96.39 98.00 99.06 100.54 102.80 104.81 105.68 107.74 110.35 113.66 NA [3,] 97.16 98.84 99.84 101.63 103.82 105.86 106.93 109.02 111.61 114.87 NA [4,] 97.46 98.98 100.30 102.12 104.20 106.10 107.29 109.54 112.06 114.97 NA [5,] 97.60 98.92 100.38 102.19 104.57 106.24 107.25 109.71 111.90 115.00 NA [6,] 97.02 98.63 100.02 101.77 104.38 105.87 106.74 109.18 111.36 114.57 NA [7,] 96.95 98.52 99.83 101.29 104.54 104.74 106.44 109.23 112.09 115.54 NA [8,] 97.23 98.97 100.36 101.47 104.74 105.03 106.60 109.38 112.24 115.39 NA [9,] 98.00 99.74 100.74 102.07 105.19 105.59 107.26 110.17 112.70 115.46 NA [10,] 98.04 99.68 100.49 102.11 104.95 105.69 107.35 110.15 113.36 115.13 NA [11,] 97.76 99.45 100.33 102.26 104.57 105.58 107.22 110.01 112.90 114.56 NA [12,] 96.99 98.97 99.96 101.83 103.81 104.96 106.99 109.54 112.74 114.62 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 0.38 0.56 0.38 0.46 0.69 0.73 0.75 0.74 0.83 0.89 NA [2,] 0.77 0.84 0.78 1.09 1.02 1.05 1.25 1.28 1.26 1.21 NA [3,] 0.30 0.14 0.46 0.49 0.38 0.24 0.36 0.52 0.45 0.10 NA [4,] 0.14 -0.06 0.08 0.07 0.37 0.14 -0.04 0.17 -0.16 0.03 NA [5,] -0.58 -0.29 -0.36 -0.42 -0.19 -0.37 -0.51 -0.53 -0.54 -0.43 NA [6,] -0.07 -0.11 -0.19 -0.48 0.16 -1.13 -0.30 0.05 0.73 0.97 NA [7,] 0.28 0.45 0.53 0.18 0.20 0.29 0.16 0.15 0.15 -0.15 NA [8,] 0.77 0.77 0.38 0.60 0.45 0.56 0.66 0.79 0.46 0.07 NA [9,] 0.04 -0.06 -0.25 0.04 -0.24 0.10 0.09 -0.02 0.66 -0.33 NA [10,] -0.28 -0.23 -0.16 0.15 -0.38 -0.11 -0.13 -0.14 -0.46 -0.57 NA [11,] -0.77 -0.48 -0.37 -0.43 -0.76 -0.62 -0.23 -0.47 -0.16 0.06 NA [12,] 0.45 -0.29 0.12 0.28 0.27 -0.03 0.01 -0.02 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/1zom01424705898.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/2vkmr1424705898.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/3ot121424705898.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/4w86n1424705898.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] [1,] 96.010 96.390 97.16 97.46 97.600 97.020 96.95 97.230 98.00 98.04 [2,] 98.680 99.060 99.84 100.30 100.380 100.020 99.83 100.360 100.74 100.49 [3,] 103.095 103.805 104.84 105.15 105.405 105.125 104.64 104.885 105.39 105.32 [4,] 107.000 107.740 109.02 109.54 109.710 109.180 109.23 109.380 110.17 110.15 [5,] 112.770 113.660 114.87 114.97 115.000 114.570 115.54 115.390 115.46 115.13 [,11] [,12] [1,] 97.760 96.990 [2,] 100.330 99.960 [3,] 105.075 104.385 [4,] 110.010 109.540 [5,] 114.560 114.620 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.938 99.46813 100.2533 100.5333 100.7434 100.5483 99.94339 100.3782 [2,] 107.252 108.14187 109.4267 109.7667 110.0666 109.7017 109.33661 109.3918 [,9] [,10] [,11] [,12] [1,] 100.6784 100.4935 100.2385 99.59845 [2,] 110.1016 110.1465 109.9115 109.17155 $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(96.01, 98.68, 103.095, 107, 112.77, 96.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hrxc1424705898.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] [,12] [1,] 0.38 0.77 0.10 -0.160 -0.580 -0.48 0.15 0.07 -0.33 -0.570 -0.77 -0.29 [2,] 0.46 0.84 0.24 -0.040 -0.530 -0.30 0.15 0.45 -0.24 -0.380 -0.62 -0.02 [3,] 0.71 1.07 0.37 0.075 -0.425 -0.09 0.19 0.58 0.01 -0.195 -0.45 0.03 [4,] 0.75 1.25 0.46 0.140 -0.360 0.16 0.29 0.77 0.09 -0.130 -0.23 0.27 [5,] 0.89 1.28 0.52 0.370 -0.190 0.73 0.45 0.79 0.10 0.150 0.06 0.45 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.5651044 0.8651477 0.2600792 -0.01493518 -0.5099388 -0.3198343 0.1200504 [2,] 0.8548956 1.2748523 0.4799208 0.16493518 -0.3400612 0.1398343 0.2599496 [,8] [,9] [,10] [,11] [,12] [1,] 0.4201152 -0.1548812 -0.31990997 -0.6448595 -0.1227333 [2,] 0.7398848 0.1748812 -0.07009003 -0.2551405 0.1827333 $out [1] -1.13 0.97 0.53 -0.15 0.66 $group [1] 6 6 7 7 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.460000000000008, 0.710000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6f3jb1424705898.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,] 96.010 98.000 99.060 100.540 102.800 104.080 105.680 109.02 110.350 [2,] 96.970 98.575 99.835 101.380 103.815 104.885 106.520 109.10 111.485 [3,] 97.195 98.945 100.160 101.800 104.460 105.585 106.960 109.46 112.075 [4,] 97.680 99.215 100.370 102.115 104.655 105.865 107.255 109.86 112.720 [5,] 98.040 99.740 100.740 102.260 105.190 106.240 107.350 110.17 113.360 [,10] [,11] [1,] 113.660 NA [2,] 114.565 NA [3,] 114.920 NA [4,] 115.260 NA [5,] 115.540 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.87116 98.65309 99.91598 101.4648 104.0769 105.138 106.6248 109.1134 [2,] 97.51884 99.23691 100.40402 102.1352 104.8431 106.032 107.2952 109.8066 [,9] [,10] [,11] [1,] 111.5117 114.603 NA [2,] 112.6383 115.237 NA $out [1] 97.44 98.68 100.08 102.11 104.93 107.00 107.74 109.52 112.77 $group [1] 2 3 4 5 7 8 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(96.01, 96.97, 97.195, 97.68, 98.04, 98, 98.575, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7zckj1424705898.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,] 104.9170 103.8050 104.3638 [2,] 104.9355 104.5125 104.3781 [3,] 105.0910 104.9800 104.6631 [4,] 105.4200 105.2350 105.0131 [5,] 105.6950 105.4050 105.2575 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 104.870 104.6505 104.3735 [2,] 105.312 105.3095 104.9528 $out [1] 103.2620 103.9030 103.0950 102.7562 103.3275 $group [1] 1 1 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(104.917, 104.9355, 105.091, 105.42, 105.695, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zom01424705898.ps tmp/1zom01424705898.png",intern=TRUE)) character(0) > try(system("convert tmp/2vkmr1424705898.ps tmp/2vkmr1424705898.png",intern=TRUE)) character(0) > try(system("convert tmp/3ot121424705898.ps tmp/3ot121424705898.png",intern=TRUE)) character(0) > try(system("convert tmp/4w86n1424705898.ps tmp/4w86n1424705898.png",intern=TRUE)) character(0) > try(system("convert tmp/5hrxc1424705898.ps tmp/5hrxc1424705898.png",intern=TRUE)) character(0) > try(system("convert tmp/6f3jb1424705898.ps tmp/6f3jb1424705898.png",intern=TRUE)) character(0) > try(system("convert tmp/7zckj1424705898.ps tmp/7zckj1424705898.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.509 0.462 2.993