R version 2.15.2 (2012-10-26) -- "Trick or Treat" 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(101.81,101.72,101.78,102.04,102.36,102.56,102.69,102.77,102.85,102.9,102.72,102.79,102.9,102.91,103.29,103.35,102.97,103.05,103.18,103.21,103.32,103.31,103.6,103.68,103.77,103.82,103.86,103.9,103.63,103.65,103.7,103.77,103.94,104.03,104.03,104.29,104.35,104.67,104.73,104.86,104.05,104.15,104.27,104.33,104.41,104.4,104.41,104.6,104.61,104.65,104.55,104.51,104.74,104.89,104.91,104.93,104.95,104.97,105.16,105.29,105.35,105.36,105.45,105.3,105.73,105.86,105.85,105.95,105.97,106.15,105.37,105.39) > 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,] 101.81 102.90 103.77 104.35 104.61 105.35 NA [2,] 101.72 102.91 103.82 104.67 104.65 105.36 NA [3,] 101.78 103.29 103.86 104.73 104.55 105.45 NA [4,] 102.04 103.35 103.90 104.86 104.51 105.30 NA [5,] 102.36 102.97 103.63 104.05 104.74 105.73 NA [6,] 102.56 103.05 103.65 104.15 104.89 105.86 NA [7,] 102.69 103.18 103.70 104.27 104.91 105.85 NA [8,] 102.77 103.21 103.77 104.33 104.93 105.95 NA [9,] 102.85 103.32 103.94 104.41 104.95 105.97 NA [10,] 102.90 103.31 104.03 104.40 104.97 106.15 NA [11,] 102.72 103.60 104.03 104.41 105.16 105.37 NA [12,] 102.79 103.68 104.29 104.60 105.29 105.39 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.09 0.01 0.05 0.32 0.04 0.01 NA [2,] 0.06 0.38 0.04 0.06 -0.10 0.09 NA [3,] 0.26 0.06 0.04 0.13 -0.04 -0.15 NA [4,] 0.32 -0.38 -0.27 -0.81 0.23 0.43 NA [5,] 0.20 0.08 0.02 0.10 0.15 0.13 NA [6,] 0.13 0.13 0.05 0.12 0.02 -0.01 NA [7,] 0.08 0.03 0.07 0.06 0.02 0.10 NA [8,] 0.08 0.11 0.17 0.08 0.02 0.02 NA [9,] 0.05 -0.01 0.09 -0.01 0.02 0.18 NA [10,] -0.18 0.29 0.00 0.01 0.19 -0.78 NA [11,] 0.07 0.08 0.26 0.19 0.13 0.02 NA [12,] 0.11 0.09 0.06 0.01 0.06 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/1i0kv1357677767.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/2hcnf1357677767.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/3g4qc1357677767.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/4f8sn1357677767.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.81 101.720 101.780 102.040 102.36 102.56 102.690 102.77 102.850 [2,] 102.90 102.910 103.290 103.350 102.97 103.05 103.180 103.21 103.320 [3,] 104.06 104.235 104.205 104.205 103.84 103.90 103.985 104.05 104.175 [4,] 104.61 104.670 104.730 104.860 104.74 104.89 104.910 104.93 104.950 [5,] 105.35 105.360 105.450 105.300 105.73 105.86 105.850 105.95 105.970 [,10] [,11] [,12] [1,] 102.900 102.72 102.790 [2,] 103.310 103.60 103.680 [3,] 104.215 104.22 104.445 [4,] 104.970 105.16 105.290 [5,] 106.150 105.37 105.390 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.957 103.0997 103.2762 103.231 102.6983 102.7131 102.8691 102.9405 [2,] 105.163 105.3703 105.1338 105.179 104.9817 105.0869 105.1009 105.1595 [,9] [,10] [,11] [,12] [1,] 103.1236 103.1442 103.2137 103.4065 [2,] 105.2264 105.2858 105.2263 105.4835 $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.81, 102.9, 104.06, 104.61, 105.35, 101.72, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5g7ku1357677767.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.010 0.04 -0.15 -0.81 0.020 -0.010 0.020 0.02 -0.010 -0.180 0.020 0.06 [2,] 0.010 0.04 -0.04 -0.38 0.080 0.020 0.030 0.02 -0.010 -0.180 0.070 0.06 [3,] 0.025 0.06 0.05 -0.02 0.115 0.085 0.065 0.08 0.035 0.005 0.105 0.06 [4,] 0.050 0.09 0.13 0.32 0.150 0.130 0.080 0.11 0.090 0.190 0.190 0.09 [5,] 0.050 0.09 0.26 0.43 0.200 0.130 0.100 0.17 0.180 0.290 0.260 0.11 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.000801292 0.02774839 -0.05965549 -0.4715226 0.06984774 0.01404645 [2,] 0.050801292 0.09225161 0.15965549 0.4315226 0.16015226 0.15595355 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.03274839 0.02194709 -0.02950323 -0.233662 0.02759612 0.03880208 [2,] 0.09725161 0.13805291 0.09950323 0.243662 0.18240388 0.08119792 $out [1] -0.09 0.32 0.38 -0.10 -0.78 0.01 $group [1] 1 1 2 2 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.00999999999999091, 0.00999999999999091, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/62mgu1357677767.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,] 101.720 102.900 103.630 104.050 104.51 105.300 NA [2,] 101.925 103.010 103.735 104.300 104.63 105.365 NA [3,] 102.625 103.250 103.840 104.405 104.90 105.590 NA [4,] 102.780 103.335 103.985 104.635 104.96 105.905 NA [5,] 102.900 103.680 104.290 104.860 105.29 106.150 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 102.235 103.1018 103.726 104.2522 104.7495 105.3437 NA [2,] 103.015 103.3982 103.954 104.5578 105.0505 105.8363 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(101.72, 101.925, 102.625, 102.78, 102.9, 102.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7wmik1357677767.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,] 103.7983 103.8400 103.8312 [2,] 103.9283 104.0175 103.9269 [3,] 104.0633 104.1900 104.0619 [4,] 104.2275 104.2175 104.1519 [5,] 104.3400 104.4450 104.4750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 103.9269 104.0988 103.9593 [2,] 104.1998 104.2812 104.1645 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(103.798333333333, 103.928333333333, 104.063333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1i0kv1357677767.ps tmp/1i0kv1357677767.png",intern=TRUE)) character(0) > try(system("convert tmp/2hcnf1357677767.ps tmp/2hcnf1357677767.png",intern=TRUE)) character(0) > try(system("convert tmp/3g4qc1357677767.ps tmp/3g4qc1357677767.png",intern=TRUE)) character(0) > try(system("convert tmp/4f8sn1357677767.ps tmp/4f8sn1357677767.png",intern=TRUE)) character(0) > try(system("convert tmp/5g7ku1357677767.ps tmp/5g7ku1357677767.png",intern=TRUE)) character(0) > try(system("convert tmp/62mgu1357677767.ps tmp/62mgu1357677767.png",intern=TRUE)) character(0) > try(system("convert tmp/7wmik1357677767.ps tmp/7wmik1357677767.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.586 0.950 4.535