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(10.92,10.98,11.15,11.19,11.33,11.38,11.4,11.45,11.56,11.61,11.82,11.77,11.85,11.82,11.92,11.86,11.87,11.94,11.86,11.92,11.83,11.91,11.93,11.99,11.96,12.12,11.85,12.01,12.1,12.21,12.31,12.31,12.39,12.35,12.41,12.51,12.27,12.51,12.44,12.47,12.51,12.58,12.5,12.52,12.59,12.51,12.67,12.64,12.54,12.6,12.67,12.62,12.72,12.85,12.85,12.82,12.79,12.94,12.71,12.56,12.64,12.7,12.74,12.85,12.84,12.83,12.88,13.07,12.99,13.2,13.23,13.18) > 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,] 10.92 11.85 11.96 12.27 12.54 12.64 NA [2,] 10.98 11.82 12.12 12.51 12.60 12.70 NA [3,] 11.15 11.92 11.85 12.44 12.67 12.74 NA [4,] 11.19 11.86 12.01 12.47 12.62 12.85 NA [5,] 11.33 11.87 12.10 12.51 12.72 12.84 NA [6,] 11.38 11.94 12.21 12.58 12.85 12.83 NA [7,] 11.40 11.86 12.31 12.50 12.85 12.88 NA [8,] 11.45 11.92 12.31 12.52 12.82 13.07 NA [9,] 11.56 11.83 12.39 12.59 12.79 12.99 NA [10,] 11.61 11.91 12.35 12.51 12.94 13.20 NA [11,] 11.82 11.93 12.41 12.67 12.71 13.23 NA [12,] 11.77 11.99 12.51 12.64 12.56 13.18 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.06 -0.03 0.16 0.24 0.06 0.06 NA [2,] 0.17 0.10 -0.27 -0.07 0.07 0.04 NA [3,] 0.04 -0.06 0.16 0.03 -0.05 0.11 NA [4,] 0.14 0.01 0.09 0.04 0.10 -0.01 NA [5,] 0.05 0.07 0.11 0.07 0.13 -0.01 NA [6,] 0.02 -0.08 0.10 -0.08 0.00 0.05 NA [7,] 0.05 0.06 0.00 0.02 -0.03 0.19 NA [8,] 0.11 -0.09 0.08 0.07 -0.03 -0.08 NA [9,] 0.05 0.08 -0.04 -0.08 0.15 0.21 NA [10,] 0.21 0.02 0.06 0.16 -0.23 0.03 NA [11,] -0.05 0.06 0.10 -0.03 -0.15 -0.05 NA [12,] 0.08 -0.03 -0.24 -0.10 0.08 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/1lhf11362673301.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/2jabx1362673301.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/3e8cr1362673301.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/46xm11362673301.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] [,10] [,11] [1,] 10.920 10.980 11.15 11.19 11.330 11.380 11.400 11.450 11.56 11.61 11.82 [2,] 11.850 11.820 11.85 11.86 11.870 11.940 11.860 11.920 11.83 11.91 11.93 [3,] 12.115 12.315 12.18 12.24 12.305 12.395 12.405 12.415 12.49 12.43 12.54 [4,] 12.540 12.600 12.67 12.62 12.720 12.830 12.850 12.820 12.79 12.94 12.71 [5,] 12.640 12.700 12.74 12.85 12.840 12.850 12.880 13.070 12.99 13.20 13.23 [,12] [1,] 11.770 [2,] 11.990 [3,] 12.535 [4,] 12.640 [5,] 13.180 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 11.66993 11.81187 11.65107 11.74978 11.75672 11.82092 11.76642 11.83447 [2,] 12.56007 12.81813 12.70893 12.73022 12.85328 12.96908 13.04358 12.99553 [,9] [,10] [,11] [,12] [1,] 11.87077 11.76562 12.03687 12.11573 [2,] 13.10923 13.09438 13.04313 12.95427 $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(10.92, 11.85, 12.115, 12.54, 12.64, 10.98, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54f0q1362673301.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.03 -0.270 -0.060 -0.010 -0.01 -0.08 -0.030 -0.09 -0.080 0.020 -0.15 [2,] 0.06 -0.070 -0.050 0.010 0.05 -0.08 0.000 -0.08 -0.040 0.020 -0.05 [3,] 0.06 0.055 0.035 0.065 0.07 0.01 0.035 0.02 0.065 0.045 -0.04 [4,] 0.16 0.100 0.110 0.100 0.11 0.05 0.060 0.08 0.150 0.160 0.06 [5,] 0.24 0.170 0.160 0.140 0.13 0.10 0.060 0.11 0.210 0.210 0.10 [,12] [1,] -0.24 [2,] -0.10 [3,] -0.03 [4,] 0.08 [5,] 0.08 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.00450323 -0.05465549 -0.06820517 0.006947093 0.03129806 -0.0738542 [2,] 0.12450323 0.16465549 0.13820517 0.123052907 0.10870194 0.0938542 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.003701938 -0.08320517 -0.05755614 -0.04530452 -0.11095355 -0.15718755 [2,] 0.073701938 0.12320517 0.18755614 0.13530452 0.03095355 0.09718755 $out [1] 0.19 -0.23 $group [1] 7 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0299999999999994, 0.0599999999999987, 0.0600000000000005, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68f1n1362673301.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,] 10.920 11.820 11.850 12.440 12.540 12.640 NA [2,] 11.170 11.855 12.055 12.485 12.610 12.785 NA [3,] 11.390 11.890 12.260 12.510 12.715 12.865 NA [4,] 11.585 11.925 12.370 12.585 12.835 13.125 NA [5,] 11.820 11.990 12.510 12.670 12.940 13.230 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 11.20072 11.85807 12.11633 12.46439 12.61238 12.70992 NA [2,] 11.57928 11.92193 12.40367 12.55561 12.81762 13.02008 NA $out [1] 12.27 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(10.92, 11.17, 11.39, 11.585, 11.82, 11.82, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7rlow1362673301.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,] 12.03000 12.1150 12.17500 [2,] 12.14750 12.2725 12.24000 [3,] 12.29917 12.4000 12.36125 [4,] 12.38917 12.4600 12.37813 [5,] 12.46167 12.5400 12.42625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 12.18894 12.31448 12.29825 [2,] 12.40939 12.48552 12.42425 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(12.03, 12.1475, 12.2991666666667, 12.3891666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lhf11362673301.ps tmp/1lhf11362673301.png",intern=TRUE)) character(0) > try(system("convert tmp/2jabx1362673301.ps tmp/2jabx1362673301.png",intern=TRUE)) character(0) > try(system("convert tmp/3e8cr1362673301.ps tmp/3e8cr1362673301.png",intern=TRUE)) character(0) > try(system("convert tmp/46xm11362673301.ps tmp/46xm11362673301.png",intern=TRUE)) character(0) > try(system("convert tmp/54f0q1362673301.ps tmp/54f0q1362673301.png",intern=TRUE)) character(0) > try(system("convert tmp/68f1n1362673301.ps tmp/68f1n1362673301.png",intern=TRUE)) character(0) > try(system("convert tmp/7rlow1362673301.ps tmp/7rlow1362673301.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.387 0.596 3.973