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(94.67,94.6,93.9,93.41,93.37,93.35,93.08,93.05,92.61,92.37,92.24,91.95,92.63,92.7,92.47,92.58,92.55,92.56,89.92,89.96,90.03,90.31,90.8,90.36,90.31,93.8,93.95,93.99,94.44,94.15,91.91,91.86,93.12,93.47,93.57,94.57,95.85,96.62,95.69,95.39,95.14,95.07,94.21,95.4,95.1,94.89,95.43,94.88,96.03,96.37,96.04,95.72,95.74,95.78,93.66,95.29,94.33,95.66,95.2,94.61,96.21,96.27,95.12,95.55,93.51,92.86,92.45,93.34,92.01,91.77,92.19,91.97) > par1 = '19' > par1 <- '19' > #'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] 3 > 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] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 > arr [,1] [,2] [,3] [,4] [1,] 94.67 89.96 95.69 95.66 [2,] 94.60 90.03 95.39 95.20 [3,] 93.90 90.31 95.14 94.61 [4,] 93.41 90.80 95.07 96.21 [5,] 93.37 90.36 94.21 96.27 [6,] 93.35 90.31 95.40 95.12 [7,] 93.08 93.80 95.10 95.55 [8,] 93.05 93.95 94.89 93.51 [9,] 92.61 93.99 95.43 92.86 [10,] 92.37 94.44 94.88 92.45 [11,] 92.24 94.15 96.03 93.34 [12,] 91.95 91.91 96.37 92.01 [13,] 92.63 91.86 96.04 91.77 [14,] 92.70 93.12 95.72 92.19 [15,] 92.47 93.47 95.74 91.97 [16,] 92.58 93.57 95.78 NA [17,] 92.55 94.57 93.66 NA [18,] 92.56 95.85 95.29 NA [19,] 89.92 96.62 94.33 NA > darr [,1] [,2] [,3] [,4] [1,] -0.07 0.07 -0.30 -0.46 [2,] -0.70 0.28 -0.25 -0.59 [3,] -0.49 0.49 -0.07 1.60 [4,] -0.04 -0.44 -0.86 0.06 [5,] -0.02 -0.05 1.19 -1.15 [6,] -0.27 3.49 -0.30 0.43 [7,] -0.03 0.15 -0.21 -2.04 [8,] -0.44 0.04 0.54 -0.65 [9,] -0.24 0.45 -0.55 -0.41 [10,] -0.13 -0.29 1.15 0.89 [11,] -0.29 -2.24 0.34 -1.33 [12,] 0.68 -0.05 -0.33 -0.24 [13,] 0.07 1.26 -0.32 0.42 [14,] -0.23 0.35 0.02 -0.22 [15,] 0.11 0.10 0.04 NA [16,] -0.03 1.00 -2.12 NA [17,] 0.01 1.28 1.63 NA [18,] -2.64 0.77 -0.96 NA [19,] 0.04 -0.93 1.33 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/1zwag1424964326.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/2xe6w1424964326.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/3tap61424964326.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/4gs5u1424964326.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,] 89.960 90.030 90.310 90.800 90.360 90.310 93.080 93.05 92.610 92.370 [2,] 92.315 92.315 92.105 92.105 91.865 91.830 93.440 93.28 92.735 92.410 [3,] 95.165 94.900 94.255 94.240 93.790 94.235 94.450 93.73 93.425 93.445 [4,] 95.675 95.295 94.875 95.640 95.240 95.260 95.325 94.42 94.710 94.660 [5,] 95.690 95.390 95.140 96.210 96.270 95.400 95.550 94.89 95.430 94.880 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 92.240 91.91 91.770 92.190 91.970 92.580 92.550 92.560 89.920 [2,] 92.790 91.93 91.815 92.445 92.220 93.075 93.105 93.925 92.125 [3,] 93.745 91.98 92.245 92.910 92.970 93.570 93.660 95.290 94.330 [4,] 95.090 94.19 94.335 94.420 94.605 94.675 94.115 95.570 95.475 [5,] 96.030 96.37 96.040 95.720 95.740 95.780 94.570 95.850 96.620 $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 92.5106 92.5458 92.0667 91.44735 91.12375 91.5253 92.96085 92.8294 [2,] 97.8194 97.2542 96.4433 97.03265 96.45625 96.9447 95.93915 94.6306 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 91.86475 91.6675 91.928 90.1946 90.2542 91.34975 91.08585 92.11046 [2,] 94.98525 95.2225 95.562 93.7654 94.2358 94.47025 94.85415 95.02954 [,17] [,18] [,19] [1,] 92.73866 93.78941 91.27409 [2,] 94.58134 96.79059 97.38591 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" Warning message: In bxp(list(stats = c(89.96, 92.315, 95.165, 95.675, 95.69, 90.03, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qh261424964326.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.460 -0.700 -0.490 -0.86 -1.150 -0.300 -2.040 -0.650 -0.550 -0.29 -2.240 [2,] -0.380 -0.645 -0.280 -0.65 -0.600 -0.285 -1.125 -0.545 -0.480 -0.21 -1.785 [3,] -0.185 -0.420 0.210 -0.24 -0.035 0.080 -0.120 -0.200 -0.325 0.38 -0.810 [4,] 0.000 0.015 1.045 0.01 0.585 1.960 0.060 0.290 0.105 1.02 0.025 [5,] 0.070 0.280 1.600 0.06 1.190 3.490 0.150 0.540 0.450 1.15 0.340 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] -0.330 -0.320 -0.230 0.040 -2.120 0.010 -2.640 -0.930 [2,] -0.285 -0.125 -0.225 0.070 -1.075 0.645 -1.800 -0.445 [3,] -0.145 0.245 -0.100 0.100 -0.030 1.280 -0.960 0.040 [4,] 0.315 0.840 0.185 0.105 0.485 1.455 -0.095 0.685 [5,] 0.680 1.260 0.350 0.110 1.000 1.630 0.770 1.330 $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.4852 -0.9414 -0.83675 -0.7614 -0.97115 -1.69355 -1.05615 -0.85965 [2,] 0.1152 0.1014 1.25675 0.2814 0.90115 1.85355 0.81615 0.45965 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] -0.78715 -0.5917 -2.2399 -0.619 -0.51735 -0.4239 0.06807253 -1.453053 [2,] 0.13715 1.3517 0.6199 0.329 1.00735 0.2239 0.13192747 1.393053 [,17] [,18] [,19] [1,] 0.5411071 -2.5153239 -0.9908012 [2,] 2.0188929 0.5953239 1.0708012 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" Warning message: In bxp(list(stats = c(-0.459999999999994, -0.379999999999995, -0.185000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60xri1424964326.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] [1,] 91.95 89.96 94.21 91.770 [2,] 92.51 90.58 94.98 92.320 [3,] 92.63 93.47 95.39 93.510 [4,] 93.36 94.07 95.73 95.375 [5,] 94.60 96.62 96.37 96.270 $n [1] 19 19 19 15 $conf [,1] [,2] [,3] [,4] [1,] 92.32189 92.20496 95.11814 92.2637 [2,] 92.93811 94.73504 95.66186 94.7563 $out [1] 94.67 89.92 93.66 $group [1] 1 1 3 $names [1] "1" "2" "3" NA Warning message: In bxp(list(stats = c(91.95, 92.51, 92.63, 93.36, 94.6, 89.96, 90.58, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/78uvk1424964326.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,] 93.06000 92.2450 93.17125 [2,] 93.51250 93.4350 93.53187 [3,] 93.62333 93.7450 93.80000 [4,] 93.90625 94.2925 93.97312 [5,] 94.38250 95.2900 94.58000 $n [1] 19 19 19 $conf [,1] [,2] [,3] [1,] 93.48061 93.43418 93.64006 [2,] 93.76606 94.05582 93.95994 $out [1] 94.56667 91.98000 92.52000 92.66000 94.74750 $group [1] 1 2 3 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.06, 93.5125, 93.6233333333333, 93.90625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zwag1424964326.ps tmp/1zwag1424964326.png",intern=TRUE)) character(0) > try(system("convert tmp/2xe6w1424964326.ps tmp/2xe6w1424964326.png",intern=TRUE)) character(0) > try(system("convert tmp/3tap61424964326.ps tmp/3tap61424964326.png",intern=TRUE)) character(0) > try(system("convert tmp/4gs5u1424964326.ps tmp/4gs5u1424964326.png",intern=TRUE)) character(0) > try(system("convert tmp/5qh261424964326.ps tmp/5qh261424964326.png",intern=TRUE)) character(0) > try(system("convert tmp/60xri1424964326.ps tmp/60xri1424964326.png",intern=TRUE)) character(0) > try(system("convert tmp/78uvk1424964326.ps tmp/78uvk1424964326.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.775 0.452 3.253