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(104.4,104.4,104.4,104.4,104.4,104.41,104.42,104.68,106.02,106.35,106.38,106.47,106.5,106.56,113.07,116.26,118,118.02,118.04,118.12,118.12,118.17,118.22,118.22,118.23,118.23,118.23,119.94,120.88,121.14,121.16,121.2,121.2,121.2,121.2,121.2,121.22,121.22,121.95,123.05,123.44,123.65,123.79,123.87,123.91,123.94,124.28,126.28,126.68,126.69,126.69,126.99,128.79,128.84,128.95,128.97,128.97,128.97,128.97,128.97,128.97,128.98,128.99,129.07,129.76,130.47,130.76,130.88,131.04,131.06,131.13,131.15) > 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,] 104.40 106.50 118.23 121.22 126.68 128.97 NA [2,] 104.40 106.56 118.23 121.22 126.69 128.98 NA [3,] 104.40 113.07 118.23 121.95 126.69 128.99 NA [4,] 104.40 116.26 119.94 123.05 126.99 129.07 NA [5,] 104.40 118.00 120.88 123.44 128.79 129.76 NA [6,] 104.41 118.02 121.14 123.65 128.84 130.47 NA [7,] 104.42 118.04 121.16 123.79 128.95 130.76 NA [8,] 104.68 118.12 121.20 123.87 128.97 130.88 NA [9,] 106.02 118.12 121.20 123.91 128.97 131.04 NA [10,] 106.35 118.17 121.20 123.94 128.97 131.06 NA [11,] 106.38 118.22 121.20 124.28 128.97 131.13 NA [12,] 106.47 118.22 121.20 126.28 128.97 131.15 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 0.06 0.00 0.00 0.01 0.01 NA [2,] 0.00 6.51 0.00 0.73 0.00 0.01 NA [3,] 0.00 3.19 1.71 1.10 0.30 0.08 NA [4,] 0.00 1.74 0.94 0.39 1.80 0.69 NA [5,] 0.01 0.02 0.26 0.21 0.05 0.71 NA [6,] 0.01 0.02 0.02 0.14 0.11 0.29 NA [7,] 0.26 0.08 0.04 0.08 0.02 0.12 NA [8,] 1.34 0.00 0.00 0.04 0.00 0.16 NA [9,] 0.33 0.05 0.00 0.03 0.00 0.02 NA [10,] 0.03 0.05 0.00 0.34 0.00 0.07 NA [11,] 0.09 0.00 0.00 2.00 0.00 0.02 NA [12,] 0.03 0.01 0.02 0.40 0.00 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/1zlii1350633017.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/2b1bl1350633017.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/3w8cr1350633017.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/44cn11350633017.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,] 104.400 104.400 104.40 104.400 104.40 104.410 104.420 104.680 106.020 [2,] 106.500 106.560 113.07 116.260 118.00 118.020 118.040 118.120 118.120 [3,] 119.725 119.725 120.09 121.495 122.16 122.395 122.475 122.535 122.555 [4,] 126.680 126.690 126.69 126.990 128.79 128.840 128.950 128.970 128.970 [5,] 128.970 128.980 128.99 129.070 129.76 130.470 130.760 130.880 131.040 [,10] [,11] [,12] [1,] 106.35 106.38 106.47 [2,] 118.17 118.22 118.22 [3,] 122.57 122.74 123.74 [4,] 128.97 128.97 128.97 [5,] 131.06 131.13 131.15 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 106.7082 106.7405 111.3047 114.5738 115.2001 115.4158 115.4377 115.5364 [2,] 132.7418 132.7095 128.8753 128.4162 129.1199 129.3742 129.5123 129.5336 [,9] [,10] [,11] [,12] [1,] 115.5564 115.6037 115.8059 116.8059 [2,] 129.5536 129.5363 129.6741 130.6741 $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(104.4, 106.5, 119.725, 126.68, 128.97, 104.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wywj1350633017.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.000 0.000 0.00 0.000 0.01 0.010 0.02 0.00 0.000 0.00 0.00 0.00 [2,] 0.000 0.000 0.08 0.390 0.02 0.020 0.04 0.00 0.000 0.00 0.00 0.01 [3,] 0.005 0.005 0.70 0.815 0.13 0.065 0.08 0.02 0.025 0.04 0.01 0.02 [4,] 0.010 0.730 1.71 1.740 0.26 0.140 0.12 0.16 0.050 0.07 0.09 0.03 [5,] 0.010 0.730 3.19 1.800 0.26 0.290 0.12 0.16 0.050 0.07 0.09 0.03 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.001450323 -0.4658736 -0.3514026 -0.0557936 -0.02480775 -0.01240388 [2,] 0.011450323 0.4758736 1.7514026 1.6857936 0.28480775 0.14240388 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.02839742 -0.08320517 -0.007251615 -0.005152261 -0.04805291 0.00586805 [2,] 0.13160258 0.12320517 0.057251615 0.085152261 0.06805291 0.03413195 $out [1] 0.06 6.51 0.71 0.26 1.34 0.33 0.34 2.00 0.40 $group [1] 1 2 5 7 8 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0.00499999999999545, 0.00999999999999091, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ftn91350633017.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,] 104.400 113.070 118.230 121.220 126.680 128.970 NA [2,] 104.400 114.665 119.085 122.500 126.840 129.030 NA [3,] 104.415 118.030 121.150 123.720 128.895 130.615 NA [4,] 106.185 118.145 121.200 123.925 128.970 131.050 NA [5,] 106.470 118.220 121.200 124.280 128.970 131.150 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 103.6008 116.4427 120.1853 123.07 127.9235 129.6937 NA [2,] 105.2292 119.6173 122.1147 124.37 129.8665 131.5363 NA $out [1] 106.50 106.56 126.28 $group [1] 2 2 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(104.4, 104.4, 104.415, 106.185, 106.47, 113.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7veb11350633017.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,] 117.6667 119.7250 117.3738 [2,] 119.4200 120.7925 120.7625 [3,] 121.1375 122.4350 123.2056 [4,] 121.5792 122.5625 123.3087 [5,] 122.0483 123.7400 123.6312 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 120.1527 121.6277 122.0443 [2,] 122.1223 123.2423 124.3670 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(117.666666666667, 119.42, 121.1375, 121.579166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zlii1350633017.ps tmp/1zlii1350633017.png",intern=TRUE)) character(0) > try(system("convert tmp/2b1bl1350633017.ps tmp/2b1bl1350633017.png",intern=TRUE)) character(0) > try(system("convert tmp/3w8cr1350633017.ps tmp/3w8cr1350633017.png",intern=TRUE)) character(0) > try(system("convert tmp/44cn11350633017.ps tmp/44cn11350633017.png",intern=TRUE)) character(0) > try(system("convert tmp/5wywj1350633017.ps tmp/5wywj1350633017.png",intern=TRUE)) character(0) > try(system("convert tmp/6ftn91350633017.ps tmp/6ftn91350633017.png",intern=TRUE)) character(0) > try(system("convert tmp/7veb11350633017.ps tmp/7veb11350633017.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.480 0.754 4.224