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(28.33,28.67,28.81,28.99,29.16,29.25,29.25,29.38,29.48,29.65,29.69,29.73,29.81,30.05,30.29,30.37,30.50,30.67,30.72,30.73,30.76,30.82,30.84,30.86,30.92,30.95,30.97,30.99,31.09,31.18,31.19,31.20,31.31,31.34,31.35,31.36,31.37,31.37,31.39,31.39,31.42,31.47,31.48,31.51,31.54,31.55,31.55,31.57,31.66,31.68,31.70,31.70,31.73,31.74,31.75,31.78,31.80,31.82,31.82,31.90) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 28.33 29.81 30.92 31.37 31.66 NA [2,] 28.67 30.05 30.95 31.37 31.68 NA [3,] 28.81 30.29 30.97 31.39 31.70 NA [4,] 28.99 30.37 30.99 31.39 31.70 NA [5,] 29.16 30.50 31.09 31.42 31.73 NA [6,] 29.25 30.67 31.18 31.47 31.74 NA [7,] 29.25 30.72 31.19 31.48 31.75 NA [8,] 29.38 30.73 31.20 31.51 31.78 NA [9,] 29.48 30.76 31.31 31.54 31.80 NA [10,] 29.65 30.82 31.34 31.55 31.82 NA [11,] 29.69 30.84 31.35 31.55 31.82 NA [12,] 29.73 30.86 31.36 31.57 31.90 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.34 0.24 0.03 0.00 0.02 NA [2,] 0.14 0.24 0.02 0.02 0.02 NA [3,] 0.18 0.08 0.02 0.00 0.00 NA [4,] 0.17 0.13 0.10 0.03 0.03 NA [5,] 0.09 0.17 0.09 0.05 0.01 NA [6,] 0.00 0.05 0.01 0.01 0.01 NA [7,] 0.13 0.01 0.01 0.03 0.03 NA [8,] 0.10 0.03 0.11 0.03 0.02 NA [9,] 0.17 0.06 0.03 0.01 0.02 NA [10,] 0.04 0.02 0.01 0.00 0.00 NA [11,] 0.04 0.02 0.01 0.02 0.08 NA [12,] 0.08 0.06 0.01 0.09 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/16ket1393752577.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/2noaf1393752577.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/3d8671393752577.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/4m4j11393752577.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,] 28.33 28.67 28.81 28.99 29.16 30.67 30.72 30.73 30.76 30.82 30.84 30.86 [2,] 29.81 30.05 30.29 30.37 30.50 30.67 30.72 30.73 30.76 30.82 30.84 30.86 [3,] 30.92 30.95 30.97 30.99 31.09 31.18 31.19 31.20 31.31 31.34 31.35 31.36 [4,] 31.37 31.37 31.39 31.39 31.42 31.47 31.48 31.51 31.54 31.55 31.55 31.57 [5,] 31.66 31.68 31.70 31.70 31.73 31.74 31.75 31.78 31.80 31.82 31.82 31.90 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 29.81771 30.01729 30.19274 30.26927 30.43993 30.61472 30.65299 30.64885 [2,] 32.02229 31.88271 31.74726 31.71073 31.74007 31.74528 31.72701 31.75115 [,9] [,10] [,11] [,12] [1,] 30.75885 30.82418 30.84832 30.85832 [2,] 31.86115 31.85582 31.85168 31.86168 $out [1] 29.25 29.25 29.38 29.48 29.65 29.69 29.73 $group [1] 6 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(28.33, 29.81, 30.92, 31.37, 31.66, 28.67, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o27d1393752577.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.02 0.00 0.03 0.01 0.01 0.01 0.02 0.01 0.00 0.01 0.010 [2,] 0.02 0.02 0.00 0.03 0.05 0.01 0.01 0.03 0.02 0.00 0.02 0.035 [3,] 0.03 0.02 0.02 0.10 0.09 0.01 0.03 0.03 0.03 0.01 0.02 0.070 [4,] 0.24 0.14 0.08 0.13 0.09 0.01 0.03 0.10 0.06 0.02 0.04 0.085 [5,] 0.34 0.24 0.18 0.17 0.09 0.01 0.03 0.11 0.06 0.04 0.04 0.090 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.1254514 -0.0647917 -0.0365278 0.02934025 0.0617361 0.01 0.01586805 [2,] 0.1854514 0.1047917 0.0765278 0.17065975 0.1182639 0.01 0.04413195 [,8] [,9] [,10] [,11] [,12] [1,] -0.01946182 0.001736101 -0.00413195 0.00586805 0.0305 [2,] 0.07946182 0.058263899 0.02413195 0.03413195 0.1095 $out [1] 0.17 0.00 0.05 0.13 0.17 0.08 $group [1] 5 6 6 7 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0.0199999999999996, 0.0299999999999976, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68ro21393752577.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] [1,] 28.330 29.810 30.920 31.370 31.660 NA [2,] 28.900 30.330 30.980 31.390 31.700 NA [3,] 29.250 30.695 31.185 31.475 31.745 NA [4,] 29.565 30.790 31.325 31.545 31.810 NA [5,] 29.730 30.860 31.360 31.570 31.900 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 28.94669 30.48519 31.02764 31.4043 31.69483 NA [2,] 29.55331 30.90481 31.34236 31.5457 31.79517 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(28.33, 28.9, 29.25, 29.565, 29.73, 29.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7pxsk1393752577.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,] 30.418 30.920 30.5900 [2,] 30.660 30.980 30.8600 [3,] 30.870 31.185 31.0850 [4,] 31.007 31.325 31.1675 [5,] 31.084 31.360 31.2150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 30.71173 31.02764 30.94475 [2,] 31.02827 31.34236 31.22525 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(30.418, 30.66, 30.87, 31.007, 31.084, 30.92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16ket1393752577.ps tmp/16ket1393752577.png",intern=TRUE)) character(0) > try(system("convert tmp/2noaf1393752577.ps tmp/2noaf1393752577.png",intern=TRUE)) character(0) > try(system("convert tmp/3d8671393752577.ps tmp/3d8671393752577.png",intern=TRUE)) character(0) > try(system("convert tmp/4m4j11393752577.ps tmp/4m4j11393752577.png",intern=TRUE)) character(0) > try(system("convert tmp/5o27d1393752577.ps tmp/5o27d1393752577.png",intern=TRUE)) character(0) > try(system("convert tmp/68ro21393752577.ps tmp/68ro21393752577.png",intern=TRUE)) character(0) > try(system("convert tmp/7pxsk1393752577.ps tmp/7pxsk1393752577.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.382 0.839 5.248