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(86.86,86.79,82.52,86.87,81.62,82.66,89.87,92.04,79.74,77.75,79.12,76.37,75.01,77.6,77.81,81.7,76.47,74.72,84.43,86.72,70.99,75.43,74.14,73.3,71.97,69.27,74.13,76.4,72.26,72.1,87.82,91.62,82.69,85.76,86.87,93.09,83.73,84.49,87.37,89.13,83.2,83.77,93.68,93.09,88.59,87.88,87.89,89.38,89.13,89.58,90.22,91.44,91.04,92.1,97.54,99.12,100,99.68,100.08,99.9,99.63,99.45,99.63,99.46,96.91,97.65,102.1,103.57,104.59,104.79,101.31,104.8,104.56,104.15,102.73,101.86,101.9,102.33,105.71,106.1,102.81,103.23,102.35,104.11) > 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,] 86.86 75.01 71.97 83.73 89.13 99.63 104.56 NA [2,] 86.79 77.60 69.27 84.49 89.58 99.45 104.15 NA [3,] 82.52 77.81 74.13 87.37 90.22 99.63 102.73 NA [4,] 86.87 81.70 76.40 89.13 91.44 99.46 101.86 NA [5,] 81.62 76.47 72.26 83.20 91.04 96.91 101.90 NA [6,] 82.66 74.72 72.10 83.77 92.10 97.65 102.33 NA [7,] 89.87 84.43 87.82 93.68 97.54 102.10 105.71 NA [8,] 92.04 86.72 91.62 93.09 99.12 103.57 106.10 NA [9,] 79.74 70.99 82.69 88.59 100.00 104.59 102.81 NA [10,] 77.75 75.43 85.76 87.88 99.68 104.79 103.23 NA [11,] 79.12 74.14 86.87 87.89 100.08 101.31 102.35 NA [12,] 76.37 73.30 93.09 89.38 99.90 104.80 104.11 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.07 2.59 -2.70 0.76 0.45 -0.18 -0.41 NA [2,] -4.27 0.21 4.86 2.88 0.64 0.18 -1.42 NA [3,] 4.35 3.89 2.27 1.76 1.22 -0.17 -0.87 NA [4,] -5.25 -5.23 -4.14 -5.93 -0.40 -2.55 0.04 NA [5,] 1.04 -1.75 -0.16 0.57 1.06 0.74 0.43 NA [6,] 7.21 9.71 15.72 9.91 5.44 4.45 3.38 NA [7,] 2.17 2.29 3.80 -0.59 1.58 1.47 0.39 NA [8,] -12.30 -15.73 -8.93 -4.50 0.88 1.02 -3.29 NA [9,] -1.99 4.44 3.07 -0.71 -0.32 0.20 0.42 NA [10,] 1.37 -1.29 1.11 0.01 0.40 -3.48 -0.88 NA [11,] -2.75 -0.84 6.22 1.49 -0.18 3.49 1.76 NA [12,] -1.36 -1.33 -9.36 -0.25 -0.27 -0.24 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/11emw1384992461.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/2db2a1384992461.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/3zfad1384992461.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/4f42g1384992461.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,] 71.97 69.270 74.130 76.400 72.260 72.100 84.430 86.720 70.990 [2,] 79.37 81.045 80.165 84.285 79.045 78.690 88.845 91.830 81.215 [3,] 86.86 86.790 87.370 89.130 83.200 83.770 93.680 93.090 88.590 [4,] 94.38 94.515 94.925 95.450 93.975 94.875 99.820 101.345 101.405 [5,] 104.56 104.150 102.730 101.860 101.900 102.330 105.710 106.100 104.590 [,10] [,11] [,12] [1,] 75.430 74.140 73.300 [2,] 81.755 82.995 82.875 [3,] 87.880 87.890 93.090 [4,] 101.455 100.695 102.005 [5,] 104.790 102.350 104.800 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 77.89627 78.74593 78.55557 82.46244 74.28404 74.10458 87.12591 87.4078 [2,] 95.82373 94.83407 96.18443 95.79756 92.11596 93.43542 100.23409 98.7722 [,9] [,10] [,11] [,12] [1,] 76.53286 76.11548 77.31985 81.66587 [2,] 100.64714 99.64452 98.46015 104.51413 $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(71.97, 79.37, 86.86, 94.38, 104.56, 69.27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55lx21384992461.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] [1,] -0.410 -1.42 -0.870 -5.930 -0.160 3.380 -0.59 -15.730 -1.990 -3.480 [2,] -0.295 -0.62 0.525 -5.240 0.135 4.945 0.93 -10.615 -0.515 -1.085 [3,] -0.070 0.21 1.760 -4.140 0.570 7.210 1.58 -4.500 0.200 0.010 [4,] 0.605 1.76 3.080 -1.475 0.890 9.810 2.23 -1.205 1.745 0.755 [5,] 0.760 4.86 4.350 0.040 1.060 15.720 3.80 1.020 4.440 1.370 [,11] [,12] [1,] -2.750 -1.36 [2,] -0.510 -1.36 [3,] 1.490 -0.80 [4,] 2.625 -0.25 [5,] 6.220 -0.24 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.6074655 -1.211298 0.2341952 -6.388397 0.1191262 4.3047 0.803661 [2,] 0.4674655 1.631298 3.2858048 -1.891603 1.0208738 10.1153 2.356339 [,8] [,9] [,10] [,11] [,12] [1,] -10.1195 -1.149636 -1.088818 -0.3821714 -1.51598585 [2,] 1.1195 1.549636 1.108818 3.3621714 -0.08401415 $out [1] 2.59 -2.70 -4.27 -1.75 -9.36 $group [1] 1 1 2 5 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.409999999999997, -0.294999999999995, -0.0699999999999932, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/604lf1384992461.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,] 76.370 70.990 69.270 83.200 89.13 96.910 101.860 NA [2,] 79.430 74.430 72.180 84.130 90.63 99.455 102.340 NA [3,] 82.590 75.950 79.545 87.885 94.82 100.470 103.020 NA [4,] 86.865 79.755 87.345 89.255 99.79 104.080 104.355 NA [5,] 92.040 86.720 93.090 93.680 100.08 104.800 106.100 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 79.19885 73.52123 72.62814 85.54745 90.64206 98.36051 102.1009 NA [2,] 85.98115 78.37877 86.46186 90.22255 98.99794 102.57949 103.9391 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(76.37, 79.43, 82.59, 86.865, 92.04, 70.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7zma01384992461.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,] 86.20000 83.200 86.51000 [2,] 87.30143 86.825 87.21000 [3,] 89.73357 87.885 90.58875 [4,] 91.10500 91.110 92.14250 [5,] 96.03714 93.680 96.58750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 87.99874 85.93058 88.3390 [2,] 91.46841 89.83942 92.8385 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(86.2, 87.3014285714286, 89.7335714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11emw1384992461.ps tmp/11emw1384992461.png",intern=TRUE)) character(0) > try(system("convert tmp/2db2a1384992461.ps tmp/2db2a1384992461.png",intern=TRUE)) character(0) > try(system("convert tmp/3zfad1384992461.ps tmp/3zfad1384992461.png",intern=TRUE)) character(0) > try(system("convert tmp/4f42g1384992461.ps tmp/4f42g1384992461.png",intern=TRUE)) character(0) > try(system("convert tmp/55lx21384992461.ps tmp/55lx21384992461.png",intern=TRUE)) character(0) > try(system("convert tmp/604lf1384992461.ps tmp/604lf1384992461.png",intern=TRUE)) character(0) > try(system("convert tmp/7zma01384992461.ps tmp/7zma01384992461.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.377 0.737 4.100