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(19.31,19.47,19.7,19.76,19.9,19.97,20.1,20.26,20.44,20.43,20.57,20.6,20.69,20.93,20.98,21.11,21.14,21.16,21.32,21.32,21.48,21.58,21.74,21.75,21.81,21.89,22.21,22.37,22.47,22.51,22.55,22.61,22.58,22.85,22.93,22.98,23.01,23.11,23.18,23.18,23.21,23.22,23.12,23.15,23.16,23.21,23.21,23.22,23.25,23.39,23.41,23.45,23.46,23.44,23.54,23.62,23.86,24.07,24.13,24.12,24.17,24.23,24.28,24.12,24.14,24.17,24.2,24.36,24.34,24.38,24.46,24.6,24.63,24.75,24.64,24.69,24.7,24.74,24.87,24.92,24.94,24.98,25.13,25.15) > 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,] 19.31 20.69 21.81 23.01 23.25 24.17 24.63 NA [2,] 19.47 20.93 21.89 23.11 23.39 24.23 24.75 NA [3,] 19.70 20.98 22.21 23.18 23.41 24.28 24.64 NA [4,] 19.76 21.11 22.37 23.18 23.45 24.12 24.69 NA [5,] 19.90 21.14 22.47 23.21 23.46 24.14 24.70 NA [6,] 19.97 21.16 22.51 23.22 23.44 24.17 24.74 NA [7,] 20.10 21.32 22.55 23.12 23.54 24.20 24.87 NA [8,] 20.26 21.32 22.61 23.15 23.62 24.36 24.92 NA [9,] 20.44 21.48 22.58 23.16 23.86 24.34 24.94 NA [10,] 20.43 21.58 22.85 23.21 24.07 24.38 24.98 NA [11,] 20.57 21.74 22.93 23.21 24.13 24.46 25.13 NA [12,] 20.60 21.75 22.98 23.22 24.12 24.60 25.15 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.16 0.24 0.08 0.10 0.14 0.06 0.12 NA [2,] 0.23 0.05 0.32 0.07 0.02 0.05 -0.11 NA [3,] 0.06 0.13 0.16 0.00 0.04 -0.16 0.05 NA [4,] 0.14 0.03 0.10 0.03 0.01 0.02 0.01 NA [5,] 0.07 0.02 0.04 0.01 -0.02 0.03 0.04 NA [6,] 0.13 0.16 0.04 -0.10 0.10 0.03 0.13 NA [7,] 0.16 0.00 0.06 0.03 0.08 0.16 0.05 NA [8,] 0.18 0.16 -0.03 0.01 0.24 -0.02 0.02 NA [9,] -0.01 0.10 0.27 0.05 0.21 0.04 0.04 NA [10,] 0.14 0.16 0.08 0.00 0.06 0.08 0.15 NA [11,] 0.03 0.01 0.05 0.01 -0.01 0.14 0.02 NA [12,] 0.09 0.06 0.03 0.03 0.05 0.03 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/1y2da1381959442.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/2jrag1381959442.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/3pn4r1381959442.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/4dhtv1381959442.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,] 19.31 19.47 19.700 19.760 19.900 19.970 20.100 20.260 20.44 20.430 20.570 [2,] 21.25 21.41 21.595 21.740 21.805 21.835 21.935 21.965 22.03 22.215 22.335 [3,] 23.01 23.11 23.180 23.180 23.210 23.220 23.120 23.150 23.16 23.210 23.210 [4,] 23.71 23.81 23.845 23.785 23.800 23.805 23.870 23.990 24.10 24.225 24.295 [5,] 24.63 24.75 24.640 24.690 24.700 24.740 24.870 24.920 24.94 24.980 25.130 [,12] [1,] 20.600 [2,] 22.365 [3,] 23.220 [4,] 24.360 [5,] 25.150 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 21.54093 21.67676 21.83634 21.95876 22.01862 22.04355 21.96445 21.9407 [2,] 24.47907 24.54324 24.52366 24.40124 24.40138 24.39645 24.27555 24.3593 [,9] [,10] [,11] [,12] [1,] 21.92383 22.00966 22.03952 22.02862 [2,] 24.39617 24.41034 24.38048 24.41138 $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(19.31, 21.25, 23.01, 23.71, 24.63, 19.47, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5lie01381959442.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.06 -0.110 0.000 0.010 -0.020 -0.100 0.00 -0.030 -0.010 0.000 -0.01 0.03 [2,] 0.09 0.035 0.020 0.015 0.015 0.035 0.04 -0.005 0.040 0.070 0.01 0.03 [3,] 0.12 0.050 0.050 0.030 0.030 0.100 0.06 0.020 0.050 0.080 0.02 0.04 [4,] 0.15 0.150 0.095 0.065 0.040 0.130 0.12 0.170 0.155 0.145 0.04 0.06 [5,] 0.24 0.320 0.160 0.140 0.070 0.160 0.16 0.240 0.270 0.160 0.05 0.09 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.08416897 -0.01867614 0.00521121 0.0001408066 0.0150704 0.04326753 [2,] 0.15583103 0.11867614 0.09478879 0.0598591934 0.0449296 0.15673247 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.01222529 -0.08450718 -0.01867614 0.03521121 0.002084484 0.02064903 [2,] 0.10777471 0.12450718 0.11867614 0.12478879 0.037915516 0.05935097 $out [1] -0.16 0.14 $group [1] 3 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0599999999999987, 0.0899999999999999, 0.120000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/610lw1381959442.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,] 19.310 20.690 21.81 23.110 23.250 24.120 24.630 NA [2,] 19.730 21.045 22.29 23.135 23.425 24.170 24.695 NA [3,] 20.035 21.240 22.53 23.180 23.500 24.255 24.810 NA [4,] 20.435 21.530 22.73 23.210 23.965 24.370 24.960 NA [5,] 20.600 21.750 22.98 23.220 24.130 24.600 25.150 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 19.71344 21.01879 22.32931 23.14579 23.2537 24.16378 24.68913 NA [2,] 20.35656 21.46121 22.73069 23.21421 23.7463 24.34622 24.93087 NA $out [1] 23.01 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(19.31, 19.73, 20.035, 20.435, 20.6, 20.69, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/76ey61381959442.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,] 22.41000 23.110 22.48000 [2,] 22.64857 23.135 22.74125 [3,] 22.77929 23.180 22.86125 [4,] 23.02143 23.210 23.14250 [5,] 23.20286 23.220 23.36250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 22.60922 23.14579 22.67824 [2,] 22.94935 23.21421 23.04426 $out [1] 23.01 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(22.41, 22.6485714285714, 22.7792857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1y2da1381959442.ps tmp/1y2da1381959442.png",intern=TRUE)) character(0) > try(system("convert tmp/2jrag1381959442.ps tmp/2jrag1381959442.png",intern=TRUE)) character(0) > try(system("convert tmp/3pn4r1381959442.ps tmp/3pn4r1381959442.png",intern=TRUE)) character(0) > try(system("convert tmp/4dhtv1381959442.ps tmp/4dhtv1381959442.png",intern=TRUE)) character(0) > try(system("convert tmp/5lie01381959442.ps tmp/5lie01381959442.png",intern=TRUE)) character(0) > try(system("convert tmp/610lw1381959442.ps tmp/610lw1381959442.png",intern=TRUE)) character(0) > try(system("convert tmp/76ey61381959442.ps tmp/76ey61381959442.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.712 0.991 5.710