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(79.57,77.45,75.79,74.88,74.5,74.59,74.59,73.57,73.3,73.23,73,72.31,72.31,71.24,70.82,70.66,69.94,69.87,69.87,68.88,68.09,68.38,66.78,67.2,67.2,66.67,65.86,66.05,66.31,66.39,66.39,65.72,65.52,64.93,65.27,65.04,65.02,64.72,64.68,64.41,64.79,64.71,64.71,64.83,64.77,64.19,64.27,64.23,64.23,63.03,62.85,62.15,61.69,62.1,62.1,61.81,61.28,61.05,61.08,60.98,60.98,61.11,60.58,60.37,59.44,59.29,59.29,59.33,59.06,58.75,58.92,58.73,58.73,58.46,58.18,58.02,56.97,57.22,57.19,57.06,57.08,56.59,56.91,56.54) > 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,] 79.57 72.31 67.20 65.02 64.23 60.98 58.73 NA [2,] 77.45 71.24 66.67 64.72 63.03 61.11 58.46 NA [3,] 75.79 70.82 65.86 64.68 62.85 60.58 58.18 NA [4,] 74.88 70.66 66.05 64.41 62.15 60.37 58.02 NA [5,] 74.50 69.94 66.31 64.79 61.69 59.44 56.97 NA [6,] 74.59 69.87 66.39 64.71 62.10 59.29 57.22 NA [7,] 74.59 69.87 66.39 64.71 62.10 59.29 57.19 NA [8,] 73.57 68.88 65.72 64.83 61.81 59.33 57.06 NA [9,] 73.30 68.09 65.52 64.77 61.28 59.06 57.08 NA [10,] 73.23 68.38 64.93 64.19 61.05 58.75 56.59 NA [11,] 73.00 66.78 65.27 64.27 61.08 58.92 56.91 NA [12,] 72.31 67.20 65.04 64.23 60.98 58.73 56.54 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -2.12 -1.07 -0.53 -0.30 -1.20 0.13 -0.27 NA [2,] -1.66 -0.42 -0.81 -0.04 -0.18 -0.53 -0.28 NA [3,] -0.91 -0.16 0.19 -0.27 -0.70 -0.21 -0.16 NA [4,] -0.38 -0.72 0.26 0.38 -0.46 -0.93 -1.05 NA [5,] 0.09 -0.07 0.08 -0.08 0.41 -0.15 0.25 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 -0.03 NA [7,] -1.02 -0.99 -0.67 0.12 -0.29 0.04 -0.13 NA [8,] -0.27 -0.79 -0.20 -0.06 -0.53 -0.27 0.02 NA [9,] -0.07 0.29 -0.59 -0.58 -0.23 -0.31 -0.49 NA [10,] -0.23 -1.60 0.34 0.08 0.03 0.17 0.32 NA [11,] -0.69 0.42 -0.23 -0.04 -0.10 -0.19 -0.37 NA [12,] 0.00 0.00 -0.02 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/wessaorg/rcomp/tmp/16hv61381911045.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/2841g1381911045.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/3ryz91381911045.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/42jat1381911045.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] [1,] 58.730 58.460 58.180 58.020 56.970 57.220 57.190 57.06 57.080 56.590 [2,] 62.605 62.070 61.715 61.260 60.565 60.695 60.695 60.57 60.170 59.900 [3,] 65.020 64.720 64.680 64.410 64.790 64.710 64.710 64.83 64.770 64.190 [4,] 69.755 68.955 68.340 68.355 68.125 68.130 68.130 67.30 66.805 66.655 [5,] 79.570 77.450 75.790 74.880 74.500 74.590 74.590 73.57 73.300 73.230 [,11] [,12] [1,] 56.910 56.540 [2,] 60.000 59.855 [3,] 64.270 64.230 [4,] 66.025 66.120 [5,] 73.000 72.310 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 60.75014 60.60839 60.72366 60.17298 60.27529 60.26994 60.26994 60.81095 [2,] 69.28986 68.83161 68.63634 68.64702 69.30471 69.15006 69.15006 68.84905 [,9] [,10] [,11] [,12] [1,] 60.80769 60.15602 60.67197 60.48864 [2,] 68.73231 68.22398 67.86803 67.97136 $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(58.73, 62.605, 65.02, 69.755, 79.57, 58.46, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wmed1381911045.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,] -2.120 -0.81 -0.910 -1.050 -0.150 0 -1.020 -0.79 -0.590 -0.230 -0.37 [2,] -1.135 -0.67 -0.485 -0.825 -0.075 0 -0.830 -0.40 -0.535 -0.100 -0.30 [3,] -0.530 -0.42 -0.210 -0.460 0.080 0 -0.290 -0.27 -0.310 0.080 -0.19 [4,] -0.285 -0.23 -0.160 -0.060 0.170 0 -0.045 -0.13 -0.150 0.245 -0.07 [5,] 0.130 -0.04 0.190 0.380 0.410 0 0.120 0.02 0.290 0.340 -0.04 [,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,] -1.03760629 -0.6827609 -0.40408476 -0.916845659 -0.06631005 0 [2,] -0.02239371 -0.1572391 -0.01591524 -0.003154341 0.22631005 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.7587893 -0.4312396 -0.53991579 -0.1260284 -0.32735229 0 [2,] 0.1787893 -0.1087604 -0.08008421 0.2860284 -0.05264771 0 $out [1] -1.66 -0.03 -1.60 -0.69 0.42 -0.02 $group [1] 2 6 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.11999999999999, -1.13500000000001, -0.530000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fdf11381911045.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,] 72.310 66.780 64.930 64.19 60.980 58.730 56.540 NA [2,] 73.265 68.235 65.395 64.34 61.180 58.990 56.940 NA [3,] 74.545 69.870 65.955 64.71 61.955 59.310 57.135 NA [4,] 75.335 70.740 66.390 64.78 62.500 60.475 58.100 NA [5,] 77.450 72.310 67.200 65.02 64.230 61.110 58.730 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73.60086 68.72745 65.50117 64.50931 61.35294 58.63268 56.60592 NA [2,] 75.48914 71.01255 66.40883 64.91069 62.55706 59.98732 57.66408 NA $out [1] 79.57 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(72.31, 73.265, 74.545, 75.335, 77.45, 66.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74juh1381911045.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,] 63.57571 64.19 62.98750 [2,] 64.01571 64.34 63.38250 [3,] 64.84143 64.71 64.37875 [4,] 65.37857 64.78 64.91750 [5,] 66.86286 65.02 66.18000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 64.21982 64.50931 63.67863 [2,] 65.46304 64.91069 65.07887 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(63.5757142857143, 64.0157142857143, 64.8414285714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16hv61381911045.ps tmp/16hv61381911045.png",intern=TRUE)) character(0) > try(system("convert tmp/2841g1381911045.ps tmp/2841g1381911045.png",intern=TRUE)) character(0) > try(system("convert tmp/3ryz91381911045.ps tmp/3ryz91381911045.png",intern=TRUE)) character(0) > try(system("convert tmp/42jat1381911045.ps tmp/42jat1381911045.png",intern=TRUE)) character(0) > try(system("convert tmp/5wmed1381911045.ps tmp/5wmed1381911045.png",intern=TRUE)) character(0) > try(system("convert tmp/6fdf11381911045.ps tmp/6fdf11381911045.png",intern=TRUE)) character(0) > try(system("convert tmp/74juh1381911045.ps tmp/74juh1381911045.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.388 1.145 6.488