R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(4.8,4.81,5.16,5.26,5.29,5.29,5.29,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.35,5.44,5.47,5.47,5.48,5.48,5.48,5.48,5.48,5.48,5.48,5.5,5.55,5.57,5.58,5.58,5.58,5.59,5.59,5.59,5.55,5.61,5.61,5.61,5.63,5.69,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.71,5.74,5.77,5.79,5.79,5.8,5.8,5.8,5.8,5.8,5.81,5.81,5.83,5.94,5.98,5.99,6,6.02,6.02,6.02,6.02,6.02,6.02,6.02,6.04,6.06,6.06,6.07,6.14,6.19,6.2,6.22,6.22) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 4.80 5.30 5.48 5.61 5.70 5.80 6.02 NA [2,] 4.81 5.30 5.48 5.61 5.70 5.81 6.02 NA [3,] 5.16 5.30 5.50 5.61 5.70 5.81 6.02 NA [4,] 5.26 5.35 5.55 5.63 5.71 5.83 6.04 NA [5,] 5.29 5.44 5.57 5.69 5.74 5.94 6.06 NA [6,] 5.29 5.47 5.58 5.70 5.77 5.98 6.06 NA [7,] 5.29 5.47 5.58 5.70 5.79 5.99 6.07 NA [8,] 5.30 5.48 5.58 5.70 5.79 6.00 6.14 NA [9,] 5.30 5.48 5.59 5.70 5.80 6.02 6.19 NA [10,] 5.30 5.48 5.59 5.70 5.80 6.02 6.20 NA [11,] 5.30 5.48 5.59 5.70 5.80 6.02 6.22 NA [12,] 5.30 5.48 5.55 5.70 5.80 6.02 6.22 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.01 0.00 0.00 0.00 0.00 0.01 0.00 NA [2,] 0.35 0.00 0.02 0.00 0.00 0.00 0.00 NA [3,] 0.10 0.05 0.05 0.02 0.01 0.02 0.02 NA [4,] 0.03 0.09 0.02 0.06 0.03 0.11 0.02 NA [5,] 0.00 0.03 0.01 0.01 0.03 0.04 0.00 NA [6,] 0.00 0.00 0.00 0.00 0.02 0.01 0.01 NA [7,] 0.01 0.01 0.00 0.00 0.00 0.01 0.07 NA [8,] 0.00 0.00 0.01 0.00 0.01 0.02 0.05 NA [9,] 0.00 0.00 0.00 0.00 0.00 0.00 0.01 NA [10,] 0.00 0.00 0.00 0.00 0.00 0.00 0.02 NA [11,] 0.00 0.00 -0.04 0.00 0.00 0.00 0.00 NA [12,] 0.00 0.00 0.06 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/1np0i1424702922.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/2r6nj1424702922.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/3an7f1424702922.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/4ggkd1424702922.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,] 5.30 5.300 5.160 5.26 5.290 5.290 5.290 5.300 5.300 5.300 5.300 5.300 [2,] 5.39 5.390 5.400 5.45 5.505 5.525 5.525 5.530 5.535 5.535 5.535 5.515 [3,] 5.61 5.610 5.610 5.63 5.690 5.700 5.700 5.700 5.700 5.700 5.700 5.700 [4,] 5.75 5.755 5.755 5.77 5.840 5.875 5.890 5.895 5.910 5.910 5.910 5.910 [5,] 6.02 6.020 6.020 6.04 6.060 6.060 6.070 6.140 6.190 6.200 6.220 6.220 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5.395014 5.392028 5.398 5.438901 5.489943 5.490986 5.482028 5.482028 [2,] 5.824986 5.827972 5.822 5.821099 5.890057 5.909014 5.917972 5.917972 [,9] [,10] [,11] [,12] [1,] 5.476056 5.476056 5.476056 5.464112 [2,] 5.923944 5.923944 5.923944 5.935888 $out [1] 4.80 4.81 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(5.3, 5.39, 5.61, 5.75, 6.02, 5.3, 5.39, 5.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qpxn1424702922.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.000 0.00 0.01 0.020 0.000 0.00 0.00 0.000 0 0 0 0 [2,] 0.000 0.00 0.02 0.025 0.005 0.00 0.00 0.000 0 0 0 0 [3,] 0.000 0.00 0.02 0.030 0.010 0.00 0.01 0.010 0 0 0 0 [4,] 0.005 0.01 0.05 0.075 0.030 0.01 0.01 0.015 0 0 0 0 [5,] 0.010 0.02 0.05 0.110 0.040 0.02 0.01 0.020 0 0 0 0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [1,] -0.002985919 -0.005971839 0.002084484 0.0001408066 -0.004929597 [2,] 0.002985919 0.005971839 0.037915516 0.0598591934 0.024929597 [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.005971839 0.004028161 0.001042242 0 0 0 0 [2,] 0.005971839 0.015971839 0.018957758 0 0 0 0 $out [1] 0.35 0.10 0.07 0.05 0.01 0.02 -0.04 0.06 $group [1] 2 3 7 8 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 0.00499999999999989, 0.00999999999999979, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6z51f1424702922.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] [,8] [1,] 5.16 5.300 5.480 5.61 5.700 5.800 6.020 NA [2,] 5.21 5.325 5.525 5.62 5.705 5.820 6.030 NA [3,] 5.29 5.470 5.575 5.70 5.780 5.985 6.065 NA [4,] 5.30 5.480 5.585 5.70 5.800 6.020 6.195 NA [5,] 5.30 5.480 5.590 5.70 5.800 6.020 6.220 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5.24895 5.399303 5.547634 5.663511 5.73667 5.893779 5.989742 NA [2,] 5.33105 5.540697 5.602366 5.736489 5.82333 6.076221 6.140258 NA $out [1] 4.80 4.81 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(5.16, 5.21, 5.29, 5.3, 5.3, 5.3, 5.325, 5.47, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7nwtl1424702922.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,] 5.530000 5.61 5.57000 [2,] 5.605000 5.62 5.59375 [3,] 5.695714 5.70 5.70375 [4,] 5.725000 5.70 5.71750 [5,] 5.730000 5.70 5.72250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.640981 5.663511 5.647307 [2,] 5.750447 5.736489 5.760193 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(5.53, 5.605, 5.69571428571429, 5.725, 5.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1np0i1424702922.ps tmp/1np0i1424702922.png",intern=TRUE)) character(0) > try(system("convert tmp/2r6nj1424702922.ps tmp/2r6nj1424702922.png",intern=TRUE)) character(0) > try(system("convert tmp/3an7f1424702922.ps tmp/3an7f1424702922.png",intern=TRUE)) character(0) > try(system("convert tmp/4ggkd1424702922.ps tmp/4ggkd1424702922.png",intern=TRUE)) character(0) > try(system("convert tmp/5qpxn1424702922.ps tmp/5qpxn1424702922.png",intern=TRUE)) character(0) > try(system("convert tmp/6z51f1424702922.ps tmp/6z51f1424702922.png",intern=TRUE)) character(0) > try(system("convert tmp/7nwtl1424702922.ps tmp/7nwtl1424702922.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.615 0.429 3.066