R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-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.01,99.2,100.7,106.41,107.51,107.1,99.75,98.96,107.26,107.11,107.2,107.65,104.78,105.56,107.95,107.11,107.47,107.06,99.71,99.6,107.19,107.26,113.24,113.52,110.48,111.41,115.5,118.32,118.42,117.5,110.23,109.19,118.41,118.3,116.1,114.11,113.41,114.33,116.61,123.64,123.77,123.39,116.03,114.95,123.4,123.53,114.45,114.26,114.35,112.77,115.31,114.93,116.38,115.07,105,103.43,114.52,115.04,117.16,115,116.22,112.92,116.56,114.32,113.22,111.56,103.87,102.85,112.27,112.76,118.55,122.73) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.01 104.78 110.48 113.41 114.35 116.22 NA [2,] 99.20 105.56 111.41 114.33 112.77 112.92 NA [3,] 100.70 107.95 115.50 116.61 115.31 116.56 NA [4,] 106.41 107.11 118.32 123.64 114.93 114.32 NA [5,] 107.51 107.47 118.42 123.77 116.38 113.22 NA [6,] 107.10 107.06 117.50 123.39 115.07 111.56 NA [7,] 99.75 99.71 110.23 116.03 105.00 103.87 NA [8,] 98.96 99.60 109.19 114.95 103.43 102.85 NA [9,] 107.26 107.19 118.41 123.40 114.52 112.27 NA [10,] 107.11 107.26 118.30 123.53 115.04 112.76 NA [11,] 107.20 113.24 116.10 114.45 117.16 118.55 NA [12,] 107.65 113.52 114.11 114.26 115.00 122.73 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.19 0.78 0.93 0.92 -1.58 -3.30 NA [2,] 1.50 2.39 4.09 2.28 2.54 3.64 NA [3,] 5.71 -0.84 2.82 7.03 -0.38 -2.24 NA [4,] 1.10 0.36 0.10 0.13 1.45 -1.10 NA [5,] -0.41 -0.41 -0.92 -0.38 -1.31 -1.66 NA [6,] -7.35 -7.35 -7.27 -7.36 -10.07 -7.69 NA [7,] -0.79 -0.11 -1.04 -1.08 -1.57 -1.02 NA [8,] 8.30 7.59 9.22 8.45 11.09 9.42 NA [9,] -0.15 0.07 -0.11 0.13 0.52 0.49 NA [10,] 0.09 5.98 -2.20 -9.08 2.12 5.79 NA [11,] 0.45 0.28 -1.99 -0.19 -2.16 4.18 NA [12,] -2.87 -3.04 -0.70 0.09 1.22 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/1p5zs1350287029.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/25wn31350287029.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/32xus1350287029.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/452pt1350287029.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.010 99.20 100.700 106.410 107.47 107.060 99.710 98.96 107.190 [2,] 104.780 105.56 107.950 107.110 107.51 107.100 99.750 99.60 107.260 [3,] 111.945 112.09 115.405 114.625 114.80 113.315 104.435 103.14 113.395 [4,] 114.350 112.92 116.560 118.320 118.42 117.500 110.230 109.19 118.410 [5,] 116.220 114.33 116.610 123.640 123.77 123.390 116.030 114.95 123.400 [,10] [,11] [,12] [1,] 107.11 113.240 113.520 [2,] 107.26 113.240 113.520 [3,] 113.90 115.275 114.185 [4,] 118.30 117.160 115.000 [5,] 123.53 118.550 115.000 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.772 107.3426 109.8513 107.3942 107.7627 106.6067 97.67506 96.95414 [2,] 118.118 116.8374 120.9587 121.8558 121.8373 120.0233 111.19494 109.32586 [,9] [,10] [,11] [,12] [1,] 106.2029 106.7788 112.7465 113.2304 [2,] 120.5871 121.0212 117.8035 115.1396 $out [1] 107.20 107.65 122.73 $group [1] 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.01, 104.78, 111.945, 114.35, 116.22, 99.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o40e1350287029.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,] -3.30 1.500 -2.24 -1.100 -1.660 -7.690 -1.08 7.590 -0.15 -9.080 -2.160 [2,] -1.58 2.280 -0.84 0.100 -1.310 -7.690 -1.08 8.300 -0.11 -2.200 -1.990 [3,] 0.85 2.465 1.22 0.245 -0.665 -7.355 -1.03 8.835 0.10 1.105 0.045 [4,] 0.93 3.640 5.71 1.100 -0.410 -7.350 -0.79 9.420 0.49 5.790 0.450 [5,] 1.19 4.090 7.03 1.450 -0.380 -7.270 -0.79 11.090 0.52 5.980 0.450 [,12] [1,] -3.04 [2,] -2.87 [3,] -0.70 [4,] 0.09 [5,] 1.22 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.7690311 1.587756 -3.004962 -0.4000323 -1.24552907 -7.574311 -1.2170594 [2,] 2.4690311 3.342244 5.444962 0.8900323 -0.08447093 -7.135689 -0.8429406 [,8] [,9] [,10] [,11] [,12] [1,] 8.112564 -0.2870194 -4.048808 -1.528879 -2.791529 [2,] 9.557436 0.4870194 6.258808 1.618879 1.391529 $out [1] -10.07 -0.11 -1.57 4.18 $group [1] 6 7 7 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3.3, -1.58, 0.850000000000001, 0.929999999999993, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6picu1350287029.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] [1,] 98.010 104.78 109.190 113.410 112.770 111.560 NA [2,] 99.475 105.17 110.945 114.390 113.560 111.915 NA [3,] 106.755 107.15 115.800 116.320 114.965 113.070 NA [4,] 107.230 107.71 118.310 123.465 115.190 116.390 NA [5,] 107.650 107.95 118.420 123.770 117.160 122.730 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 103.2179 105.9915 112.4408 112.1808 114.2215 111.0289 NA [2,] 110.2921 108.3085 119.1592 120.4592 115.7085 115.1111 NA $out [1] 99.71 99.60 113.24 113.52 105.00 103.43 103.87 102.85 $group [1] 2 2 2 2 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(98.01, 99.475, 106.755, 107.23, 107.65, 104.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7iq211350287029.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.8300 111.9450 109.9525 [2,] 109.4533 112.0175 110.0563 [3,] 113.7275 113.6475 113.0087 [4,] 114.2858 114.7125 113.3081 [5,] 114.5450 115.4050 115.2188 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 111.5234 112.4183 111.5255 [2,] 115.9316 114.8767 114.4920 $out [1] 104.4350 103.1400 104.8512 104.0812 $group [1] 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(104.83, 109.453333333333, 113.7275, 114.285833333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1p5zs1350287029.ps tmp/1p5zs1350287029.png",intern=TRUE)) character(0) > try(system("convert tmp/25wn31350287029.ps tmp/25wn31350287029.png",intern=TRUE)) character(0) > try(system("convert tmp/32xus1350287029.ps tmp/32xus1350287029.png",intern=TRUE)) character(0) > try(system("convert tmp/452pt1350287029.ps tmp/452pt1350287029.png",intern=TRUE)) character(0) > try(system("convert tmp/5o40e1350287029.ps tmp/5o40e1350287029.png",intern=TRUE)) character(0) > try(system("convert tmp/6picu1350287029.ps tmp/6picu1350287029.png",intern=TRUE)) character(0) > try(system("convert tmp/7iq211350287029.ps tmp/7iq211350287029.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.336 0.583 3.901