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(110.12,112.28,113.77,114.38,119.06,119.94,120.98,122.33,121.7,123.73,121.73,119.75,117.4,120.99,125.18,126.41,129.38,131.93,129.34,128.58,125.37,123.25,122.78,120.37,116.83,116.39,120.69,123.51,127.43,125.99,120.62,113.71,110.79,108.15,111.22,112.65,112.47,117.48,122.46,123.46,122.33,129.2,129.22,131.17,120.22,120.38,115.32,112.25,109.83,107.05,112.87,113.68,115.08,120.61,119.14,118.63,115.78,117.26,117.61,113.92,113.65,115.89,116.55,117.78,117.36,121.09,124.26,121.88,119.52,122.49,120.86,120.31) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 110.12 117.40 116.83 112.47 109.83 113.65 NA [2,] 112.28 120.99 116.39 117.48 107.05 115.89 NA [3,] 113.77 125.18 120.69 122.46 112.87 116.55 NA [4,] 114.38 126.41 123.51 123.46 113.68 117.78 NA [5,] 119.06 129.38 127.43 122.33 115.08 117.36 NA [6,] 119.94 131.93 125.99 129.20 120.61 121.09 NA [7,] 120.98 129.34 120.62 129.22 119.14 124.26 NA [8,] 122.33 128.58 113.71 131.17 118.63 121.88 NA [9,] 121.70 125.37 110.79 120.22 115.78 119.52 NA [10,] 123.73 123.25 108.15 120.38 117.26 122.49 NA [11,] 121.73 122.78 111.22 115.32 117.61 120.86 NA [12,] 119.75 120.37 112.65 112.25 113.92 120.31 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.16 3.59 -0.44 5.01 -2.78 2.24 NA [2,] 1.49 4.19 4.30 4.98 5.82 0.66 NA [3,] 0.61 1.23 2.82 1.00 0.81 1.23 NA [4,] 4.68 2.97 3.92 -1.13 1.40 -0.42 NA [5,] 0.88 2.55 -1.44 6.87 5.53 3.73 NA [6,] 1.04 -2.59 -5.37 0.02 -1.47 3.17 NA [7,] 1.35 -0.76 -6.91 1.95 -0.51 -2.38 NA [8,] -0.63 -3.21 -2.92 -10.95 -2.85 -2.36 NA [9,] 2.03 -2.12 -2.64 0.16 1.48 2.97 NA [10,] -2.00 -0.47 3.07 -5.06 0.35 -1.63 NA [11,] -1.98 -2.41 1.43 -3.07 -3.69 -0.55 NA [12,] -2.35 -3.54 -0.18 -2.42 -0.27 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/12q661382202882.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/291t31382202882.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/3w0ff1382202882.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/4yw3r1382202882.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,] 109.83 107.05 112.87 113.68 115.080 119.94 119.14 113.710 110.79 117.260 [2,] 110.12 112.28 113.77 114.38 117.360 120.61 120.62 118.630 115.78 117.260 [3,] 113.06 116.14 118.62 120.62 120.695 123.54 122.62 122.105 119.87 121.435 [4,] 116.83 117.48 122.46 123.51 127.430 129.20 129.22 128.580 121.70 123.250 [5,] 117.40 120.99 125.18 126.41 129.380 131.93 129.34 131.170 125.37 123.730 [,11] [,12] [1,] 111.220 112.250 [2,] 115.320 112.650 [3,] 119.235 116.835 [4,] 121.730 120.310 [5,] 122.780 120.370 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 108.7318 112.7858 113.0147 114.7309 114.1995 117.9992 117.0727 115.6869 [2,] 117.3882 119.4942 124.2253 126.5091 127.1905 129.0808 128.1673 128.5231 [,9] [,10] [,11] [,12] [1,] 116.0514 117.5713 115.1003 111.8941 [2,] 123.6886 125.2987 123.3697 121.7759 $out [1] 108.15 $group [1] 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(109.83, 110.12, 113.06, 116.83, 117.4, 107.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tbvx1382202882.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.78 0.660 0.610 -1.130 -1.44 -5.370 -6.910 -3.210 -2.64 -5.06 -3.690 [2,] -0.44 1.490 0.810 -0.420 0.88 -2.590 -2.380 -3.210 -2.12 -2.00 -3.070 [3,] 2.20 4.245 1.115 2.185 3.14 -0.725 -0.635 -2.885 0.82 -1.05 -2.195 [4,] 3.59 4.980 1.230 3.920 5.53 1.040 1.350 -2.360 2.03 0.35 -0.550 [5,] 5.01 5.820 1.230 4.680 6.87 3.170 1.950 -2.360 2.97 3.07 1.430 [,12] [1,] -3.54 [2,] -2.42 [3,] -2.35 [4,] -0.27 [5,] -0.18 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.3994802 1.993837 0.8440864 -0.6144402 0.1405998 -3.066467 -3.04097 [2,] 4.7994802 6.496163 1.3859136 4.9844402 6.1394002 1.616467 1.77097 [,8] [,9] [,10] [,11] [,12] [1,] -3.433277 -1.856884 -2.5658259 -3.8204814 -3.8691846 [2,] -2.336723 3.496884 0.4658259 -0.5695186 -0.8308154 $out [1] 2.82 -0.63 -10.95 $group [1] 3 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.78, -0.439999999999998, 2.2, 3.58999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ucm51382202882.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] [1,] 110.120 117.400 108.150 112.250 107.050 113.650 NA [2,] 114.075 121.885 111.935 116.400 113.275 116.955 NA [3,] 119.845 125.275 116.610 121.355 115.430 119.915 NA [4,] 121.715 128.960 122.100 126.330 118.120 121.485 NA [5,] 123.730 131.930 127.430 131.170 120.610 124.260 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 116.3603 122.048 111.9737 116.8259 113.2202 117.8488 NA [2,] 123.3297 128.502 121.2463 125.8841 117.6398 121.9812 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(110.12, 114.075, 119.845, 121.715, 123.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ufl31382202882.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,] 113.3833 113.0600 113.3713 [2,] 117.3975 117.7275 117.4050 [3,] 119.0533 120.2450 119.1931 [4,] 122.2450 121.7700 122.6000 [5,] 124.7933 123.5400 124.5637 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 116.8424 118.4012 116.8237 [2,] 121.2643 122.0888 121.5626 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(113.383333333333, 117.3975, 119.053333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12q661382202882.ps tmp/12q661382202882.png",intern=TRUE)) character(0) > try(system("convert tmp/291t31382202882.ps tmp/291t31382202882.png",intern=TRUE)) character(0) > try(system("convert tmp/3w0ff1382202882.ps tmp/3w0ff1382202882.png",intern=TRUE)) character(0) > try(system("convert tmp/4yw3r1382202882.ps tmp/4yw3r1382202882.png",intern=TRUE)) character(0) > try(system("convert tmp/5tbvx1382202882.ps tmp/5tbvx1382202882.png",intern=TRUE)) character(0) > try(system("convert tmp/6ucm51382202882.ps tmp/6ucm51382202882.png",intern=TRUE)) character(0) > try(system("convert tmp/7ufl31382202882.ps tmp/7ufl31382202882.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.387 0.724 4.098