R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(204.12,203.27,203.73,203.7,203.44,203.34,203.34,203.05,202.71,202.51,203.45,203.04,203.04,202.87,202.92,202.87,203.17,203.88,203.88,203.45,203.22,202.11,202.5,202.86,202.86,203.8,203.78,204.53,204.44,204.14,204.14,204.04,204.68,205.01,204.93,204.34,204.34,203.87,202.47,201.95,201.86,200.33,200.33,200.33,200.75,201.86,202.77,202.85,202.85,202.84,202.94,203.05,203.45,204.19,204.18,204.47,204.78,206.05,206.32,206.36,205.21,205.35,205.94,204.57,204.27,204.86,204.66,204.79,205.58,205.63,205.12,204.96) > 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,] 204.12 203.04 202.86 204.34 202.85 205.21 NA [2,] 203.27 202.87 203.80 203.87 202.84 205.35 NA [3,] 203.73 202.92 203.78 202.47 202.94 205.94 NA [4,] 203.70 202.87 204.53 201.95 203.05 204.57 NA [5,] 203.44 203.17 204.44 201.86 203.45 204.27 NA [6,] 203.34 203.88 204.14 200.33 204.19 204.86 NA [7,] 203.34 203.88 204.14 200.33 204.18 204.66 NA [8,] 203.05 203.45 204.04 200.33 204.47 204.79 NA [9,] 202.71 203.22 204.68 200.75 204.78 205.58 NA [10,] 202.51 202.11 205.01 201.86 206.05 205.63 NA [11,] 203.45 202.50 204.93 202.77 206.32 205.12 NA [12,] 203.04 202.86 204.34 202.85 206.36 204.96 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.85 -0.17 0.94 -0.47 -0.01 0.14 NA [2,] 0.46 0.05 -0.02 -1.40 0.10 0.59 NA [3,] -0.03 -0.05 0.75 -0.52 0.11 -1.37 NA [4,] -0.26 0.30 -0.09 -0.09 0.40 -0.30 NA [5,] -0.10 0.71 -0.30 -1.53 0.74 0.59 NA [6,] 0.00 0.00 0.00 0.00 -0.01 -0.20 NA [7,] -0.29 -0.43 -0.10 0.00 0.29 0.13 NA [8,] -0.34 -0.23 0.64 0.42 0.31 0.79 NA [9,] -0.20 -1.11 0.33 1.11 1.27 0.05 NA [10,] 0.94 0.39 -0.08 0.91 0.27 -0.51 NA [11,] -0.41 0.36 -0.59 0.08 0.04 -0.16 NA [12,] 0.00 0.00 0.00 0.00 -1.15 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/14k281413020545.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/2g5og1413020545.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/3s30r1413020545.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/4o3c11413020545.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,] 202.85 202.840 202.470 201.950 201.860 203.34 203.34 203.050 200.75 201.86 [2,] 202.86 202.870 202.920 202.870 203.170 203.34 203.34 203.050 202.71 202.11 [3,] 203.58 203.535 203.335 203.375 203.445 204.01 204.01 203.745 203.95 203.76 [4,] 204.34 203.870 203.780 204.530 204.270 204.19 204.18 204.470 204.78 205.63 [5,] 205.21 205.350 203.780 204.570 204.440 204.86 204.66 204.790 205.58 206.05 [,11] [,12] [1,] 202.50 202.85 [2,] 202.77 202.86 [3,] 204.19 203.69 [4,] 205.12 204.96 [5,] 206.32 206.36 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 202.6254 202.89 202.7803 202.3042 202.7355 203.4617 203.4682 202.8291 [2,] 204.5346 204.18 203.8897 204.4458 204.1545 204.5583 204.5518 204.6609 [,9] [,10] [,11] [,12] [1,] 202.6148 201.4895 202.6742 202.3354 [2,] 205.2852 206.0305 205.7058 205.0446 $out [1] 205.94 200.33 200.33 200.33 $group [1] 3 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(202.85, 202.86, 203.58, 204.34, 205.21, 202.84, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52r3s1413020545.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.85 -0.020 -1.37 -0.30 -1.530 -0.01 -0.43 -0.340 -1.11 -0.51 -0.59 0 [2,] -0.47 -0.020 -0.52 -0.26 -0.300 -0.01 -0.29 -0.230 -0.20 -0.08 -0.41 0 [3,] -0.09 0.075 -0.04 -0.09 0.245 0.00 -0.05 0.365 0.19 0.33 -0.06 0 [4,] 0.14 0.460 0.11 0.30 0.710 0.00 0.13 0.640 1.11 0.91 0.08 0 [5,] 0.94 0.590 0.75 0.40 0.740 0.00 0.29 0.790 1.27 0.94 0.36 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.4834697 -0.2346155 -0.4463703 -0.4512181 -0.4064826 -0.006450323 [2,] 0.3034697 0.3846155 0.3663703 0.2712181 0.8964826 0.006450323 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.3209136 -0.1961781 -0.6549923 -0.308582 -0.3760658 0 [2,] 0.2209136 0.9261781 1.0349923 0.968582 0.2560658 0 $out [1] -1.40 -0.20 -1.15 $group [1] 2 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.849999999999994, -0.469999999999999, -0.0899999999999892, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ixft1413020545.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,] 202.510 202.500 203.780 200.330 202.840 204.270 NA [2,] 203.045 202.865 203.920 200.540 202.995 204.725 NA [3,] 203.340 202.980 204.240 201.905 204.185 205.040 NA [4,] 203.575 203.335 204.605 202.810 205.415 205.465 NA [5,] 204.120 203.880 205.010 204.340 206.360 205.940 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 203.0983 202.7656 203.9276 200.8696 203.0812 204.7025 NA [2,] 203.5817 203.1944 204.5524 202.9404 205.2888 205.3775 NA $out [1] 202.11 202.86 $group [1] 2 3 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(202.51, 203.045, 203.34, 203.575, 204.12, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7jgg61413020545.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,] 203.3550 203.3350 203.3462 [2,] 203.4417 203.4900 203.6069 [3,] 203.6250 203.7175 203.7763 [4,] 203.7992 203.9800 203.8344 [5,] 204.1817 204.1900 204.0062 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 203.4619 203.494 203.6725 [2,] 203.7881 203.941 203.8800 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(203.355, 203.441666666667, 203.625, 203.799166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14k281413020545.ps tmp/14k281413020545.png",intern=TRUE)) character(0) > try(system("convert tmp/2g5og1413020545.ps tmp/2g5og1413020545.png",intern=TRUE)) character(0) > try(system("convert tmp/3s30r1413020545.ps tmp/3s30r1413020545.png",intern=TRUE)) character(0) > try(system("convert tmp/4o3c11413020545.ps tmp/4o3c11413020545.png",intern=TRUE)) character(0) > try(system("convert tmp/52r3s1413020545.ps tmp/52r3s1413020545.png",intern=TRUE)) character(0) > try(system("convert tmp/6ixft1413020545.ps tmp/6ixft1413020545.png",intern=TRUE)) character(0) > try(system("convert tmp/7jgg61413020545.ps tmp/7jgg61413020545.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.468 0.419 2.915