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.97,103.9,106.85,106.93,107.13,107.07,107.2,107.78,108,108.11,107.26,105.3,105.55,105.38,106.12,106.85,107.92,107.97,107.76,107.99,108.41,107.61,106.54,106.24,106.19,106.71,106.36,107.53,107.89,108,108.05,108.86,109.27,108.87,108.88,108.19,108.19,108.91,110.39,111.21,111.44,111.87,111.88,111.93,111.76,111.66,110.25,109.05,109.47,109.68,110.93,111.86,112.66,112.96,113.14,113.53,113.62,112.51,111,108.49,108.52,110.66,111.15,112.14,113.38,113.75,113.89,113.92,116.4,115.86,115.16,114.45,114.65,114.85,116.51,118.18,118.75,119.06,119.28,119.68,119.28,117.3,114.23,112.56,112.83,112.35,112.8,113.84,115.02,115.46,115,115.3,116.09,115.49,112.89,110.66) > 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.97 105.55 106.19 108.19 109.47 108.52 114.65 112.83 NA [2,] 103.90 105.38 106.71 108.91 109.68 110.66 114.85 112.35 NA [3,] 106.85 106.12 106.36 110.39 110.93 111.15 116.51 112.80 NA [4,] 106.93 106.85 107.53 111.21 111.86 112.14 118.18 113.84 NA [5,] 107.13 107.92 107.89 111.44 112.66 113.38 118.75 115.02 NA [6,] 107.07 107.97 108.00 111.87 112.96 113.75 119.06 115.46 NA [7,] 107.20 107.76 108.05 111.88 113.14 113.89 119.28 115.00 NA [8,] 107.78 107.99 108.86 111.93 113.53 113.92 119.68 115.30 NA [9,] 108.00 108.41 109.27 111.76 113.62 116.40 119.28 116.09 NA [10,] 108.11 107.61 108.87 111.66 112.51 115.86 117.30 115.49 NA [11,] 107.26 106.54 108.88 110.25 111.00 115.16 114.23 112.89 NA [12,] 105.30 106.24 108.19 109.05 108.49 114.45 112.56 110.66 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1.93 -0.17 0.52 0.72 0.21 2.14 0.20 -0.48 NA [2,] 2.95 0.74 -0.35 1.48 1.25 0.49 1.66 0.45 NA [3,] 0.08 0.73 1.17 0.82 0.93 0.99 1.67 1.04 NA [4,] 0.20 1.07 0.36 0.23 0.80 1.24 0.57 1.18 NA [5,] -0.06 0.05 0.11 0.43 0.30 0.37 0.31 0.44 NA [6,] 0.13 -0.21 0.05 0.01 0.18 0.14 0.22 -0.46 NA [7,] 0.58 0.23 0.81 0.05 0.39 0.03 0.40 0.30 NA [8,] 0.22 0.42 0.41 -0.17 0.09 2.48 -0.40 0.79 NA [9,] 0.11 -0.80 -0.40 -0.10 -1.11 -0.54 -1.98 -0.60 NA [10,] -0.85 -1.07 0.01 -1.41 -1.51 -0.70 -3.07 -2.60 NA [11,] -1.96 -0.30 -0.69 -1.20 -2.51 -0.71 -1.67 -2.23 NA [12,] 0.25 -0.05 0.00 0.42 0.03 0.20 0.27 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/1bzjt1425582662.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/2uprc1425582662.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/3ofyn1425582662.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/4e2c81425582662.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.970 103.900 106.120 106.850 107.130 107.070 107.200 107.780 108.000 [2,] 105.870 106.045 106.605 107.230 107.905 107.985 107.905 108.425 108.840 [3,] 108.355 109.295 110.660 111.535 112.050 112.415 112.510 112.730 112.690 [4,] 111.150 111.505 111.975 112.990 114.200 114.605 114.445 114.610 116.245 [5,] 114.650 114.850 116.510 118.180 118.750 119.060 119.280 119.680 119.280 [,10] [,11] [,12] [1,] 107.610 106.540 105.300 [2,] 108.490 108.070 107.215 [3,] 112.085 110.625 108.770 [4,] 115.675 113.560 111.610 [5,] 117.300 115.160 114.450 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.4055 106.245 107.6602 108.3174 108.5335 108.717 108.8567 109.275 [2,] 111.3045 112.345 113.6598 114.7526 115.5665 116.113 116.1633 116.185 [,9] [,10] [,11] [,12] [1,] 108.5535 108.0714 107.5582 106.3149 [2,] 116.8265 116.0986 113.6918 111.2251 $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.97, 105.87, 108.355, 111.15, 114.65, 103.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5eh141425582662.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.480 -0.350 0.730 0.200 -0.060 -0.46 0.030 -0.400 -1.980 -3.070 -2.510 [2,] 0.015 0.470 0.775 0.295 0.080 -0.10 0.140 -0.040 -0.955 -2.055 -2.095 [3,] 0.365 0.995 0.960 0.685 0.305 0.09 0.345 0.315 -0.570 -1.240 -1.435 [4,] 1.325 1.570 1.105 1.125 0.400 0.16 0.490 0.605 -0.250 -0.775 -0.700 [5,] 2.140 2.950 1.170 1.240 0.440 0.22 0.810 0.790 0.110 0.010 -0.300 [,12] [1,] -0.050 [2,] 0.015 [3,] 0.200 [4,] 0.260 [5,] 0.420 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.3667848 0.3805242 0.7756573 0.2213501 0.1262434 -0.05523973 0.149485 [2,] 1.0967848 1.6094758 1.1443427 1.1486499 0.4837566 0.23523973 0.540515 [,8] [,9] [,10] [,11] [,12] [1,] -0.04530626 -0.9638231 -1.9550264 -2.214267 0.05368995 [2,] 0.67530626 -0.1761769 -0.5249736 -0.655733 0.34631005 $out [1] 0.08 1.67 2.48 $group [1] 3 3 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.480000000000004, 0.0149999999999935, 0.365000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6whrt1425582662.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,] 105.300 105.380 106.190 108.190 108.490 108.520 112.56 110.660 NA [2,] 106.075 106.180 107.120 109.650 110.305 111.645 114.75 112.815 NA [3,] 107.100 107.230 108.025 111.325 112.185 113.820 117.74 114.420 NA [4,] 107.520 107.945 108.865 111.815 113.050 114.805 119.17 115.380 NA [5,] 108.110 108.410 109.270 111.930 113.620 116.400 119.68 116.090 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 106.4409 106.425 107.2291 110.3375 110.933 112.3787 115.724 113.2501 NA [2,] 107.7591 108.035 108.8209 112.3125 113.437 115.2613 119.756 115.5899 NA $out [1] 101.97 103.90 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(105.3, 106.075, 107.1, 107.52, 108.11, 105.38, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7xm6y1425582662.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.4213 108.3550 108.1700 [2,] 109.7531 109.9600 109.2819 [3,] 111.4206 111.7925 110.8506 [4,] 112.1006 112.4625 111.2694 [5,] 112.8538 112.7300 112.6112 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 110.3499 110.6511 109.9441 [2,] 112.4913 112.9339 111.7571 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(108.42125, 109.753125, 111.420625, 112.100625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bzjt1425582662.ps tmp/1bzjt1425582662.png",intern=TRUE)) character(0) > try(system("convert tmp/2uprc1425582662.ps tmp/2uprc1425582662.png",intern=TRUE)) character(0) > try(system("convert tmp/3ofyn1425582662.ps tmp/3ofyn1425582662.png",intern=TRUE)) character(0) > try(system("convert tmp/4e2c81425582662.ps tmp/4e2c81425582662.png",intern=TRUE)) character(0) > try(system("convert tmp/5eh141425582662.ps tmp/5eh141425582662.png",intern=TRUE)) character(0) > try(system("convert tmp/6whrt1425582662.ps tmp/6whrt1425582662.png",intern=TRUE)) character(0) > try(system("convert tmp/7xm6y1425582662.ps tmp/7xm6y1425582662.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.498 0.485 3.012