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(2.08,2.09,2.36,2.99,2.75,1.58,1.69,1.3,1.97,1.84,1.96,1.86,2.75,2.62,2.41,3.61,2.03,1.45,1.4,1.3,1.58,2.1,2.27,2.54,2.55,2.05,2.32,2.6,2.1,1.61,1.55,1.12,1.39,2.18,1.94,2.27,2.41,2.2,2.58,2.9,2.12,1.34,1.07,0.86,1,1.54,1.29,1.44,2.6,2.77,3.31,3.2,2.07,1.42,1.43,1.28,1.59,1.68,2.01,2.52,2.74,3.06,2.69,2.32,1.67,1.04,0.98,0.86,0.97,1.3,1.82,1.99,2.7,2.86,2.91,2.56,2.05,1.62,1.26,1.44,1.27,1.64,1.84,2.1,2.79,2.84,2.76,2.67,2.1,1.55,1.42,1.12,1.12,1.41,1.56,1.8) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2.08 2.75 2.55 2.41 2.60 2.74 2.70 2.79 NA [2,] 2.09 2.62 2.05 2.20 2.77 3.06 2.86 2.84 NA [3,] 2.36 2.41 2.32 2.58 3.31 2.69 2.91 2.76 NA [4,] 2.99 3.61 2.60 2.90 3.20 2.32 2.56 2.67 NA [5,] 2.75 2.03 2.10 2.12 2.07 1.67 2.05 2.10 NA [6,] 1.58 1.45 1.61 1.34 1.42 1.04 1.62 1.55 NA [7,] 1.69 1.40 1.55 1.07 1.43 0.98 1.26 1.42 NA [8,] 1.30 1.30 1.12 0.86 1.28 0.86 1.44 1.12 NA [9,] 1.97 1.58 1.39 1.00 1.59 0.97 1.27 1.12 NA [10,] 1.84 2.10 2.18 1.54 1.68 1.30 1.64 1.41 NA [11,] 1.96 2.27 1.94 1.29 2.01 1.82 1.84 1.56 NA [12,] 1.86 2.54 2.27 1.44 2.52 1.99 2.10 1.80 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.01 -0.13 -0.50 -0.21 0.17 0.32 0.16 0.05 NA [2,] 0.27 -0.21 0.27 0.38 0.54 -0.37 0.05 -0.08 NA [3,] 0.63 1.20 0.28 0.32 -0.11 -0.37 -0.35 -0.09 NA [4,] -0.24 -1.58 -0.50 -0.78 -1.13 -0.65 -0.51 -0.57 NA [5,] -1.17 -0.58 -0.49 -0.78 -0.65 -0.63 -0.43 -0.55 NA [6,] 0.11 -0.05 -0.06 -0.27 0.01 -0.06 -0.36 -0.13 NA [7,] -0.39 -0.10 -0.43 -0.21 -0.15 -0.12 0.18 -0.30 NA [8,] 0.67 0.28 0.27 0.14 0.31 0.11 -0.17 0.00 NA [9,] -0.13 0.52 0.79 0.54 0.09 0.33 0.37 0.29 NA [10,] 0.12 0.17 -0.24 -0.25 0.33 0.52 0.20 0.15 NA [11,] -0.10 0.27 0.33 0.15 0.51 0.17 0.26 0.24 NA [12,] 0.89 0.01 0.14 1.16 0.22 0.71 0.69 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/1vp6z1424967564.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/2xy4e1424967564.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/34taj1424967564.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/456mq1424967564.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.410 2.050 2.320 2.320 2.030 1.340 0.980 0.86 0.970 1.300 1.290 1.440 [2,] 2.480 2.145 2.385 2.580 2.040 1.380 1.165 0.99 1.060 1.475 1.690 1.830 [3,] 2.650 2.695 2.635 2.785 2.085 1.500 1.410 1.20 1.330 1.660 1.890 2.045 [4,] 2.745 2.850 2.835 3.095 2.110 1.595 1.490 1.30 1.585 1.970 1.985 2.395 [5,] 2.790 3.060 3.310 3.610 2.120 1.620 1.690 1.44 1.970 2.180 2.270 2.540 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.501967 2.301177 2.383624 2.497314 2.045897 1.379898 1.22845 1.02683 [2,] 2.798033 3.088823 2.886376 3.072686 2.124103 1.620102 1.59155 1.37317 [,9] [,10] [,11] [,12] [1,] 1.036727 1.383486 1.725209 1.729383 [2,] 1.623273 1.936514 2.054791 2.360617 $out [1] 2.08 2.75 1.67 1.04 $group [1] 1 5 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2.41, 2.48, 2.65, 2.745, 2.79, 2.05, 2.145, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59pdf1424967564.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.500 -0.370 -0.370 -1.580 -0.780 -0.36 -0.430 -0.170 -0.13 -0.250 0.15 [2,] -0.170 -0.145 -0.230 -0.955 -0.715 -0.20 -0.345 0.055 0.19 -0.060 0.16 [3,] 0.030 0.160 0.095 -0.610 -0.605 -0.06 -0.180 0.205 0.35 0.160 0.25 [4,] 0.165 0.325 0.475 -0.505 -0.520 -0.02 -0.110 0.295 0.53 0.265 0.30 [5,] 0.320 0.540 1.200 -0.240 -0.430 0.11 0.180 0.310 0.79 0.520 0.51 [,12] [1,] 0.01 [2,] 0.18 [3,] 0.69 [4,] 0.80 [5,] 1.16 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1571358 -0.1025487 -0.2988231 -0.8613765 -0.7139298 -0.16055058 [2,] 0.2171358 0.4225487 0.4888231 -0.3586235 -0.4960702 0.04055058 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.31127437 0.07093255 0.1600711 -0.02154967 0.171794 0.319746 [2,] -0.04872563 0.33906745 0.5399289 0.34154967 0.328206 1.060254 $out [1] -1.17 0.67 -0.10 $group [1] 5 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.5, -0.17, 0.0299999999999998, 0.165, 0.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gpdr1424967564.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] [,9] [1,] 1.300 1.300 1.120 0.860 1.280 0.860 1.260 1.120 NA [2,] 1.765 1.515 1.580 1.180 1.510 1.010 1.530 1.415 NA [3,] 1.965 2.185 2.075 1.490 2.040 1.745 1.945 1.680 NA [4,] 2.225 2.580 2.295 2.305 2.685 2.505 2.630 2.715 NA [5,] 2.750 3.610 2.600 2.900 3.310 3.060 2.910 2.840 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.755191 1.699246 1.748884 0.9768799 1.504075 1.06312 1.443283 1.087061 [2,] 2.174809 2.670754 2.401116 2.0031201 2.575925 2.42688 2.446717 2.272939 [,9] [1,] NA [2,] NA $out [1] 2.99 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(1.3, 1.765, 1.965, 2.225, 2.75, 1.3, 1.515, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ou9u1424967564.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.160000 1.2000 1.177500 [2,] 1.406250 1.4550 1.415000 [3,] 1.950625 1.9675 1.969375 [4,] 2.569375 2.6425 2.553125 [5,] 2.856250 2.7850 2.816250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.420116 1.425873 1.450269 [2,] 2.481134 2.509127 2.488481 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.16, 1.40625, 1.950625, 2.569375, 2.85625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vp6z1424967564.ps tmp/1vp6z1424967564.png",intern=TRUE)) character(0) > try(system("convert tmp/2xy4e1424967564.ps tmp/2xy4e1424967564.png",intern=TRUE)) character(0) > try(system("convert tmp/34taj1424967564.ps tmp/34taj1424967564.png",intern=TRUE)) character(0) > try(system("convert tmp/456mq1424967564.ps tmp/456mq1424967564.png",intern=TRUE)) character(0) > try(system("convert tmp/59pdf1424967564.ps tmp/59pdf1424967564.png",intern=TRUE)) character(0) > try(system("convert tmp/6gpdr1424967564.ps tmp/6gpdr1424967564.png",intern=TRUE)) character(0) > try(system("convert tmp/7ou9u1424967564.ps tmp/7ou9u1424967564.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.455 0.485 2.968