R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(1.65,1.66,1.66,1.67,1.68,1.68,1.68,1.68,1.69,1.7,1.7,1.71,1.72,1.73,1.74,1.74,1.75,1.75,1.75,1.76,1.79,1.83,1.84,1.85,1.87,1.87,1.87,1.88,1.88,1.88,1.88,1.89,1.89,1.89,1.9,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.9,1.9,1.92,1.93,1.92,1.95,1.96,1.96,1.96,1.96,1.96,1.97,1.97,1.97,1.97,1.97,1.97,1.98,1.98,1.98,1.98,1.98,1.98,1.97,1.98,1.98,1.99,2,2) > 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,] 1.65 1.72 1.87 1.89 1.89 1.95 1.98 NA [2,] 1.66 1.73 1.87 1.89 1.89 1.96 1.98 NA [3,] 1.66 1.74 1.87 1.89 1.89 1.96 1.98 NA [4,] 1.67 1.74 1.88 1.89 1.89 1.96 1.98 NA [5,] 1.68 1.75 1.88 1.89 1.89 1.96 1.98 NA [6,] 1.68 1.75 1.88 1.89 1.89 1.96 1.98 NA [7,] 1.68 1.75 1.88 1.89 1.89 1.97 1.97 NA [8,] 1.68 1.76 1.89 1.89 1.90 1.97 1.98 NA [9,] 1.69 1.79 1.89 1.89 1.90 1.97 1.98 NA [10,] 1.70 1.83 1.89 1.89 1.92 1.97 1.99 NA [11,] 1.70 1.84 1.90 1.89 1.93 1.97 2.00 NA [12,] 1.71 1.85 1.89 1.89 1.92 1.97 2.00 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.01 0.01 0.00 0 0.00 0.01 0.00 NA [2,] 0.00 0.01 0.00 0 0.00 0.00 0.00 NA [3,] 0.01 0.00 0.01 0 0.00 0.00 0.00 NA [4,] 0.01 0.01 0.00 0 0.00 0.00 0.00 NA [5,] 0.00 0.00 0.00 0 0.00 0.00 0.00 NA [6,] 0.00 0.00 0.00 0 0.00 0.01 -0.01 NA [7,] 0.00 0.01 0.01 0 0.01 0.00 0.01 NA [8,] 0.01 0.03 0.00 0 0.00 0.00 0.00 NA [9,] 0.01 0.04 0.00 0 0.02 0.00 0.01 NA [10,] 0.00 0.01 0.01 0 0.01 0.00 0.01 NA [11,] 0.01 0.01 -0.01 0 -0.01 0.00 0.00 NA [12,] 0.01 0.02 0.00 0 0.03 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/1xp7o1381738616.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/2f5e11381738616.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/3uffm1381738616.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/4uvug1381738616.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.650 1.660 1.660 1.670 1.680 1.680 1.680 1.680 1.790 1.830 1.840 1.850 [2,] 1.795 1.800 1.805 1.810 1.815 1.815 1.815 1.825 1.840 1.860 1.865 1.870 [3,] 1.890 1.890 1.890 1.890 1.890 1.890 1.890 1.890 1.890 1.890 1.900 1.890 [4,] 1.920 1.925 1.925 1.925 1.925 1.925 1.930 1.935 1.935 1.945 1.950 1.945 [5,] 1.980 1.980 1.980 1.980 1.980 1.980 1.970 1.980 1.980 1.990 2.000 2.000 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.815352 1.815352 1.818338 1.821324 1.82431 1.82431 1.821324 1.82431 [2,] 1.964648 1.964648 1.961662 1.958676 1.95569 1.95569 1.958676 1.95569 [,9] [,10] [,11] [,12] [1,] 1.833268 1.839239 1.849239 1.845211 [2,] 1.946732 1.940761 1.950761 1.934789 $out [1] 1.69 1.70 1.70 1.71 $group [1] 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(1.65, 1.795, 1.89, 1.92, 1.98, 1.66, 1.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5lx9i1381738616.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.00 0 0.000 0.000 0 0 0.00 0.000 0.000 0.00 -0.010 0.00 [2,] 0.00 0 0.000 0.000 0 0 0.00 0.000 0.000 0.00 -0.005 0.00 [3,] 0.00 0 0.000 0.000 0 0 0.01 0.000 0.010 0.01 0.000 0.01 [4,] 0.01 0 0.005 0.005 0 0 0.01 0.005 0.015 0.01 0.005 0.02 [5,] 0.01 0 0.010 0.010 0 0 0.01 0.010 0.020 0.01 0.010 0.03 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.005971839 0 -0.002985919 -0.002985919 0 0 0.004028161 [2,] 0.005971839 0 0.002985919 0.002985919 0 0 0.015971839 [,8] [,9] [,10] [,11] [,12] [1,] -0.002985919 0.001042242 0.004028161 -0.005971839 -0.002900646 [2,] 0.002985919 0.018957758 0.015971839 0.005971839 0.022900646 $out [1] 0.01 0.01 -0.01 0.03 0.04 $group [1] 2 6 6 8 9 $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.01, 0.01, 0, 0, 0, 0, 0, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rpa41381738616.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,] 1.650 1.72 1.870 1.89 1.89 1.950 1.980 NA [2,] 1.665 1.74 1.875 1.89 1.89 1.960 1.980 NA [3,] 1.680 1.75 1.880 1.89 1.89 1.965 1.980 NA [4,] 1.695 1.81 1.890 1.89 1.91 1.970 1.985 NA [5,] 1.710 1.85 1.900 1.89 1.93 1.970 1.990 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.666317 1.718073 1.873158 1.89 1.880878 1.960439 1.977719 NA [2,] 1.693683 1.781927 1.886842 1.89 1.899122 1.969561 1.982281 NA $out [1] 1.97 2.00 2.00 $group [1] 7 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.65, 1.665, 1.68, 1.695, 1.71, 1.72, 1.74, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ru6a1381738616.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.850000 1.89 1.85750 [2,] 1.857143 1.89 1.86625 [3,] 1.861429 1.89 1.87125 [4,] 1.878571 1.89 1.89500 [5,] 1.890000 1.89 1.90750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.851655 1.89 1.858137 [2,] 1.871202 1.89 1.884363 $out [1] 1.9 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.85, 1.85714285714286, 1.86142857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1xp7o1381738616.ps tmp/1xp7o1381738616.png",intern=TRUE)) character(0) > try(system("convert tmp/2f5e11381738616.ps tmp/2f5e11381738616.png",intern=TRUE)) character(0) > try(system("convert tmp/3uffm1381738616.ps tmp/3uffm1381738616.png",intern=TRUE)) character(0) > try(system("convert tmp/4uvug1381738616.ps tmp/4uvug1381738616.png",intern=TRUE)) character(0) > try(system("convert tmp/5lx9i1381738616.ps tmp/5lx9i1381738616.png",intern=TRUE)) character(0) > try(system("convert tmp/6rpa41381738616.ps tmp/6rpa41381738616.png",intern=TRUE)) character(0) > try(system("convert tmp/7ru6a1381738616.ps tmp/7ru6a1381738616.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.349 1.115 6.444