R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(989,1215,2911,2372,2013,2050,1580,1407,903,709,490,206,1101,1189,2877,2489,2145,1837,1613,1296,849,642,475,224,920,1263,2999,2988,2163,2391,1556,1089,976,626,392,203,1052,1034,2353,3075,2309,2009,1464,1099,1035,792,406,187,862,822,2128,2264,1987,1728,1311,1152,945,704,526,361,1035,869,2698,2367,1926,1843,1404,1314,1007,865,587,339,1143,1807,2380,2337,2117,1789,1569,1305,952,810,473,278,993,1038,2257,2284,1747,1515,1233,882,1029,707,391,239,592,692,2127,1854,1468,1535,1203,880,821,604,315,139,528,654,1895,1598,1519,1242,1027,762,735,485,281,131,651,611,1898,1385,1047,1008,843,833,711,444,315,204,473,566,1611,1301,1154,1158,862,801,559,404,223,158,548,647,1757,1326,1308,1175,992,808,758,553,310,146) > 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] 156 > (np <- floor(n / par1)) [1] 13 > 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] 13 13 13 13 13 13 13 13 13 13 13 13 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 989 1101 920 1052 862 1035 1143 993 592 528 651 473 548 [2,] 1215 1189 1263 1034 822 869 1807 1038 692 654 611 566 647 [3,] 2911 2877 2999 2353 2128 2698 2380 2257 2127 1895 1898 1611 1757 [4,] 2372 2489 2988 3075 2264 2367 2337 2284 1854 1598 1385 1301 1326 [5,] 2013 2145 2163 2309 1987 1926 2117 1747 1468 1519 1047 1154 1308 [6,] 2050 1837 2391 2009 1728 1843 1789 1515 1535 1242 1008 1158 1175 [7,] 1580 1613 1556 1464 1311 1404 1569 1233 1203 1027 843 862 992 [8,] 1407 1296 1089 1099 1152 1314 1305 882 880 762 833 801 808 [9,] 903 849 976 1035 945 1007 952 1029 821 735 711 559 758 [10,] 709 642 626 792 704 865 810 707 604 485 444 404 553 [11,] 490 475 392 406 526 587 473 391 315 281 315 223 310 [12,] 206 224 203 187 361 339 278 239 139 131 204 158 146 [,14] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 226 88 343 -18 -40 -166 664 45 100 126 -40 93 99 [2,] 1696 1688 1736 1319 1306 1829 573 1219 1435 1241 1287 1045 1110 [3,] -539 -388 -11 722 136 -331 -43 27 -273 -297 -513 -310 -431 [4,] -359 -344 -825 -766 -277 -441 -220 -537 -386 -79 -338 -147 -18 [5,] 37 -308 228 -300 -259 -83 -328 -232 67 -277 -39 4 -133 [6,] -470 -224 -835 -545 -417 -439 -220 -282 -332 -215 -165 -296 -183 [7,] -173 -317 -467 -365 -159 -90 -264 -351 -323 -265 -10 -61 -184 [8,] -504 -447 -113 -64 -207 -307 -353 147 -59 -27 -122 -242 -50 [9,] -194 -207 -350 -243 -241 -142 -142 -322 -217 -250 -267 -155 -205 [10,] -219 -167 -234 -386 -178 -278 -337 -316 -289 -204 -129 -181 -243 [11,] -284 -251 -189 -219 -165 -248 -195 -152 -176 -150 -111 -65 -164 [12,] 895 696 849 675 674 804 715 353 389 520 269 390 NA [,14] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] 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/1tcc41447959481.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=13.888888888889,height=8.3333333333333) > 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/21i031447959481.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=13.888888888889,height=8.3333333333333) > 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/37xxi1447959481.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=13.888888888889,height=8.3333333333333) > 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/4rssw1447959481.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=13.888888888889,height=8.3333333333333) > 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,] 473 566 1611 1301 1047 1008 843 762 559 404 223 131 [2,] 592 654 1898 1598 1468 1242 1027 833 758 553 315 158 [3,] 920 869 2257 2284 1926 1728 1311 1089 903 642 392 204 [4,] 1035 1189 2698 2372 2117 1843 1556 1296 976 709 475 239 [5,] 1143 1807 2999 3075 2309 2391 1613 1407 1035 865 587 339 $n [1] 13 13 13 13 13 13 13 13 13 13 13 13 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 725.8716 634.556 1906.429 1944.823 1641.6 1464.634 1079.185 886.1073 [2,] 1114.1284 1103.444 2607.571 2623.177 2210.4 1991.366 1542.815 1291.8927 [,9] [,10] [,11] [,12] [1,] 807.4695 573.6387 321.8859 168.5047 [2,] 998.5305 710.3613 462.1141 239.4953 $out [1] 361 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(473, 592, 920, 1035, 1143, 566, 654, 869, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ddhf1447959481.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=13.888888888889,height=8.3333333333333) > 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] [,12] [1,] -166 573 -539 -766 -328 -545 -467 -504 -322 -386 -284 269.0 [2,] -18 1219 -388 -441 -277 -439 -323 -307 -250 -289 -219 389.5 [3,] 93 1306 -297 -344 -133 -296 -264 -122 -217 -234 -176 674.5 [4,] 126 1688 -11 -220 4 -220 -159 -59 -194 -181 -152 759.5 [5,] 226 1829 136 -18 228 -165 -10 147 -142 -129 -65 895.0 $n [1] 13 13 13 13 13 13 13 13 13 13 13 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 29.89731 1100.478 -462.2064 -440.8451 -256.137897 -391.9687 -335.867 [2,] 156.10269 1511.522 -131.7936 -247.1549 -9.862103 -200.0313 -192.133 [,8] [,9] [,10] [,11] [,12] [1,] -230.67686 -241.5399 -281.327 -205.3603 505.7405 [2,] -13.32314 -192.4601 -186.673 -146.6397 843.2595 $out [1] 343 664 722 -825 -835 -350 $group [1] 1 1 3 4 6 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-166, -18, 93, 126, 226, 573, 1219, 1306, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6w4w91447959481.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=13.888888888889,height=8.3333333333333) > 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] [,9] [,10] [,11] [1,] 206.0 224.0 203 187.0 361.0 339.0 278 239.0 139.0 131.0 204.0 [2,] 806.0 745.5 773 913.0 763.0 867.0 881 794.5 598.0 506.5 527.5 [3,] 1311.0 1242.5 1176 1075.5 1048.5 1174.5 1437 1033.5 850.5 748.5 772.0 [4,] 2031.5 1991.0 2277 2159.0 1857.5 1884.5 1962 1631.0 1501.5 1380.5 1027.5 [5,] 2911.0 2877.0 2999 3075.0 2264.0 2698.0 2380 2284.0 2127.0 1895.0 1385.0 [,12] [,13] [,14] [1,] 158.0 146.0 NA [2,] 438.5 550.5 NA [3,] 683.5 783.0 NA [4,] 1156.0 1241.5 NA [5,] 1611.0 1757.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 752.0412 674.4191 490.0155 507.191 549.2912 710.4114 943.9486 [2,] 1869.9588 1810.5809 1861.9845 1643.809 1547.7088 1638.5886 1930.0514 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 651.9667 438.4076 349.8627 543.9466 356.2434 467.8303 NA [2,] 1415.0333 1262.5924 1147.1373 1000.0534 1010.7566 1098.1697 NA $out [1] 1898 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" NA Warning message: In bxp(list(stats = c(206, 806, 1311, 2031.5, 2911, 224, 745.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/71o391447959481.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=13.888888888889,height=8.3333333333333) > 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,] 216.5385 204.0 198.50 [2,] 739.6923 755.5 722.25 [3,] 1001.3462 1004.5 993.00 [4,] 1699.3462 1827.0 1667.50 [5,] 2299.3077 2284.0 2298.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 563.6416 515.7817 561.8651 [2,] 1439.0507 1493.2183 1424.1349 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(216.538461538462, 739.692307692308, 1001.34615384615, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tcc41447959481.ps tmp/1tcc41447959481.png",intern=TRUE)) character(0) > try(system("convert tmp/21i031447959481.ps tmp/21i031447959481.png",intern=TRUE)) character(0) > try(system("convert tmp/37xxi1447959481.ps tmp/37xxi1447959481.png",intern=TRUE)) character(0) > try(system("convert tmp/4rssw1447959481.ps tmp/4rssw1447959481.png",intern=TRUE)) character(0) > try(system("convert tmp/5ddhf1447959481.ps tmp/5ddhf1447959481.png",intern=TRUE)) character(0) > try(system("convert tmp/6w4w91447959481.ps tmp/6w4w91447959481.png",intern=TRUE)) character(0) > try(system("convert tmp/71o391447959481.ps tmp/71o391447959481.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.322 0.552 3.903