R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing 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(2.58,2.59,2.6,2.6,2.61,2.62,2.64,2.65,2.66,2.67,2.68,2.69,2.69,2.71,2.72,2.73,2.73,2.74,2.74,2.74,2.74,2.74,2.75,2.75,2.75,2.75,2.77,2.78,2.79,2.8,2.82,2.83,2.84,2.87,2.89,2.9,2.9,2.91,2.92,2.92,2.92,2.92,2.94,2.95,2.95,2.97,2.99,3,3,3.01,3.03,3.03,3.04,3.04,3.05,3.05,3.09,3.09,3.09,3.1,3.1,3.11,3.12,3.12,3.12,3.13,3.15,3.16,3.16,3.18,3.19,3.19,3.2,3.21,3.26,3.27,3.28,3.29,3.29,3.3,3.3,3.31,3.31,3.31) > 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,] 2.58 2.69 2.75 2.90 3.00 3.10 3.20 NA [2,] 2.59 2.71 2.75 2.91 3.01 3.11 3.21 NA [3,] 2.60 2.72 2.77 2.92 3.03 3.12 3.26 NA [4,] 2.60 2.73 2.78 2.92 3.03 3.12 3.27 NA [5,] 2.61 2.73 2.79 2.92 3.04 3.12 3.28 NA [6,] 2.62 2.74 2.80 2.92 3.04 3.13 3.29 NA [7,] 2.64 2.74 2.82 2.94 3.05 3.15 3.29 NA [8,] 2.65 2.74 2.83 2.95 3.05 3.16 3.30 NA [9,] 2.66 2.74 2.84 2.95 3.09 3.16 3.30 NA [10,] 2.67 2.74 2.87 2.97 3.09 3.18 3.31 NA [11,] 2.68 2.75 2.89 2.99 3.09 3.19 3.31 NA [12,] 2.69 2.75 2.90 3.00 3.10 3.19 3.31 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.01 0.02 0.00 0.01 0.01 0.01 0.01 NA [2,] 0.01 0.01 0.02 0.01 0.02 0.01 0.05 NA [3,] 0.00 0.01 0.01 0.00 0.00 0.00 0.01 NA [4,] 0.01 0.00 0.01 0.00 0.01 0.00 0.01 NA [5,] 0.01 0.01 0.01 0.00 0.00 0.01 0.01 NA [6,] 0.02 0.00 0.02 0.02 0.01 0.02 0.00 NA [7,] 0.01 0.00 0.01 0.01 0.00 0.01 0.01 NA [8,] 0.01 0.00 0.01 0.00 0.04 0.00 0.00 NA [9,] 0.01 0.00 0.03 0.02 0.00 0.02 0.01 NA [10,] 0.01 0.01 0.02 0.02 0.00 0.01 0.00 NA [11,] 0.01 0.00 0.01 0.01 0.01 0.00 0.00 NA [12,] 0.00 0.00 0.00 0.00 0.00 0.01 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/1dldu1400671748.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/27sgt1400671748.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/3q3js1400671748.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/43v3p1400671748.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,] 2.58 2.59 2.600 2.600 2.61 2.620 2.64 2.650 2.660 2.670 2.68 2.690 [2,] 2.72 2.73 2.745 2.755 2.76 2.770 2.78 2.785 2.790 2.805 2.82 2.825 [3,] 2.90 2.91 2.920 2.920 2.92 2.920 2.94 2.950 2.950 2.970 2.99 3.000 [4,] 3.05 3.06 3.075 3.075 3.08 3.085 3.10 3.105 3.125 3.135 3.14 3.145 [5,] 3.20 3.21 3.260 3.270 3.28 3.290 3.29 3.300 3.300 3.310 3.31 3.310 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.702929 2.712929 2.722929 2.728901 2.728901 2.731887 2.748901 2.758901 [2,] 3.097071 3.107071 3.117071 3.111099 3.111099 3.108113 3.131099 3.141099 [,9] [,10] [,11] [,12] [1,] 2.749943 2.772929 2.798901 2.808901 [2,] 3.150057 3.167071 3.181099 3.191099 $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(2.58, 2.72, 2.9, 3.05, 3.2, 2.59, 2.73, 2.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58rp41400671748.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.01 0.01 0.00 0.00 0.000 0.000 0.000 0.00 0.000 0.000 0.00 0 [2,] 0.01 0.01 0.00 0.00 0.005 0.005 0.005 0.00 0.005 0.005 0.00 0 [3,] 0.01 0.01 0.00 0.01 0.010 0.020 0.010 0.00 0.010 0.010 0.01 0 [4,] 0.01 0.02 0.01 0.01 0.010 0.020 0.010 0.01 0.020 0.015 0.01 0 [5,] 0.01 0.02 0.01 0.01 0.010 0.020 0.010 0.01 0.030 0.020 0.01 0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.01 0.004028161 -0.005971839 0.004028161 0.007014081 0.01104224 [2,] 0.01 0.015971839 0.005971839 0.015971839 0.012985919 0.02895776 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.007014081 -0.005971839 0.001042242 0.004028161 0.004028161 0 [2,] 0.012985919 0.005971839 0.018957758 0.015971839 0.015971839 0 $out [1] 0.02 0.00 0.05 0.04 0.01 $group [1] 1 1 2 8 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.00999999999999979, 0.00999999999999979, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ce1d1400671748.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,] 2.580 2.710 2.750 2.90 3.000 3.10 3.210 NA [2,] 2.600 2.725 2.775 2.92 3.030 3.12 3.265 NA [3,] 2.630 2.740 2.810 2.93 3.045 3.14 3.290 NA [4,] 2.665 2.740 2.855 2.96 3.090 3.17 3.305 NA [5,] 2.690 2.750 2.900 3.00 3.100 3.19 3.310 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.600353 2.733158 2.773511 2.911756 3.017634 3.117195 3.271756 NA [2,] 2.659647 2.746842 2.846489 2.948244 3.072366 3.162805 3.308244 NA $out [1] 2.69 3.20 $group [1] 2 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(2.58, 2.6, 2.63, 2.665, 2.69, 2.71, 2.725, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/77tf11400671748.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,] 2.888571 2.90 2.88500 [2,] 2.919286 2.92 2.91250 [3,] 2.940714 2.93 2.93375 [4,] 2.969286 2.96 2.96375 [5,] 2.991429 3.00 2.98500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.917909 2.911756 2.910375 [2,] 2.963520 2.948244 2.957125 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2.88857142857143, 2.91928571428571, 2.94071428571429, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1dldu1400671748.ps tmp/1dldu1400671748.png",intern=TRUE)) character(0) > try(system("convert tmp/27sgt1400671748.ps tmp/27sgt1400671748.png",intern=TRUE)) character(0) > try(system("convert tmp/3q3js1400671748.ps tmp/3q3js1400671748.png",intern=TRUE)) character(0) > try(system("convert tmp/43v3p1400671748.ps tmp/43v3p1400671748.png",intern=TRUE)) character(0) > try(system("convert tmp/58rp41400671748.ps tmp/58rp41400671748.png",intern=TRUE)) character(0) > try(system("convert tmp/6ce1d1400671748.ps tmp/6ce1d1400671748.png",intern=TRUE)) character(0) > try(system("convert tmp/77tf11400671748.ps tmp/77tf11400671748.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.179 0.549 3.780