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(16.68,16.68,16.69,16.61,16.58,16.6,16.6,16.62,16.62,16.6,16.63,16.66,16.66,16.65,16.5,16.39,16.34,16.35,16.35,16.38,16.36,16.38,16.39,16.41,16.41,16.41,16.45,16.41,16.44,16.47,16.47,16.49,16.54,16.62,16.69,16.72,16.72,16.71,16.89,16.93,16.91,16.93,16.93,16.93,16.95,16.93,16.95,16.95,16.95,16.95,16.92,16.91,16.9,16.96,16.96,16.95,16.92,16.87,16.87,16.88,16.88,16.86,16.88,16.88,16.88,16.88,16.88,16.87,16.92,16.94,17.03,17.02,17.02,17.02,16.99,17.03,16.98,16.89,16.89,16.9,16.89,16.96,16.97,16.97) > 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,] 16.68 16.66 16.41 16.72 16.95 16.88 17.02 NA [2,] 16.68 16.65 16.41 16.71 16.95 16.86 17.02 NA [3,] 16.69 16.50 16.45 16.89 16.92 16.88 16.99 NA [4,] 16.61 16.39 16.41 16.93 16.91 16.88 17.03 NA [5,] 16.58 16.34 16.44 16.91 16.90 16.88 16.98 NA [6,] 16.60 16.35 16.47 16.93 16.96 16.88 16.89 NA [7,] 16.60 16.35 16.47 16.93 16.96 16.88 16.89 NA [8,] 16.62 16.38 16.49 16.93 16.95 16.87 16.90 NA [9,] 16.62 16.36 16.54 16.95 16.92 16.92 16.89 NA [10,] 16.60 16.38 16.62 16.93 16.87 16.94 16.96 NA [11,] 16.63 16.39 16.69 16.95 16.87 17.03 16.97 NA [12,] 16.66 16.41 16.72 16.95 16.88 17.02 16.97 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.00 -0.01 0.00 -0.01 0.00 -0.02 0.00 NA [2,] 0.01 -0.15 0.04 0.18 -0.03 0.02 -0.03 NA [3,] -0.08 -0.11 -0.04 0.04 -0.01 0.00 0.04 NA [4,] -0.03 -0.05 0.03 -0.02 -0.01 0.00 -0.05 NA [5,] 0.02 0.01 0.03 0.02 0.06 0.00 -0.09 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.02 0.03 0.02 0.00 -0.01 -0.01 0.01 NA [8,] 0.00 -0.02 0.05 0.02 -0.03 0.05 -0.01 NA [9,] -0.02 0.02 0.08 -0.02 -0.05 0.02 0.07 NA [10,] 0.03 0.01 0.07 0.02 0.00 0.09 0.01 NA [11,] 0.03 0.02 0.03 0.00 0.01 -0.01 0.00 NA [12,] 0.00 0.00 0.00 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/fisher/rcomp/tmp/1fgr51381924182.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/fisher/rcomp/tmp/2layd1381924182.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/fisher/rcomp/tmp/31fgg1381924182.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/fisher/rcomp/tmp/4fh081381924182.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] [1,] 16.410 16.410 16.450 16.39 16.340 16.350 16.350 16.380 16.36 16.380 16.39 [2,] 16.670 16.665 16.595 16.51 16.510 16.535 16.535 16.555 16.58 16.610 16.66 [3,] 16.720 16.710 16.880 16.88 16.880 16.880 16.880 16.870 16.89 16.870 16.87 [4,] 16.915 16.905 16.905 16.92 16.905 16.910 16.910 16.915 16.92 16.935 16.96 [5,] 17.020 17.020 16.990 17.03 16.980 16.960 16.960 16.950 16.95 16.960 17.03 [,12] [1,] 16.41 [2,] 16.69 [3,] 16.88 [4,] 16.96 [5,] 17.02 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.57369 16.56668 16.69487 16.63515 16.64411 16.65606 16.65606 16.65501 [2,] 16.86631 16.85332 17.06513 17.12485 17.11589 17.10394 17.10394 17.08499 [,9] [,10] [,11] [,12] [1,] 16.68696 16.67592 16.69084 16.71876 [2,] 17.09304 17.06408 17.04916 17.04124 $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(16.41, 16.67, 16.72, 16.915, 17.02, 16.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5p7s11381924182.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] [1,] -0.02 -0.03 -0.11 -0.050 0.000 0 -0.010 -0.030 -0.050 0.00 -0.010 [2,] -0.01 -0.03 -0.06 -0.040 0.005 0 -0.005 -0.015 -0.020 0.01 0.000 [3,] 0.00 0.01 -0.01 -0.020 0.020 0 0.010 0.000 0.020 0.02 0.010 [4,] 0.00 0.03 0.02 -0.005 0.025 0 0.020 0.035 0.045 0.05 0.025 [5,] 0.00 0.04 0.04 0.030 0.030 0 0.030 0.050 0.080 0.09 0.030 [,12] [1,] 0 [2,] 0 [3,] 0 [4,] 0 [5,] 0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.005971839 -0.02583103 -0.05777471 -0.0409014354 0.008056323 0 [2,] 0.005971839 0.04583103 0.03777471 0.0009014354 0.031943677 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.004929597 -0.02985919 -0.01881695 -0.003887355 -0.004929597 0 [2,] 0.024929597 0.02985919 0.05881695 0.043887355 0.024929597 0 $out [1] -0.15 0.18 0.06 -0.09 $group [1] 2 2 5 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0199999999999996, -0.00999999999999979, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6z8v01381924182.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,] 16.58 16.340 16.410 16.89 16.87 16.86 16.890 NA [2,] 16.60 16.355 16.425 16.90 16.89 16.88 16.895 NA [3,] 16.62 16.385 16.470 16.93 16.92 16.88 16.970 NA [4,] 16.67 16.455 16.580 16.94 16.95 16.93 17.005 NA [5,] 16.69 16.500 16.720 16.95 16.96 16.94 17.030 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.58807 16.33939 16.3993 16.91176 16.89263 16.85719 16.91983 NA [2,] 16.65193 16.43061 16.5407 16.94824 16.94737 16.90281 17.02017 NA $out [1] 16.66 16.65 16.72 16.71 17.03 17.02 $group [1] 2 2 4 4 6 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(16.58, 16.6, 16.62, 16.67, 16.69, 16.34, 16.355, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7hret1381924182.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,] 16.71857 16.87 16.70750 [2,] 16.73000 16.87 16.72250 [3,] 16.74857 16.88 16.75000 [4,] 16.76000 16.88 16.78875 [5,] 16.80143 16.89 16.82500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 16.73489 16.87544 16.71978 [2,] 16.76225 16.88456 16.78022 $out [1] 16.72 16.71 $group [1] 2 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16.7185714285714, 16.73, 16.7485714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fgr51381924182.ps tmp/1fgr51381924182.png",intern=TRUE)) character(0) > try(system("convert tmp/2layd1381924182.ps tmp/2layd1381924182.png",intern=TRUE)) character(0) > try(system("convert tmp/31fgg1381924182.ps tmp/31fgg1381924182.png",intern=TRUE)) character(0) > try(system("convert tmp/4fh081381924182.ps tmp/4fh081381924182.png",intern=TRUE)) character(0) > try(system("convert tmp/5p7s11381924182.ps tmp/5p7s11381924182.png",intern=TRUE)) character(0) > try(system("convert tmp/6z8v01381924182.ps tmp/6z8v01381924182.png",intern=TRUE)) character(0) > try(system("convert tmp/7hret1381924182.ps tmp/7hret1381924182.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.102 0.525 3.620