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(9.11,9.06,9.11,9.13,9.13,9.19,9.2,9.23,9.24,9.28,9.32,9.32,9.32,9.36,9.37,9.38,9.41,9.44,9.44,9.44,9.47,9.48,9.56,9.58,9.56,9.58,9.7,9.74,9.76,9.78,9.84,9.88,9.96,9.97,9.96,9.96,9.96,10.02,10.08,10.09,10.12,10.14,10.17,10.22,10.25,10.25,10.26,10.34,10.33,10.3,10.33,10.33,10.37,10.44,10.45,10.45,10.44,10.43,10.4,10.43,10.47,10.52,10.55,10.5,10.44,10.47,10.5,10.54,10.55,10.53,10.54,10.54) > 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,] 9.11 9.32 9.56 9.96 10.33 10.47 NA [2,] 9.06 9.36 9.58 10.02 10.30 10.52 NA [3,] 9.11 9.37 9.70 10.08 10.33 10.55 NA [4,] 9.13 9.38 9.74 10.09 10.33 10.50 NA [5,] 9.13 9.41 9.76 10.12 10.37 10.44 NA [6,] 9.19 9.44 9.78 10.14 10.44 10.47 NA [7,] 9.20 9.44 9.84 10.17 10.45 10.50 NA [8,] 9.23 9.44 9.88 10.22 10.45 10.54 NA [9,] 9.24 9.47 9.96 10.25 10.44 10.55 NA [10,] 9.28 9.48 9.97 10.25 10.43 10.53 NA [11,] 9.32 9.56 9.96 10.26 10.40 10.54 NA [12,] 9.32 9.58 9.96 10.34 10.43 10.54 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.05 0.04 0.02 0.06 -0.03 0.05 NA [2,] 0.05 0.01 0.12 0.06 0.03 0.03 NA [3,] 0.02 0.01 0.04 0.01 0.00 -0.05 NA [4,] 0.00 0.03 0.02 0.03 0.04 -0.06 NA [5,] 0.06 0.03 0.02 0.02 0.07 0.03 NA [6,] 0.01 0.00 0.06 0.03 0.01 0.03 NA [7,] 0.03 0.00 0.04 0.05 0.00 0.04 NA [8,] 0.01 0.03 0.08 0.03 -0.01 0.01 NA [9,] 0.04 0.01 0.01 0.00 -0.01 -0.02 NA [10,] 0.04 0.08 -0.01 0.01 -0.03 0.01 NA [11,] 0.00 0.02 0.00 0.08 0.03 0.00 NA [12,] 0.00 -0.02 0.00 -0.01 0.04 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/12s3p1367568461.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/2vmrx1367568461.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/3px8k1367568461.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/4xd0w1367568461.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] [,12] [1,] 9.11 9.06 9.11 9.130 9.13 9.19 9.200 9.23 9.240 9.28 9.32 9.32 [2,] 9.32 9.36 9.37 9.380 9.41 9.44 9.440 9.44 9.470 9.48 9.56 9.58 [3,] 9.76 9.80 9.89 9.915 9.94 9.96 10.005 10.05 10.105 10.11 10.11 10.15 [4,] 10.33 10.30 10.33 10.330 10.37 10.44 10.450 10.45 10.440 10.43 10.40 10.43 [5,] 10.47 10.52 10.55 10.500 10.44 10.47 10.500 10.54 10.550 10.53 10.54 10.54 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9.108517 9.19367 9.270769 9.302219 9.320769 9.314968 9.353517 [2,] 10.411483 10.40633 10.509231 10.527781 10.559231 10.605032 10.656483 [,8] [,9] [,10] [,11] [,12] [1,] 9.398517 9.479319 9.497219 9.568173 9.601723 [2,] 10.701483 10.730681 10.722781 10.651827 10.698277 $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(9.11, 9.32, 9.76, 10.33, 10.47, 9.06, 9.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56s6x1367568461.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.05 0.01 0.00 0.000 0.02 0.00 0.000 -0.01 -0.020 -0.03 0.00 -0.02 [2,] -0.03 0.03 0.00 0.000 0.02 0.01 0.000 0.01 -0.010 -0.01 0.00 -0.01 [3,] 0.03 0.04 0.01 0.025 0.03 0.02 0.035 0.02 0.005 0.01 0.01 0.00 [4,] 0.05 0.06 0.02 0.030 0.06 0.03 0.040 0.03 0.010 0.04 0.03 0.00 [5,] 0.06 0.06 0.04 0.040 0.07 0.03 0.050 0.03 0.040 0.08 0.03 0.00 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.02160258 0.02064903 -0.002900646 0.005649031 0.004198708 0.007099354 [2,] 0.08160258 0.05935097 0.022900646 0.044350969 0.055801292 0.032900646 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.009198708 0.007099354 -0.007900646 -0.02225161 -0.009350969 -0.007065975 [2,] 0.060801292 0.032900646 0.017900646 0.04225161 0.029350969 0.007065975 $out [1] 0.12 -0.05 -0.06 0.06 0.08 0.08 0.04 $group [1] 2 3 4 6 8 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0499999999999989, -0.0299999999999994, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62xan1367568461.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,] 9.060 9.320 9.56 9.960 10.300 10.440 NA [2,] 9.120 9.375 9.72 10.085 10.330 10.485 NA [3,] 9.195 9.440 9.81 10.155 10.415 10.525 NA [4,] 9.260 9.475 9.96 10.250 10.440 10.540 NA [5,] 9.320 9.580 9.97 10.340 10.450 10.550 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9.131145 9.394389 9.700534 10.07974 10.36483 10.49991 NA [2,] 9.258855 9.485611 9.919466 10.23026 10.46517 10.55009 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(9.06, 9.12, 9.195, 9.26, 9.32, 9.32, 9.375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7hc5o1367568461.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,] 9.791667 9.7600 9.808750 [2,] 9.859167 9.9025 9.865000 [3,] 9.921667 9.9825 9.952500 [4,] 9.987500 10.1075 9.993125 [5,] 10.028333 10.1500 10.041250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.863133 9.888998 9.894061 [2,] 9.980200 10.076002 10.010939 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(9.79166666666667, 9.85916666666667, 9.92166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12s3p1367568461.ps tmp/12s3p1367568461.png",intern=TRUE)) character(0) > try(system("convert tmp/2vmrx1367568461.ps tmp/2vmrx1367568461.png",intern=TRUE)) character(0) > try(system("convert tmp/3px8k1367568461.ps tmp/3px8k1367568461.png",intern=TRUE)) character(0) > try(system("convert tmp/4xd0w1367568461.ps tmp/4xd0w1367568461.png",intern=TRUE)) character(0) > try(system("convert tmp/56s6x1367568461.ps tmp/56s6x1367568461.png",intern=TRUE)) character(0) > try(system("convert tmp/62xan1367568461.ps tmp/62xan1367568461.png",intern=TRUE)) character(0) > try(system("convert tmp/7hc5o1367568461.ps tmp/7hc5o1367568461.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.620 0.840 4.477