R version 3.0.3 (2014-03-06) -- "Warm Puppy" Copyright (C) 2014 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(227.81,227.81,227.01,227.26,227.1,227.59,227.59,227.7,227.75,226.33,225.95,226.33,226.33,226.22,224.84,221.88,222.37,221.8,221.8,221.8,221.9,220.2,219.95,220.05,220.05,220.05,220.62,221.53,221.61,221.5,221.5,221.87,222.27,220.86,221.49,221.67,221.67,221.72,221.67,220.29,220.75,219.59,219.59,219.59,219.82,221.59,220.9,221.01,221.01,219.69,221,219.82,218.04,217.97,217.97,217.53,217,217.18,217.68,217.71,217.71,218.5,218.8,218.94,220,219.89,219.89,220.08,220.16,221,222.16,221.5,221.5,221.6,221.85,223.11,222.79,222.45,222.45,222.4,223.15,224.4,224.24,223.92) > 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,] 227.81 226.33 220.05 221.67 221.01 217.71 221.50 NA [2,] 227.81 226.22 220.05 221.72 219.69 218.50 221.60 NA [3,] 227.01 224.84 220.62 221.67 221.00 218.80 221.85 NA [4,] 227.26 221.88 221.53 220.29 219.82 218.94 223.11 NA [5,] 227.10 222.37 221.61 220.75 218.04 220.00 222.79 NA [6,] 227.59 221.80 221.50 219.59 217.97 219.89 222.45 NA [7,] 227.59 221.80 221.50 219.59 217.97 219.89 222.45 NA [8,] 227.70 221.80 221.87 219.59 217.53 220.08 222.40 NA [9,] 227.75 221.90 222.27 219.82 217.00 220.16 223.15 NA [10,] 226.33 220.20 220.86 221.59 217.18 221.00 224.40 NA [11,] 225.95 219.95 221.49 220.90 217.68 222.16 224.24 NA [12,] 226.33 220.05 221.67 221.01 217.71 221.50 223.92 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.00 -0.11 0.00 0.05 -1.32 0.79 0.10 NA [2,] -0.80 -1.38 0.57 -0.05 1.31 0.30 0.25 NA [3,] 0.25 -2.96 0.91 -1.38 -1.18 0.14 1.26 NA [4,] -0.16 0.49 0.08 0.46 -1.78 1.06 -0.32 NA [5,] 0.49 -0.57 -0.11 -1.16 -0.07 -0.11 -0.34 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.11 0.00 0.37 0.00 -0.44 0.19 -0.05 NA [8,] 0.05 0.10 0.40 0.23 -0.53 0.08 0.75 NA [9,] -1.42 -1.70 -1.41 1.77 0.18 0.84 1.25 NA [10,] -0.38 -0.25 0.63 -0.69 0.50 1.16 -0.16 NA [11,] 0.38 0.10 0.18 0.11 0.03 -0.66 -0.32 NA [12,] 0.00 0.00 0.00 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/1n6nd1395074844.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/2jty21395074844.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/36kgn1395074844.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/42k4d1395074844.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] [1,] 217.71 218.50 218.800 218.940 218.040 217.970 217.970 217.530 217.00 [2,] 220.53 219.87 220.810 220.055 220.375 219.740 219.740 219.835 219.99 [3,] 221.50 221.60 221.670 221.530 221.610 221.500 221.500 221.800 221.90 [4,] 224.00 223.97 223.345 222.495 222.580 222.125 222.125 222.135 222.71 [5,] 227.81 227.81 227.010 223.110 222.790 222.450 222.450 222.400 223.15 [,10] [,11] [,12] [1,] 217.180 217.680 217.710 [2,] 220.530 220.425 220.530 [3,] 221.000 221.490 221.500 [4,] 222.995 223.200 222.795 [5,] 226.330 225.950 223.920 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 219.4278 219.1515 220.1561 220.0729 220.2932 220.0757 220.0757 220.4265 [2,] 223.5722 224.0485 223.1839 222.9871 222.9268 222.9243 222.9243 223.1735 [,9] [,10] [,11] [,12] [1,] 220.2757 219.5279 219.8328 220.1474 [2,] 223.5243 222.4721 223.1472 222.8526 $out [1] 227.26 227.10 227.59 227.59 227.70 227.75 226.33 $group [1] 4 5 6 7 8 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(217.71, 220.53, 221.5, 224, 227.81, 218.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5e6cf1395074844.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,] -0.110 -1.380 -2.96 -0.320 -0.570 0 -0.050 0.050 -1.700 -0.690 -0.320 [2,] -0.055 -0.425 -1.28 -0.240 -0.455 0 -0.025 0.065 -1.415 -0.315 -0.145 [3,] 0.000 0.250 0.14 0.080 -0.110 0 0.000 0.100 0.180 -0.160 0.100 [4,] 0.075 0.435 0.58 0.475 -0.090 0 0.150 0.315 1.045 0.565 0.145 [5,] 0.100 1.310 1.26 1.060 -0.070 0 0.370 0.400 1.770 1.160 0.380 [,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] [,7] [1,] -0.0776339 -0.2635781 -0.970762 -0.3469865 -0.3279721 0 -0.1045072 [2,] 0.0776339 0.7635781 1.250762 0.5069865 0.1079721 0 0.1045072 [,8] [,9] [,10] [,11] [,12] [1,] -0.04929597 -1.289072 -0.6855218 -0.07318332 0 [2,] 0.24929597 1.649072 0.3655218 0.27318332 0 $out [1] -1.32 0.79 -1.78 0.49 -1.16 -0.44 -0.53 0.75 -0.66 $group [1] 1 1 4 5 5 7 8 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.110000000000014, -0.0550000000000068, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jnsm1395074844.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,] 225.950 219.950 220.05 219.590 217.000 217.710 221.500 NA [2,] 226.670 221.000 220.74 219.705 217.605 218.870 222.125 NA [3,] 227.425 221.840 221.50 220.825 217.970 219.945 222.620 NA [4,] 227.725 223.605 221.64 221.630 219.755 220.580 223.535 NA [5,] 227.810 226.330 222.27 221.720 221.010 222.160 224.400 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 226.9438 220.6518 221.0895 219.947 216.9894 219.1651 221.9769 NA [2,] 227.9062 223.0282 221.9105 221.703 218.9506 220.7249 223.2631 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(225.95, 226.67, 227.425, 227.725, 227.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/702ih1395074844.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,] 221.5414 221.490 220.9325 [2,] 221.6093 221.500 221.1300 [3,] 221.7543 221.515 221.5700 [4,] 222.0300 221.640 221.8663 [5,] 222.2971 221.800 222.2650 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 221.5624 221.4511 221.2342 [2,] 221.9462 221.5789 221.9058 $out [1] 221.9 221.0 $group [1] 2 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(221.541428571429, 221.609285714286, 221.754285714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1n6nd1395074844.ps tmp/1n6nd1395074844.png",intern=TRUE)) character(0) > try(system("convert tmp/2jty21395074844.ps tmp/2jty21395074844.png",intern=TRUE)) character(0) > try(system("convert tmp/36kgn1395074844.ps tmp/36kgn1395074844.png",intern=TRUE)) character(0) > try(system("convert tmp/42k4d1395074844.ps tmp/42k4d1395074844.png",intern=TRUE)) character(0) > try(system("convert tmp/5e6cf1395074844.ps tmp/5e6cf1395074844.png",intern=TRUE)) character(0) > try(system("convert tmp/6jnsm1395074844.ps tmp/6jnsm1395074844.png",intern=TRUE)) character(0) > try(system("convert tmp/702ih1395074844.ps tmp/702ih1395074844.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.522 0.792 5.354