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(15.13,15.25,15.33,15.36,15.40,15.40,15.41,15.47,15.54,15.55,15.59,15.65,15.75,15.86,15.89,15.94,15.93,15.95,15.99,15.99,16.06,16.08,16.07,16.11,16.15,16.18,16.30,16.42,16.49,16.50,16.58,16.64,16.66,16.81,16.91,16.92,16.95,17.11,17.16,17.16,17.27,17.34,17.39,17.43,17.45,17.50,17.56,17.65,17.62,17.70,17.72,17.71,17.74,17.75,17.78,17.80,17.86,17.88,17.89,17.94,17.98,18.10,18.14,18.19,18.23,18.24,18.27,18.30,18.34,18.36,18.36,18.40,18.43,18.47,18.56,18.58,18.61,18.61,18.69,18.74,18.75,18.81,18.85,18.88) > 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,] 15.13 15.75 16.15 16.95 17.62 17.98 18.43 NA [2,] 15.25 15.86 16.18 17.11 17.70 18.10 18.47 NA [3,] 15.33 15.89 16.30 17.16 17.72 18.14 18.56 NA [4,] 15.36 15.94 16.42 17.16 17.71 18.19 18.58 NA [5,] 15.40 15.93 16.49 17.27 17.74 18.23 18.61 NA [6,] 15.40 15.95 16.50 17.34 17.75 18.24 18.61 NA [7,] 15.41 15.99 16.58 17.39 17.78 18.27 18.69 NA [8,] 15.47 15.99 16.64 17.43 17.80 18.30 18.74 NA [9,] 15.54 16.06 16.66 17.45 17.86 18.34 18.75 NA [10,] 15.55 16.08 16.81 17.50 17.88 18.36 18.81 NA [11,] 15.59 16.07 16.91 17.56 17.89 18.36 18.85 NA [12,] 15.65 16.11 16.92 17.65 17.94 18.40 18.88 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.12 0.11 0.03 0.16 0.08 0.12 0.04 NA [2,] 0.08 0.03 0.12 0.05 0.02 0.04 0.09 NA [3,] 0.03 0.05 0.12 0.00 -0.01 0.05 0.02 NA [4,] 0.04 -0.01 0.07 0.11 0.03 0.04 0.03 NA [5,] 0.00 0.02 0.01 0.07 0.01 0.01 0.00 NA [6,] 0.01 0.04 0.08 0.05 0.03 0.03 0.08 NA [7,] 0.06 0.00 0.06 0.04 0.02 0.03 0.05 NA [8,] 0.07 0.07 0.02 0.02 0.06 0.04 0.01 NA [9,] 0.01 0.02 0.15 0.05 0.02 0.02 0.06 NA [10,] 0.04 -0.01 0.10 0.06 0.01 0.00 0.04 NA [11,] 0.06 0.04 0.01 0.09 0.05 0.04 0.03 NA [12,] 0.10 0.04 0.03 -0.03 0.04 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/17hvk1381944238.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/2rm2e1381944238.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/3zupf1381944238.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/45l381381944238.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,] 15.13 15.25 15.330 15.36 15.400 15.400 15.410 15.470 15.54 15.550 15.590 [2,] 15.95 16.02 16.095 16.18 16.210 16.225 16.285 16.315 16.36 16.445 16.490 [3,] 16.95 17.11 17.160 17.16 17.270 17.340 17.390 17.430 17.45 17.500 17.560 [4,] 17.80 17.90 17.930 17.95 17.985 17.995 18.025 18.050 18.10 18.120 18.125 [5,] 18.43 18.47 18.560 18.58 18.610 18.610 18.690 18.740 18.75 18.810 18.850 [,12] [1,] 15.650 [2,] 16.515 [3,] 17.650 [4,] 18.170 [5,] 18.880 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.84521 15.98729 16.06417 16.10298 16.21 16.28298 16.3509 16.39389 [2,] 18.05479 18.23271 18.25583 18.21702 18.33 18.39702 18.4291 18.46611 [,9] [,10] [,11] [,12] [1,] 16.4109 16.49972 16.5836 16.66166 [2,] 18.4891 18.50028 18.5364 18.63834 $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(15.13, 15.95, 16.95, 17.8, 18.43, 15.25, 16.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nyjl1381944238.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.03 0.020 -0.01 0.030 0.000 0.010 0.000 0.010 0.010 -0.010 0.010 0.030 [2,] 0.06 0.035 0.01 0.030 0.005 0.030 0.025 0.020 0.020 0.005 0.035 0.030 [3,] 0.11 0.050 0.03 0.040 0.010 0.040 0.040 0.040 0.020 0.040 0.040 0.035 [4,] 0.12 0.085 0.05 0.055 0.015 0.065 0.055 0.065 0.055 0.050 0.055 0.040 [5,] 0.16 0.120 0.05 0.070 0.020 0.080 0.060 0.070 0.060 0.100 0.060 0.040 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.07416897 0.02014081 0.006112645 0.0250704 0.004028161 0.01909856 [2,] 0.14583103 0.07985919 0.053887355 0.0549296 0.015971839 0.06090144 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.02208448 0.01312673 -0.0009014354 0.01312673 0.02805632 0.02854968 [2,] 0.05791552 0.06687327 0.0409014354 0.06687327 0.05194368 0.04145032 $out [1] 0.12 -0.01 0.11 0.07 0.15 0.09 0.10 -0.03 $group [1] 3 4 4 5 9 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0300000000000011, 0.0599999999999987, 0.109999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hkkv1381944238.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,] 15.130 15.750 16.150 16.950 17.620 17.980 18.43 NA [2,] 15.345 15.910 16.360 17.160 17.715 18.165 18.57 NA [3,] 15.405 15.970 16.540 17.365 17.765 18.255 18.65 NA [4,] 15.545 16.065 16.735 17.475 17.870 18.350 18.78 NA [5,] 15.650 16.110 16.920 17.650 17.940 18.400 18.88 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.31378 15.8993 16.36896 17.22133 17.6943 18.17062 18.55422 NA [2,] 15.49622 16.0407 16.71104 17.50867 17.8357 18.33938 18.74578 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(15.13, 15.345, 15.405, 15.545, 15.65, 15.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7s0hb1381944238.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.85857 16.950 16.87500 [2,] 17.03286 17.160 17.03875 [3,] 17.13571 17.365 17.13250 [4,] 17.26071 17.475 17.25625 [5,] 17.36429 17.650 17.34250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 17.03179 17.22133 17.0333 [2,] 17.23964 17.50867 17.2317 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16.8585714285714, 17.0328571428571, 17.1357142857143, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17hvk1381944238.ps tmp/17hvk1381944238.png",intern=TRUE)) character(0) > try(system("convert tmp/2rm2e1381944238.ps tmp/2rm2e1381944238.png",intern=TRUE)) character(0) > try(system("convert tmp/3zupf1381944238.ps tmp/3zupf1381944238.png",intern=TRUE)) character(0) > try(system("convert tmp/45l381381944238.ps tmp/45l381381944238.png",intern=TRUE)) character(0) > try(system("convert tmp/5nyjl1381944238.ps tmp/5nyjl1381944238.png",intern=TRUE)) character(0) > try(system("convert tmp/6hkkv1381944238.ps tmp/6hkkv1381944238.png",intern=TRUE)) character(0) > try(system("convert tmp/7s0hb1381944238.ps tmp/7s0hb1381944238.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.510 0.749 4.248