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(6715,7703,9856,8326,9269,7035,10342,11682,10304,11385,9777,8882,7897,6930,9545,9110,7459,7320,10017,12307,11072,10749,9589,9080,7384,8062,8511,8684,8306,7643,10577,13747,11783,11611,9946,8693,7303,7609,9423,8584,7586,6843,11811,13414,12103,11501,8213,7982,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,] 6715 7897 7384 7303 7687 6475 NA [2,] 7703 6930 8062 7609 7180 6121 NA [3,] 9856 9545 8511 9423 7862 9669 NA [4,] 8326 9110 8684 8584 8043 7778 NA [5,] 9269 7459 8306 7586 8340 7826 NA [6,] 7035 7320 7643 6843 6692 7403 NA [7,] 10342 10017 10577 11811 10065 10741 NA [8,] 11682 12307 13747 13414 12684 14023 NA [9,] 10304 11072 11783 12103 11587 11519 NA [10,] 11385 10749 11611 11501 9843 10236 NA [11,] 9777 9589 9946 8213 8110 8075 NA [12,] 8882 9080 8693 7982 7940 8157 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 988 -967 678 306 -507 -354 NA [2,] 2153 2615 449 1814 682 3548 NA [3,] -1530 -435 173 -839 181 -1891 NA [4,] 943 -1651 -378 -998 297 48 NA [5,] -2234 -139 -663 -743 -1648 -423 NA [6,] 3307 2697 2934 4968 3373 3338 NA [7,] 1340 2290 3170 1603 2619 3282 NA [8,] -1378 -1235 -1964 -1311 -1097 -2504 NA [9,] 1081 -323 -172 -602 -1744 -1283 NA [10,] -1608 -1160 -1665 -3288 -1733 -2161 NA [11,] -895 -509 -1253 -231 -170 82 NA [12,] -985 -1696 -1390 -295 -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/1s4p61384773534.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/244wx1384773534.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/3ekj71384773534.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/42qgq1384773534.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] [,11] [,12] [1,] 6475.0 6121.0 7862 7778 7459 6692.0 10017.0 11682 10304 9843 8075 7940 [2,] 6715.0 6930.0 8511 8043 7586 6843.0 10065.0 12307 11072 10236 8110 7982 [3,] 7343.5 7394.5 9484 8455 8066 7177.5 10459.5 13049 11553 11067 8901 8425 [4,] 7687.0 7703.0 9669 8684 8340 7403.0 10741.0 13747 11783 11501 9777 8882 [5,] 7897.0 8062.0 9856 9110 9269 7643.0 10741.0 14023 12103 11611 9946 9080 $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.529 6895.89 8737.053 8041.534 7579.646 6816.282 10023.46 12120.15 [2,] 7970.471 7893.11 10230.947 8868.466 8552.354 7538.718 10895.54 13977.85 [,9] [,10] [,11] [,12] [1,] 11094.38 10251.03 7825.731 7844.471 [2,] 12011.62 11882.97 9976.269 9005.529 $out [1] 11811 $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, 6715, 7343.5, 7687, 7897, 6121, 6930, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55bni1384773534.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,] -967 449.0 -1891 -1651 -2234 2697.0 1340.0 -2504.0 -1744.0 -2161 -1253 [2,] -507 682.0 -1530 -998 -1648 2934.0 1603.0 -1964.0 -1283.0 -2161 -895 [3,] -24 1983.5 -637 -165 -703 3322.5 2454.5 -1344.5 -462.5 -1699 -370 [4,] 678 2615.0 173 297 -423 3373.0 3170.0 -1235.0 -172.0 -1608 -170 [5,] 988 3548.0 181 943 -139 3373.0 3282.0 -1097.0 1081.0 -1160 82 [,12] [1,] -1696 [2,] -1465 [3,] -1390 [4,] -985 [5,] -295 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -788.3633 736.6526 -1735.49 -1000.3168 -1493.16457 3039.331 1443.734 [2,] 740.3633 3230.3474 461.49 670.3168 87.16457 3605.669 3465.266 [,8] [,9] [,10] [,11] [,12] [1,] -1814.7285 -1179.1309 -2055.703 -837.64842 -1729.167 [2,] -874.2715 254.1309 -1342.297 97.64842 -1050.833 $out [1] 4968 -3288 $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, -507, -24, 678, 988, 449, 682, 1983.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6nc4i1384773534.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,] 6715.0 6930.0 7384.0 6843.0 6692.0 6121.0 NA [2,] 8014.5 7678.0 8184.0 7597.5 7774.5 7590.5 NA [3,] 9523.0 9327.5 8688.5 8398.5 8076.5 8116.0 NA [4,] 10323.0 10383.0 11094.0 11656.0 9954.0 10488.5 NA [5,] 11682.0 12307.0 13747.0 13414.0 12684.0 14023.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 8470.078 8093.731 7361.229 6547.391 7082.415 6794.203 NA [2,] 10575.922 10561.269 10015.771 10249.609 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(6715, 8014.5, 9523, 10323, 11682, 6930, 7678, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7nbws1384773534.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,] 7156.000 7177.50 7136.625 [2,] 7699.250 7730.25 7662.375 [3,] 8703.667 8678.00 8681.562 [4,] 10739.833 10763.25 10667.625 [5,] 12976.167 13049.00 13032.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7316.836 7294.628 7310.848 [2,] 10090.497 10061.372 10052.277 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(7156, 7699.25, 8703.66666666667, 10739.8333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1s4p61384773534.ps tmp/1s4p61384773534.png",intern=TRUE)) character(0) > try(system("convert tmp/244wx1384773534.ps tmp/244wx1384773534.png",intern=TRUE)) character(0) > try(system("convert tmp/3ekj71384773534.ps tmp/3ekj71384773534.png",intern=TRUE)) character(0) > try(system("convert tmp/42qgq1384773534.ps tmp/42qgq1384773534.png",intern=TRUE)) character(0) > try(system("convert tmp/55bni1384773534.ps tmp/55bni1384773534.png",intern=TRUE)) character(0) > try(system("convert tmp/6nc4i1384773534.ps tmp/6nc4i1384773534.png",intern=TRUE)) character(0) > try(system("convert tmp/7nbws1384773534.ps tmp/7nbws1384773534.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.374 0.708 4.068