R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(106.1,106.17,105.75,106.49,106.61,106.61,106.61,106.61,106.92,106.94,107.28,107.36,107.36,107.39,107.46,107.51,108.21,108.33,108.33,108.36,108.89,109.3,109.55,109.45,109.45,109.4,109.45,109.5,109.91,109.9,109.9,109.92,109.74,110.28,110.97,111.02,111.02,111,111.43,111.52,112.29,112.27,112.27,112.39,112.31,112.91,112.9,113.08,113.08,113.54,114,115.28,116.4,116.56,116.56,116.59,116.96,117.17,117.83,117.84,117.84,117.84,117.69,117.9,118.05,118.08,118.08,118.08,118.16,118.53,118.5,118.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] 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,] 106.10 107.36 109.45 111.02 113.08 117.84 NA [2,] 106.17 107.39 109.40 111.00 113.54 117.84 NA [3,] 105.75 107.46 109.45 111.43 114.00 117.69 NA [4,] 106.49 107.51 109.50 111.52 115.28 117.90 NA [5,] 106.61 108.21 109.91 112.29 116.40 118.05 NA [6,] 106.61 108.33 109.90 112.27 116.56 118.08 NA [7,] 106.61 108.33 109.90 112.27 116.56 118.08 NA [8,] 106.61 108.36 109.92 112.39 116.59 118.08 NA [9,] 106.92 108.89 109.74 112.31 116.96 118.16 NA [10,] 106.94 109.30 110.28 112.91 117.17 118.53 NA [11,] 107.28 109.55 110.97 112.90 117.83 118.50 NA [12,] 107.36 109.45 111.02 113.08 117.84 118.62 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.07 0.03 -0.05 -0.02 0.46 0.00 NA [2,] -0.42 0.07 0.05 0.43 0.46 -0.15 NA [3,] 0.74 0.05 0.05 0.09 1.28 0.21 NA [4,] 0.12 0.70 0.41 0.77 1.12 0.15 NA [5,] 0.00 0.12 -0.01 -0.02 0.16 0.03 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.00 0.03 0.02 0.12 0.03 0.00 NA [8,] 0.31 0.53 -0.18 -0.08 0.37 0.08 NA [9,] 0.02 0.41 0.54 0.60 0.21 0.37 NA [10,] 0.34 0.25 0.69 -0.01 0.66 -0.03 NA [11,] 0.08 -0.10 0.05 0.18 0.01 0.12 NA [12,] 0.00 0.00 0.00 0.00 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/fisher/rcomp/tmp/1d0mr1363127824.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/fisher/rcomp/tmp/2tgk31363127824.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/fisher/rcomp/tmp/3p22p1363127824.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/fisher/rcomp/tmp/4fgtx1363127824.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,] 106.100 106.17 105.75 106.49 106.61 106.610 106.610 106.610 106.920 [2,] 107.360 107.39 107.46 107.51 108.21 108.330 108.330 108.360 108.890 [3,] 110.235 110.20 110.44 110.51 111.10 111.085 111.085 111.155 111.025 [4,] 113.080 113.54 114.00 115.28 116.40 116.560 116.560 116.590 116.960 [5,] 117.840 117.84 117.69 117.90 118.05 118.080 118.080 118.080 118.160 [,10] [,11] [,12] [1,] 106.940 107.280 107.36 [2,] 109.300 109.550 109.45 [3,] 111.595 111.935 112.05 [4,] 117.170 117.830 117.84 [5,] 118.530 118.500 118.62 $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.5454 106.2331 106.2215 105.4981 105.8172 105.7764 105.7764 105.8464 [2,] 113.9246 114.1669 114.6585 115.5219 116.3828 116.3936 116.3936 116.4636 [,9] [,10] [,11] [,12] [1,] 105.8196 106.5186 106.5941 106.6382 [2,] 116.2304 116.6714 117.2759 117.4618 $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(106.1, 107.36, 110.235, 113.08, 117.84, 106.17, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/51b9h1363127824.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.050 -0.42 0.05 0.120 -0.020 0 0.000 -0.180 0.02 -0.030 -0.100 0 [2,] -0.020 -0.15 0.05 0.150 -0.010 0 0.000 -0.080 0.21 -0.010 0.010 0 [3,] 0.015 0.06 0.15 0.555 0.015 0 0.025 0.195 0.39 0.295 0.065 0 [4,] 0.070 0.43 0.74 0.770 0.120 0 0.030 0.370 0.54 0.660 0.120 0 [5,] 0.070 0.46 1.28 1.120 0.160 0 0.030 0.530 0.60 0.690 0.180 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.04305291 -0.3141187 -0.2950723 0.15508 -0.0688542 0 0.005649031 [2,] 0.07305291 0.4341187 0.5950723 0.95492 0.0988542 0 0.044350969 [,8] [,9] [,10] [,11] [,12] [1,] -0.09526453 0.1771393 -0.1371716 -0.005953553 0 [2,] 0.48526453 0.6028607 0.7271716 0.135953553 0 $out [1] 0.46 0.12 $group [1] 1 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0499999999999972, -0.019999999999996, 0.0150000000000006, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/60btp1363127824.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,] 105.75 107.360 109.400 111.000 113.080 117.69 NA [2,] 106.33 107.485 109.475 111.475 114.640 117.87 NA [3,] 106.61 108.330 109.900 112.280 116.560 118.08 NA [4,] 106.93 109.095 110.100 112.645 117.065 118.33 NA [5,] 107.36 109.550 111.020 113.080 117.840 118.62 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 106.3363 107.5957 109.6149 111.7464 115.4539 117.8702 NA [2,] 106.8837 109.0643 110.1851 112.8136 117.6661 118.2898 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(105.75, 106.33, 106.61, 106.93, 107.36, 107.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/73kn91363127824.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,] 110.8083 110.200 110.2237 [2,] 111.1650 110.475 110.9156 [3,] 111.9583 111.085 112.1050 [4,] 112.3425 111.375 112.6375 [5,] 112.8950 112.050 113.2512 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 111.4213 110.6745 111.3196 [2,] 112.4954 111.4955 112.8904 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(110.808333333333, 111.165, 111.958333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1d0mr1363127824.ps tmp/1d0mr1363127824.png",intern=TRUE)) character(0) > try(system("convert tmp/2tgk31363127824.ps tmp/2tgk31363127824.png",intern=TRUE)) character(0) > try(system("convert tmp/3p22p1363127824.ps tmp/3p22p1363127824.png",intern=TRUE)) character(0) > try(system("convert tmp/4fgtx1363127824.ps tmp/4fgtx1363127824.png",intern=TRUE)) character(0) > try(system("convert tmp/51b9h1363127824.ps tmp/51b9h1363127824.png",intern=TRUE)) character(0) > try(system("convert tmp/60btp1363127824.ps tmp/60btp1363127824.png",intern=TRUE)) character(0) > try(system("convert tmp/73kn91363127824.ps tmp/73kn91363127824.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.730 0.589 4.304