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(6714.580043,7702.883281,9855.858483,8326.43136,9268.841212,7035.408602,10341.50586,11681.94192,10303.57287,11384.5829,9777.225921,8882.366455,7896.590139,6929.564098,9544.753788,9110.342185,7458.710291,7319.772861,10017.34419,12307.13647,11072.29609,10748.84755,9588.810984,9080.170402,7384.440407,8062.058679,8510.578229,8684.345395,8305.968153,7642.565124,10577.49554,13747.19397,11783.27459,11611.42999,9945.741914,8692.951724,7302.520182,7609.123374,9423.286031,8583.625656,7586.252878,6842.894335,11810.62427,13413.53598,12102.72578,11501.16989,8212.500701,7981.599542,7687,7180,7862,8043,8340,6692,10065,12684,11587,9843,8110,7940,6475,6121,9669,7778,7826,7403,10741,14023,11519,10236,8075,8157) > 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,] 6714.580 7896.590 7384.440 7302.520 7687 6475 NA [2,] 7702.883 6929.564 8062.059 7609.123 7180 6121 NA [3,] 9855.858 9544.754 8510.578 9423.286 7862 9669 NA [4,] 8326.431 9110.342 8684.345 8583.626 8043 7778 NA [5,] 9268.841 7458.710 8305.968 7586.253 8340 7826 NA [6,] 7035.409 7319.773 7642.565 6842.894 6692 7403 NA [7,] 10341.506 10017.344 10577.496 11810.624 10065 10741 NA [8,] 11681.942 12307.136 13747.194 13413.536 12684 14023 NA [9,] 10303.573 11072.296 11783.275 12102.726 11587 11519 NA [10,] 11384.583 10748.848 11611.430 11501.170 9843 10236 NA [11,] 9777.226 9588.811 9945.742 8212.501 8110 8075 NA [12,] 8882.366 9080.170 8692.952 7981.600 7940 8157 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 988.3032 -967.0260 677.6183 306.6032 -507 -354 NA [2,] 2152.9752 2615.1897 448.5196 1814.1627 682 3548 NA [3,] -1529.4271 -434.4116 173.7672 -839.6604 181 -1891 NA [4,] 942.4099 -1651.6319 -378.3772 -997.3728 297 48 NA [5,] -2233.4326 -138.9374 -663.4030 -743.3585 -1648 -423 NA [6,] 3306.0973 2697.5713 2934.9304 4967.7299 3373 3338 NA [7,] 1340.4361 2289.7923 3169.6984 1602.9117 2619 3282 NA [8,] -1378.3690 -1234.8404 -1963.9194 -1310.8102 -1097 -2504 NA [9,] 1081.0100 -323.4485 -171.8446 -601.5559 -1744 -1283 NA [10,] -1607.3570 -1160.0366 -1665.6881 -3288.6692 -1733 -2161 NA [11,] -894.8595 -508.6406 -1252.7902 -230.9012 -170 82 NA [12,] -985.7763 -1695.7300 -1390.4315 -294.5995 -1465 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/1i0m31389351266.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/2bzn71389351266.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/3q3a71389351266.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/40n4v1389351266.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,] 6475.00 6121.000 7862.000 7778.000 7458.710 6692.000 10017.34 11681.94 [2,] 6714.58 6929.564 8510.578 8043.000 7586.253 6842.894 10065.00 12307.14 [3,] 7343.48 7394.562 9484.020 8455.029 8065.984 7177.591 10459.50 13048.77 [4,] 7687.00 7702.883 9669.000 8684.345 8340.000 7403.000 10741.00 13747.19 [5,] 7896.59 8062.059 9855.858 9110.342 9268.841 7642.565 10741.00 14023.00 [,9] [,10] [,11] [,12] [1,] 10303.57 9843.00 8075.000 7940.000 [2,] 11072.30 10236.00 8110.000 7981.600 [3,] 11553.00 11066.72 8900.656 8424.976 [4,] 11783.27 11501.17 9777.226 8882.366 [5,] 12102.73 11611.43 9945.742 9080.170 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6716.238 6895.746 8736.80 8041.340 7579.793 6816.304 10023.46 12119.88 [2,] 7970.723 7893.378 10231.24 8868.717 8552.175 7538.877 10895.54 13977.65 [,9] [,10] [,11] [,12] [1,] 11094.4 10250.64 7825.241 7843.952 [2,] 12011.6 11882.79 9976.070 9006.000 $out [1] 11810.62 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(6475, 6714.580043, 7343.4802945, 7687, 7896.590139, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sw631389351266.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] [1,] -967.0260 448.5196 -1891.0000 -1651.6319 -2233.4326 2697.571 1340.436 [2,] -507.0000 682.0000 -1529.4271 -997.3728 -1648.0000 2934.930 1602.912 [3,] -23.6984 1983.5689 -637.0360 -165.1886 -703.3808 3322.049 2454.396 [4,] 677.6183 2615.1897 173.7672 297.0000 -423.0000 3373.000 3169.698 [5,] 988.3032 3548.0000 181.0000 942.4099 -138.9374 3373.000 3282.000 [,8] [,9] [,10] [,11] [,12] [1,] -2504.000 -1744.0000 -2161.000 -1252.7902 -1695.7300 [2,] -1963.919 -1283.0000 -2161.000 -894.8595 -1465.0000 [3,] -1344.590 -462.5022 -1699.344 -369.7709 -1390.4315 [4,] -1234.840 -171.8446 -1607.357 -170.0000 -985.7763 [5,] -1097.000 1081.0100 -1160.037 82.0000 -294.5995 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -787.8155 736.5991 -1735.6513 -1000.1009 -1493.54535 3039.480 1443.768 [2,] 740.4186 3230.5387 461.5793 669.7236 86.78378 3604.618 3465.024 [,8] [,9] [,10] [,11] [,12] [1,] -1814.8691 -1179.2333 -2056.462 -837.3286 -1729.050 [2,] -874.3101 254.2289 -1342.226 97.7869 -1051.813 $out [1] 4967.730 -3288.669 $group [1] 6 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-967.026041, -507, -23.6984040000002, 677.618272, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jt7r1389351267.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,] 6714.580 6929.564 7384.440 6842.894 6692.0 6121.0 NA [2,] 8014.657 7677.650 8184.013 7597.688 7774.5 7590.5 NA [3,] 9523.034 9327.548 8688.649 8398.063 8076.5 8116.0 NA [4,] 10322.539 10383.096 11094.463 11655.897 9954.0 10488.5 NA [5,] 11681.942 12307.136 13747.194 13413.536 12684.0 14023.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 8470.393 8093.576 7361.173 6547.087 7082.415 6794.203 NA [2,] 10575.674 10561.520 10016.124 10249.040 9070.585 9437.797 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(6714.580043, 8014.6573205, 9523.0335665, 10322.539365, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79s4u1389351267.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,] 7155.940 7177.591 7136.608 [2,] 7699.200 7730.273 7662.325 [3,] 8703.614 8677.842 8681.552 [4,] 10739.833 10763.108 10667.621 [5,] 12976.135 13048.768 13032.566 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7316.761 7294.546 7310.816 [2,] 10090.467 10061.139 10052.289 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(7155.94015366667, 7699.20016383333, 8703.61397025, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1i0m31389351266.ps tmp/1i0m31389351266.png",intern=TRUE)) character(0) > try(system("convert tmp/2bzn71389351266.ps tmp/2bzn71389351266.png",intern=TRUE)) character(0) > try(system("convert tmp/3q3a71389351266.ps tmp/3q3a71389351266.png",intern=TRUE)) character(0) > try(system("convert tmp/40n4v1389351266.ps tmp/40n4v1389351266.png",intern=TRUE)) character(0) > try(system("convert tmp/5sw631389351266.ps tmp/5sw631389351266.png",intern=TRUE)) character(0) > try(system("convert tmp/6jt7r1389351267.ps tmp/6jt7r1389351267.png",intern=TRUE)) character(0) > try(system("convert tmp/79s4u1389351267.ps tmp/79s4u1389351267.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.897 0.983 5.853