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(93.61,93.17,91.60,90.30,90.88,91.06,92.05,95.29,96.44,96.49,96.52,96.09,99.16,98.09,99.41,99.87,100.06,99.65,99.92,98.44,102.64,112.33,115.63,118.29,121.43,129.96,147.73,154.10,150.09,144.14,141.54,136.68,129.32,118.99,109.61,106.22,104.97,102.45,101.91,101.77,102.67,103.45,101.41,102.45,102.17,101.40,101.68,100.61,97.93,98.30,99.79,101.62,101.55,102.43,102.09,102.01,102.26,101.24,100.91,100.67,100.33,99.99,99.23,98.17,97.38,96.70,98.65,100.68,101.07,101.12,101.13,99.88,99.20,99.91,103.62,108.05,113.96,117.39,126.04,139.67,145.04,142.37,137.72,132.46) > 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,] 93.61 99.16 121.43 104.97 97.93 100.33 99.20 NA [2,] 93.17 98.09 129.96 102.45 98.30 99.99 99.91 NA [3,] 91.60 99.41 147.73 101.91 99.79 99.23 103.62 NA [4,] 90.30 99.87 154.10 101.77 101.62 98.17 108.05 NA [5,] 90.88 100.06 150.09 102.67 101.55 97.38 113.96 NA [6,] 91.06 99.65 144.14 103.45 102.43 96.70 117.39 NA [7,] 92.05 99.92 141.54 101.41 102.09 98.65 126.04 NA [8,] 95.29 98.44 136.68 102.45 102.01 100.68 139.67 NA [9,] 96.44 102.64 129.32 102.17 102.26 101.07 145.04 NA [10,] 96.49 112.33 118.99 101.40 101.24 101.12 142.37 NA [11,] 96.52 115.63 109.61 101.68 100.91 101.13 137.72 NA [12,] 96.09 118.29 106.22 100.61 100.67 99.88 132.46 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.44 -1.07 8.53 -2.52 0.37 -0.34 0.71 NA [2,] -1.57 1.32 17.77 -0.54 1.49 -0.76 3.71 NA [3,] -1.30 0.46 6.37 -0.14 1.83 -1.06 4.43 NA [4,] 0.58 0.19 -4.01 0.90 -0.07 -0.79 5.91 NA [5,] 0.18 -0.41 -5.95 0.78 0.88 -0.68 3.43 NA [6,] 0.99 0.27 -2.60 -2.04 -0.34 1.95 8.65 NA [7,] 3.24 -1.48 -4.86 1.04 -0.08 2.03 13.63 NA [8,] 1.15 4.20 -7.36 -0.28 0.25 0.39 5.37 NA [9,] 0.05 9.69 -10.33 -0.77 -1.02 0.05 -2.67 NA [10,] 0.03 3.30 -9.38 0.28 -0.33 0.01 -4.65 NA [11,] -0.43 2.66 -3.39 -1.07 -0.24 -1.25 -5.26 NA [12,] 3.07 3.14 -1.25 -2.68 -0.34 -0.68 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/1vjk01389308972.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/2srl51389308972.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/3d4911389308972.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/40pzf1389308972.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,] 93.610 98.090 99.230 90.30 90.880 91.060 92.050 95.290 96.44 [2,] 98.545 98.195 99.320 99.02 98.720 98.175 99.285 99.560 101.62 [3,] 99.200 99.910 99.790 101.62 101.550 102.430 101.410 102.010 102.26 [4,] 102.650 101.220 102.765 104.91 108.315 110.420 114.065 119.565 115.98 [5,] 104.970 102.450 103.620 108.05 113.960 117.390 126.040 139.670 129.32 [,10] [,11] [,12] [1,] 96.49 96.52 96.090 [2,] 101.18 101.02 100.245 [3,] 101.40 101.68 100.670 [4,] 115.66 112.62 112.255 [5,] 118.99 115.63 118.290 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.74856 98.10352 97.7327 98.10259 95.82002 95.11748 92.58362 [2,] 101.65144 101.71648 101.8473 105.13741 107.27998 109.74252 110.23638 [,8] [,9] [,10] [,11] [,12] [1,] 90.06334 93.68444 92.75278 94.75267 93.49782 [2,] 113.95666 110.83556 110.04722 108.60733 107.84218 $out [1] 121.43 93.17 129.96 91.60 147.73 154.10 150.09 144.14 141.54 145.04 [11] 142.37 137.72 132.46 $group [1] 1 2 2 3 3 4 5 6 7 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(93.61, 98.545, 99.2, 102.65, 104.97, 98.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/565wr1389308972.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.520 -1.57 -1.30 -0.79 -0.680 -2.60 -4.860 -0.280 -2.670 -4.650 -5.260 [2,] -0.755 -0.65 -0.60 -0.43 -0.545 -1.19 -0.780 -0.015 -1.845 -2.490 -2.320 [3,] -0.340 1.32 0.46 0.19 0.180 0.27 1.040 0.390 -0.770 0.010 -1.070 [4,] 0.540 2.60 3.13 0.74 0.830 1.47 2.635 2.675 0.050 0.155 -0.335 [5,] 0.710 3.71 6.37 0.90 0.880 1.95 3.240 5.370 0.050 3.300 -0.240 [,12] [1,] -2.68 [2,] -1.25 [3,] -0.51 [4,] 3.07 [5,] 3.14 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.1133531 -0.6208476 -1.767496 -0.5087051 -0.6411278 -1.318509 -0.9993829 [2,] 0.4333531 3.2608476 2.687496 0.8887051 1.0011278 1.858509 3.0793829 [,8] [,9] [,10] [,11] [,12] [1,] -1.216425 -1.9016634 -1.569551 -2.25541 -3.29654 [2,] 1.996425 0.3616634 1.589551 0.11541 2.27654 $out [1] 8.53 17.77 -4.01 5.91 -5.95 3.43 8.65 13.63 -7.36 9.69 [11] -10.33 -9.38 2.66 $group [1] 1 2 4 4 5 5 6 7 8 9 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.52, -0.754999999999995, -0.340000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6v8rf1389308972.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,] 90.300 98.090 106.220 100.610 97.930 96.700 99.200 NA [2,] 91.330 99.285 120.210 101.545 100.230 98.410 105.835 NA [3,] 93.390 99.895 133.320 102.040 101.395 99.935 121.715 NA [4,] 96.265 107.485 145.935 102.560 102.050 100.875 138.695 NA [5,] 96.520 118.290 154.100 103.450 102.430 101.130 145.040 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 91.13911 96.15492 121.5867 101.5771 100.5649 98.8107 106.7273 NA [2,] 95.64089 103.63508 145.0533 102.5029 102.2251 101.0593 136.7027 NA $out [1] 104.97 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(90.3, 91.33, 93.39, 96.265, 96.52, 98.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7zcyb1389308972.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,] 103.1243 99.200 99.7075 [2,] 106.9407 100.290 101.5037 [3,] 107.9579 101.480 105.2738 [4,] 109.7957 101.845 107.6200 [5,] 111.2771 102.430 109.5625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 106.6557 100.7708 102.4841 [2,] 109.2600 102.1892 108.0634 $out [1] 102.3757 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(103.124285714286, 106.940714285714, 107.957857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vjk01389308972.ps tmp/1vjk01389308972.png",intern=TRUE)) character(0) > try(system("convert tmp/2srl51389308972.ps tmp/2srl51389308972.png",intern=TRUE)) character(0) > try(system("convert tmp/3d4911389308972.ps tmp/3d4911389308972.png",intern=TRUE)) character(0) > try(system("convert tmp/40pzf1389308972.ps tmp/40pzf1389308972.png",intern=TRUE)) character(0) > try(system("convert tmp/565wr1389308972.ps tmp/565wr1389308972.png",intern=TRUE)) character(0) > try(system("convert tmp/6v8rf1389308972.ps tmp/6v8rf1389308972.png",intern=TRUE)) character(0) > try(system("convert tmp/7zcyb1389308972.ps tmp/7zcyb1389308972.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.134 1.549 8.671