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(16.68,16.68,16.69,16.61,16.58,16.6,16.6,16.62,16.62,16.6,16.63,16.66,16.66,16.65,16.5,16.39,16.34,16.35,16.35,16.38,16.36,16.38,16.39,16.41,16.41,16.41,16.45,16.41,16.44,16.47,16.47,16.49,16.54,16.62,16.69,16.72,16.72,16.71,16.89,16.93,16.91,16.93,16.93,16.93,16.95,16.93,16.95,16.95,16.95,16.95,16.92,16.91,16.9,16.96,16.96,16.95,16.92,16.87,16.87,16.88,16.88,16.86,16.88,16.88,16.88,16.88,16.88,16.87,16.92,16.94,17.03,17.02) > 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,] 16.68 16.66 16.41 16.72 16.95 16.88 NA [2,] 16.68 16.65 16.41 16.71 16.95 16.86 NA [3,] 16.69 16.50 16.45 16.89 16.92 16.88 NA [4,] 16.61 16.39 16.41 16.93 16.91 16.88 NA [5,] 16.58 16.34 16.44 16.91 16.90 16.88 NA [6,] 16.60 16.35 16.47 16.93 16.96 16.88 NA [7,] 16.60 16.35 16.47 16.93 16.96 16.88 NA [8,] 16.62 16.38 16.49 16.93 16.95 16.87 NA [9,] 16.62 16.36 16.54 16.95 16.92 16.92 NA [10,] 16.60 16.38 16.62 16.93 16.87 16.94 NA [11,] 16.63 16.39 16.69 16.95 16.87 17.03 NA [12,] 16.66 16.41 16.72 16.95 16.88 17.02 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 -0.01 0.00 -0.01 0.00 -0.02 NA [2,] 0.01 -0.15 0.04 0.18 -0.03 0.02 NA [3,] -0.08 -0.11 -0.04 0.04 -0.01 0.00 NA [4,] -0.03 -0.05 0.03 -0.02 -0.01 0.00 NA [5,] 0.02 0.01 0.03 0.02 0.06 0.00 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.02 0.03 0.02 0.00 -0.01 -0.01 NA [8,] 0.00 -0.02 0.05 0.02 -0.03 0.05 NA [9,] -0.02 0.02 0.08 -0.02 -0.05 0.02 NA [10,] 0.03 0.01 0.07 0.02 0.00 0.09 NA [11,] 0.03 0.02 0.03 0.00 0.01 -0.01 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/wessaorg/rcomp/tmp/17vv91362673061.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/25b831362673061.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/32v8d1362673061.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/4hix61362673061.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,] 16.41 16.410 16.450 16.390 16.34 16.35 16.35 16.380 16.36 16.380 16.39 [2,] 16.66 16.650 16.500 16.410 16.44 16.47 16.47 16.490 16.54 16.600 16.63 [3,] 16.70 16.695 16.785 16.745 16.73 16.74 16.74 16.745 16.77 16.745 16.78 [4,] 16.88 16.860 16.890 16.910 16.90 16.93 16.93 16.930 16.92 16.930 16.95 [5,] 16.95 16.950 16.920 16.930 16.91 16.96 16.96 16.950 16.95 16.940 17.03 [,12] [1,] 16.41 [2,] 16.66 [3,] 16.80 [4,] 16.95 [5,] 17.02 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.55809 16.55954 16.53344 16.42248 16.43329 16.44329 16.44329 16.46119 [2,] 16.84191 16.83046 17.03656 17.06752 17.02671 17.03671 17.03671 17.02881 [,9] [,10] [,11] [,12] [1,] 16.52489 16.53214 16.57359 16.61294 [2,] 17.01511 16.95786 16.98641 16.98706 $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(16.41, 16.66, 16.7, 16.88, 16.95, 16.41, 16.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/541cn1362673061.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.020 -0.030 -0.110 -0.050 0.00 0 -0.01 -0.03 -0.05 0.000 -0.010 0 [2,] -0.010 -0.030 -0.080 -0.030 0.01 0 -0.01 -0.02 -0.02 0.010 0.000 0 [3,] -0.005 0.015 -0.025 -0.015 0.02 0 0.01 0.01 0.00 0.025 0.015 0 [4,] 0.000 0.040 0.000 0.000 0.03 0 0.02 0.05 0.02 0.070 0.030 0 [5,] 0.000 0.040 0.040 0.030 0.03 0 0.03 0.05 0.02 0.090 0.030 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.011450323 -0.03015226 -0.07660258 -0.034350969 0.007099354 0 [2,] 0.001450323 0.06015226 0.02660258 0.004350969 0.032900646 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.009350969 -0.03515226 -0.02580129 -0.01370194 -0.004350969 0 [2,] 0.029350969 0.05515226 0.02580129 0.06370194 0.034350969 0 $out [1] -0.15 0.18 0.06 0.08 $group [1] 2 2 5 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0199999999999996, -0.0100000000000016, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6sjm51362673061.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,] 16.58 16.340 16.410 16.89 16.87 16.86 NA [2,] 16.60 16.355 16.425 16.90 16.89 16.88 NA [3,] 16.62 16.385 16.470 16.93 16.92 16.88 NA [4,] 16.67 16.455 16.580 16.94 16.95 16.93 NA [5,] 16.69 16.500 16.720 16.95 16.96 16.94 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 16.58807 16.33939 16.3993 16.91176 16.89263 16.85719 NA [2,] 16.65193 16.43061 16.5407 16.94824 16.94737 16.90281 NA $out [1] 16.66 16.65 16.72 16.71 17.03 17.02 $group [1] 2 2 4 4 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(16.58, 16.6, 16.62, 16.67, 16.69, 16.34, 16.355, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72p9q1362673061.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,] 16.67500 16.695 16.68125 [2,] 16.69833 16.735 16.71000 [3,] 16.71333 16.745 16.72937 [4,] 16.72250 16.775 16.75625 [5,] 16.72333 16.800 16.80375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 16.70231 16.72676 16.70828 [2,] 16.72436 16.76324 16.75047 $out [1] 16.76000 16.77333 $group [1] 1 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16.675, 16.6983333333333, 16.7133333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17vv91362673061.ps tmp/17vv91362673061.png",intern=TRUE)) character(0) > try(system("convert tmp/25b831362673061.ps tmp/25b831362673061.png",intern=TRUE)) character(0) > try(system("convert tmp/32v8d1362673061.ps tmp/32v8d1362673061.png",intern=TRUE)) character(0) > try(system("convert tmp/4hix61362673061.ps tmp/4hix61362673061.png",intern=TRUE)) character(0) > try(system("convert tmp/541cn1362673061.ps tmp/541cn1362673061.png",intern=TRUE)) character(0) > try(system("convert tmp/6sjm51362673061.ps tmp/6sjm51362673061.png",intern=TRUE)) character(0) > try(system("convert tmp/72p9q1362673061.ps tmp/72p9q1362673061.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.415 0.803 5.205