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(1.26,1.27,1.24,1.25,1.27,1.25,1.26,1.27,1.26,1.26,1.28,1.27,1.28,1.27,1.26,1.27,1.27,1.28,1.27,1.26,1.3,1.31,1.28,1.29,1.31,1.29,1.29,1.32,1.3,1.29,1.31,1.29,1.33,1.35,1.32,1.33,1.34,1.34,1.33,1.33,1.35,1.32,1.35,1.32,1.36,1.37,1.34,1.32,1.34,1.32,1.33,1.35,1.33,1.33,1.35,1.33,1.36,1.39,1.37,1.37,1.39,1.37,1.39,1.39,1.39,1.37,1.38,1.37,1.41,1.41,1.42,1.42) > 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,] 1.26 1.28 1.31 1.34 1.34 1.39 NA [2,] 1.27 1.27 1.29 1.34 1.32 1.37 NA [3,] 1.24 1.26 1.29 1.33 1.33 1.39 NA [4,] 1.25 1.27 1.32 1.33 1.35 1.39 NA [5,] 1.27 1.27 1.30 1.35 1.33 1.39 NA [6,] 1.25 1.28 1.29 1.32 1.33 1.37 NA [7,] 1.26 1.27 1.31 1.35 1.35 1.38 NA [8,] 1.27 1.26 1.29 1.32 1.33 1.37 NA [9,] 1.26 1.30 1.33 1.36 1.36 1.41 NA [10,] 1.26 1.31 1.35 1.37 1.39 1.41 NA [11,] 1.28 1.28 1.32 1.34 1.37 1.42 NA [12,] 1.27 1.29 1.33 1.32 1.37 1.42 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 -0.01 -0.02 0.00 -0.02 -0.02 NA [2,] -0.03 -0.01 0.00 -0.01 0.01 0.02 NA [3,] 0.01 0.01 0.03 0.00 0.02 0.00 NA [4,] 0.02 0.00 -0.02 0.02 -0.02 0.00 NA [5,] -0.02 0.01 -0.01 -0.03 0.00 -0.02 NA [6,] 0.01 -0.01 0.02 0.03 0.02 0.01 NA [7,] 0.01 -0.01 -0.02 -0.03 -0.02 -0.01 NA [8,] -0.01 0.04 0.04 0.04 0.03 0.04 NA [9,] 0.00 0.01 0.02 0.01 0.03 0.00 NA [10,] 0.02 -0.03 -0.03 -0.03 -0.02 0.01 NA [11,] -0.01 0.01 0.01 -0.02 0.00 0.00 NA [12,] 0.01 0.02 0.01 0.02 0.02 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/19t2c1356708191.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/2yi821356708191.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/3qyxb1356708191.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/4qmm31356708191.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,] 1.260 1.270 1.24 1.250 1.270 1.250 1.26 1.260 1.260 1.26 1.28 1.270 [2,] 1.280 1.270 1.26 1.270 1.270 1.280 1.27 1.270 1.300 1.31 1.28 1.290 [3,] 1.325 1.305 1.31 1.325 1.315 1.305 1.33 1.305 1.345 1.36 1.33 1.325 [4,] 1.340 1.340 1.33 1.350 1.350 1.330 1.35 1.330 1.360 1.39 1.37 1.370 [5,] 1.390 1.370 1.39 1.390 1.390 1.370 1.38 1.370 1.410 1.41 1.42 1.420 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.286298 1.259848 1.264848 1.273397 1.263397 1.272748 1.278397 1.266298 [2,] 1.363702 1.350152 1.355152 1.376603 1.366603 1.337252 1.381603 1.343702 [,9] [,10] [,11] [,12] [1,] 1.306298 1.308397 1.271947 1.273397 [2,] 1.383702 1.411603 1.388053 1.376603 $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(1.26, 1.28, 1.325, 1.34, 1.39, 1.27, 1.27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5uf701356708191.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.00 -0.02 -0.030 0.010 -0.030 0.03 0.00 -0.030 -0.02 0.01 [2,] -0.020 -0.010 0.00 -0.02 -0.020 0.010 -0.020 0.03 0.00 -0.030 -0.01 0.01 [3,] -0.015 -0.005 0.01 0.00 -0.015 0.015 -0.015 0.04 0.01 -0.025 0.00 0.02 [4,] 0.000 0.010 0.02 0.02 0.000 0.020 -0.010 0.04 0.02 0.010 0.01 0.02 [5,] 0.010 0.020 0.03 0.02 0.010 0.030 -0.010 0.04 0.03 0.020 0.01 0.02 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [1,] -0.027900646 -0.017900646 -0.002900646 -0.02580129 -0.027900646 [2,] -0.002099354 0.007900646 0.022900646 0.02580129 -0.002099354 [,6] [,7] [,8] [,9] [,10] [,11] [1,] 0.008549677 -0.021450323 0.03354968 -0.002900646 -0.050801292 -0.01290065 [2,] 0.021450323 -0.008549677 0.04645032 0.022900646 0.000801292 0.01290065 [,12] [1,] 0.01293403 [2,] 0.02706597 $out [1] -0.01 0.01 -0.01 $group [1] 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.02, -0.02, -0.0149999999999999, 0, 0.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6oty91356708191.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,] 1.240 1.260 1.290 1.320 1.320 1.370 NA [2,] 1.255 1.270 1.290 1.325 1.330 1.375 NA [3,] 1.260 1.275 1.310 1.340 1.345 1.390 NA [4,] 1.270 1.285 1.325 1.350 1.365 1.410 NA [5,] 1.280 1.300 1.350 1.370 1.390 1.420 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.253158 1.268158 1.294036 1.328597 1.329036 1.374036 NA [2,] 1.266842 1.281842 1.325964 1.351403 1.360964 1.405964 NA $out [1] 1.31 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.24, 1.255, 1.26, 1.27, 1.28, 1.26, 1.27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7mpxq1356708191.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,] 1.306667 1.3050 1.29875 [2,] 1.308333 1.3075 1.30500 [3,] 1.319167 1.3250 1.31375 [4,] 1.334167 1.3300 1.32750 [5,] 1.348333 1.3600 1.35250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.307384 1.314738 1.303488 [2,] 1.330949 1.335262 1.324012 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.30666666666667, 1.30833333333333, 1.31916666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19t2c1356708191.ps tmp/19t2c1356708191.png",intern=TRUE)) character(0) > try(system("convert tmp/2yi821356708191.ps tmp/2yi821356708191.png",intern=TRUE)) character(0) > try(system("convert tmp/3qyxb1356708191.ps tmp/3qyxb1356708191.png",intern=TRUE)) character(0) > try(system("convert tmp/4qmm31356708191.ps tmp/4qmm31356708191.png",intern=TRUE)) character(0) > try(system("convert tmp/5uf701356708191.ps tmp/5uf701356708191.png",intern=TRUE)) character(0) > try(system("convert tmp/6oty91356708191.ps tmp/6oty91356708191.png",intern=TRUE)) character(0) > try(system("convert tmp/7mpxq1356708191.ps tmp/7mpxq1356708191.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.616 0.560 4.215