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(18293.9,18613.4,18728.5,20091.8,18947.2,20124.9,19819.2,15908.6,19927.4,19551.9,15588.6,14206.2,13566.7,13941.5,14964.1,14086,13505.1,15300.4,14725.2,12484.9,16082.6,15915.8,15916.1,15713,14746,15253.2,18384.3,16848.5,16485.5,19257.1,17093.4,15700.1,19124.3,18640.8,18439.2,17106.3,18347.7,19372.7,22263.8,19422.9,21268.6,20310,19256,17535.9,19857.4,19628.4,19727.5,18112.2,19080.2,20684.6,22537.7,19954.6,20230.2,20445.5,19615.3,18071.6,19287.2,21031.4,19860.9,17671.3,19359.2,19287,21498,20859.7,20833.1,20318.8,21375.9,17403.4,21050.1,22010.2,20372.1,19028.4) > 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,] 18293.9 13566.7 14746.0 18347.7 19080.2 19359.2 NA [2,] 18613.4 13941.5 15253.2 19372.7 20684.6 19287.0 NA [3,] 18728.5 14964.1 18384.3 22263.8 22537.7 21498.0 NA [4,] 20091.8 14086.0 16848.5 19422.9 19954.6 20859.7 NA [5,] 18947.2 13505.1 16485.5 21268.6 20230.2 20833.1 NA [6,] 20124.9 15300.4 19257.1 20310.0 20445.5 20318.8 NA [7,] 19819.2 14725.2 17093.4 19256.0 19615.3 21375.9 NA [8,] 15908.6 12484.9 15700.1 17535.9 18071.6 17403.4 NA [9,] 19927.4 16082.6 19124.3 19857.4 19287.2 21050.1 NA [10,] 19551.9 15915.8 18640.8 19628.4 21031.4 22010.2 NA [11,] 15588.6 15916.1 18439.2 19727.5 19860.9 20372.1 NA [12,] 14206.2 15713.0 17106.3 18112.2 17671.3 19028.4 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 319.5 374.8 507.2 1025.0 1604.4 -72.2 NA [2,] 115.1 1022.6 3131.1 2891.1 1853.1 2211.0 NA [3,] 1363.3 -878.1 -1535.8 -2840.9 -2583.1 -638.3 NA [4,] -1144.6 -580.9 -363.0 1845.7 275.6 -26.6 NA [5,] 1177.7 1795.3 2771.6 -958.6 215.3 -514.3 NA [6,] -305.7 -575.2 -2163.7 -1054.0 -830.2 1057.1 NA [7,] -3910.6 -2240.3 -1393.3 -1720.1 -1543.7 -3972.5 NA [8,] 4018.8 3597.7 3424.2 2321.5 1215.6 3646.7 NA [9,] -375.5 -166.8 -483.5 -229.0 1744.2 960.1 NA [10,] -3963.3 0.3 -201.6 99.1 -1170.5 -1638.1 NA [11,] -1382.4 -203.1 -1332.9 -1615.3 -2189.6 -1343.7 NA [12,] -639.5 -967.0 1241.4 968.0 1687.9 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/11v5n1412955095.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/2o9na1412955095.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/3lbia1412955095.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/4sjq11412955095.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] [1,] 13566.7 13941.5 14964.10 14086.00 13505.1 19257.10 14725.20 15700.1 [2,] 14746.0 15253.2 18384.30 16848.50 16485.5 19257.10 17093.40 15700.1 [3,] 18320.8 18950.2 20113.25 19688.75 19588.7 20217.45 19435.65 16656.0 [4,] 19080.2 19372.7 22263.80 20091.80 20833.1 20318.80 19819.20 17535.9 [5,] 19359.2 20684.6 22537.70 20859.70 21268.6 20445.50 21375.90 18071.6 [,9] [,10] [,11] [,12] [1,] 19124.3 15915.80 15588.60 14206.2 [2,] 19124.3 18640.80 15916.10 15713.0 [3,] 19572.3 19590.15 19083.35 17388.8 [4,] 19927.4 21031.40 19860.90 18112.2 [5,] 21050.1 22010.20 20372.10 19028.4 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15525.1 16292.99 17610.85 17596.72 16784.36 19532.62 17677.42 15471.85 [2,] 21116.5 21607.41 22615.65 21780.78 22393.04 20902.28 21193.88 17840.15 [,9] [,10] [,11] [,12] [1,] 19054.27 18048.14 16538.83 15841.24 [2,] 20090.33 21132.16 21627.87 18936.36 $out [1] 15300.4 12484.9 16082.6 $group [1] 6 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(13566.7, 14746, 18320.8, 19080.2, 19359.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mbho1412955095.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] [1,] -72.2 115.10 -2840.90 -1144.6 -958.6 -2163.7 -3972.5 1215.60 -483.5 [2,] 319.5 1022.60 -2583.10 -580.9 -514.3 -1054.0 -3910.6 2321.50 -375.5 [3,] 441.0 2032.05 -1206.95 -194.8 696.5 -702.7 -1980.2 3510.95 -197.9 [4,] 1025.0 2891.10 -638.30 275.6 1795.3 -305.7 -1543.7 3646.70 960.1 [5,] 1604.4 3131.10 1363.30 275.6 2771.6 -305.7 -1393.3 4018.80 1744.2 [,10] [,11] [,12] [1,] -3963.30 -1615.30 -967.0 [2,] -1638.10 -1615.30 -639.5 [3,] -686.05 -1363.05 968.0 [4,] 0.30 -1332.90 1241.4 [5,] 99.10 -1332.90 1687.9 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -14.07029 826.8071 -2461.40881 -747.2702 -793.2666 -1185.3777 -3506.9269 [2,] 896.07029 3237.2929 47.50881 357.6702 2186.2666 -220.0223 -453.4731 [,8] [,9] [,10] [,11] [,12] [1,] 2656.153 -1059.4051 -1742.8709 -1545.207 -361.0392 [2,] 4365.747 663.6051 370.7709 -1180.893 2297.0392 $out [1] 1845.7 1057.1 -203.1 -2189.6 $group [1] 4 6 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-72.2000000000007, 319.5, 441, 1025, 1604.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61rw51412955095.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,] 14206.20 12484.90 14746.00 17535.90 17671.30 17403.4 NA [2,] 17101.25 13754.10 16092.80 18801.85 19183.70 19323.1 NA [3,] 18837.85 14844.65 17099.85 19525.65 19907.75 20602.6 NA [4,] 19873.30 15814.40 18540.00 20083.70 20565.05 21213.0 NA [5,] 20124.90 16082.60 19257.10 21268.60 22537.70 22010.2 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 17573.5 13904.93 15983.67 18940.99 19277.71 19740.6 NA [2,] 20102.2 15784.37 18216.03 20110.31 20537.79 21464.6 NA $out [1] 22263.8 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(14206.2, 17101.25, 18837.85, 19873.3, 20124.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7kn5k1412955095.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,] 16184.08 17388.80 16627.50 [2,] 17545.51 18635.50 17493.64 [3,] 18544.43 19503.98 18737.97 [4,] 19257.14 19639.45 19656.04 [5,] 19729.40 20217.45 20271.35 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 17763.75 19046.07 17751.69 [2,] 19325.12 19961.88 19724.25 $out [1] 16656 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16184.0833333333, 17545.5083333333, 18544.4333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11v5n1412955095.ps tmp/11v5n1412955095.png",intern=TRUE)) character(0) > try(system("convert tmp/2o9na1412955095.ps tmp/2o9na1412955095.png",intern=TRUE)) character(0) > try(system("convert tmp/3lbia1412955095.ps tmp/3lbia1412955095.png",intern=TRUE)) character(0) > try(system("convert tmp/4sjq11412955095.ps tmp/4sjq11412955095.png",intern=TRUE)) character(0) > try(system("convert tmp/5mbho1412955095.ps tmp/5mbho1412955095.png",intern=TRUE)) character(0) > try(system("convert tmp/61rw51412955095.ps tmp/61rw51412955095.png",intern=TRUE)) character(0) > try(system("convert tmp/7kn5k1412955095.ps tmp/7kn5k1412955095.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.579 0.415 3.017