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(1747,1245,1182,958,1000,1044,875,939,736,905,796,372,1326,668,962,912,1119,891,931,1047,982,1098,714,128,1784,828,1199,1095,977,1338,975,840,1324,1236,883,177,2186,809,1434,1365,1247,1476,1211,990,1205,1238,952,204,2135,1157,1290,1071,1169,1431,945,1034,1100,1297,921,236,1990,966,1326,908,1206,1861,929,1296,1332,1352,1040,148,2090,1435,1124,1319,1436,1774,1566,1385,1147,1274,625,52,1990,1154,954,887,825,966,954,770,1838,1371,589,116,1898,712,1175,1240,1329,1550,1201,938,1030,1060,1035,635,2565,910,1304,1331,1681,1983,1021,1061,1292,1274,1024,568,2570,1125,1600,1492,2492,3523,990,869,1310,979,1244,442,2956,1055,2004,1462,1144,1454,1538,1388,1547,1570,1535,1352,1888,999,1158,1342,1443,1519,1267,1454,987,1430,1254,734) > 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,] 1747 1326 1784 2186 2135 1990 2090 1990 1898 2565 2570 2956 1888 [2,] 1245 668 828 809 1157 966 1435 1154 712 910 1125 1055 999 [3,] 1182 962 1199 1434 1290 1326 1124 954 1175 1304 1600 2004 1158 [4,] 958 912 1095 1365 1071 908 1319 887 1240 1331 1492 1462 1342 [5,] 1000 1119 977 1247 1169 1206 1436 825 1329 1681 2492 1144 1443 [6,] 1044 891 1338 1476 1431 1861 1774 966 1550 1983 3523 1454 1519 [7,] 875 931 975 1211 945 929 1566 954 1201 1021 990 1538 1267 [8,] 939 1047 840 990 1034 1296 1385 770 938 1061 869 1388 1454 [9,] 736 982 1324 1205 1100 1332 1147 1838 1030 1292 1310 1547 987 [10,] 905 1098 1236 1238 1297 1352 1274 1371 1060 1274 979 1570 1430 [11,] 796 714 883 952 921 1040 625 589 1035 1024 1244 1535 1254 [12,] 372 128 177 204 236 148 52 116 635 568 442 1352 734 [,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,] -502 -658 -956 -1377 -978 -1024 -655 -836 -1186 -1655 -1445 -1901 -889 [2,] -63 294 371 625 133 360 -311 -200 463 394 475 949 159 [3,] -224 -50 -104 -69 -219 -418 195 -67 65 27 -108 -542 184 [4,] 42 207 -118 -118 98 298 117 -62 89 350 1000 -318 101 [5,] 44 -228 361 229 262 655 338 141 221 302 1031 310 76 [6,] -169 40 -363 -265 -486 -932 -208 -12 -349 -962 -2533 84 -252 [7,] 64 116 -135 -221 89 367 -181 -184 -263 40 -121 -150 187 [8,] -203 -65 484 215 66 36 -238 1068 92 231 441 159 -467 [9,] 169 116 -88 33 197 20 127 -467 30 -18 -331 23 443 [10,] -109 -384 -353 -286 -376 -312 -649 -782 -25 -250 265 -35 -176 [11,] -424 -586 -706 -748 -685 -892 -573 -473 -400 -456 -802 -183 -520 [12,] 954 1656 2009 1931 1754 1942 1938 1782 1930 2002 2514 536 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/1uim01445019507.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/24ah11445019507.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/3dvgc1445019507.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/4kply1445019507.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,] 1747 668 954 887 825 891 875 770 736 905 589 52 [2,] 1888 828 1158 958 1119 1338 945 938 1030 1098 796 148 [3,] 1990 999 1199 1240 1206 1476 990 1034 1205 1274 952 236 [4,] 2186 1154 1326 1342 1436 1774 1211 1296 1324 1352 1040 568 [5,] 2570 1435 1434 1492 1681 1983 1566 1454 1547 1570 1254 734 $n [1] 13 13 13 13 13 13 13 13 13 13 13 13 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1859.412 856.1425 1125.38 1071.726 1067.086 1284.939 873.4353 877.1197 [2,] 2120.588 1141.8575 1272.62 1408.274 1344.914 1667.061 1106.5647 1190.8803 [,9] [,10] [,11] [,12] [1,] 1076.165 1162.694 845.076 51.95047 [2,] 1333.835 1385.306 1058.924 420.04953 $out [1] 1326 2956 1600 2004 2492 3523 1838 1535 1352 $group [1] 1 1 3 3 5 6 9 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1747, 1888, 1990, 2186, 2570, 668, 828, 999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53obf1445019507.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] [,12] [1,] -1901 -311 -542 -318 44 -932 -263 -467 -88 -649 -892 1656.0 [2,] -1377 133 -219 -62 141 -486 -181 -65 -18 -376 -706 1705.0 [3,] -978 360 -69 98 262 -265 -121 92 30 -286 -573 1930.5 [4,] -836 463 27 207 338 -169 89 231 127 -109 -456 1972.0 [5,] -502 949 195 350 361 84 367 484 197 265 -183 2009.0 $n [1] 13 13 13 13 13 13 13 13 13 13 13 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1215.0733 215.3897 -176.80044 -19.87934 175.672 -403.9136 -239.317552 [2,] -740.9267 504.6103 38.80044 215.87934 348.328 -126.0864 -2.682448 [,8] [,9] [,10] [,11] [,12] [1,] -37.71109 -33.54091 -403.0029 -682.5533 1808.72 [2,] 221.71109 93.54091 -168.9971 -463.4467 2052.28 $out [1] 1000 -228 655 1031 -962 -2533 1068 -467 -331 443 -782 954 [13] 2514 536 $group [1] 4 5 5 5 6 6 8 9 9 9 10 12 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1901, -1377, -978, -836, -502, -311, 133, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6cd371445019507.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] [,9] [,10] [1,] 736.0 668.0 828.0 809.0 921.0 908.0 625.0 116.0 635.0 568.0 [2,] 835.5 802.5 861.5 971.0 989.5 947.5 1135.5 797.5 984.0 1022.5 [3,] 948.5 946.5 1036.0 1224.5 1128.5 1251.0 1352.0 954.0 1117.5 1283.0 [4,] 1113.0 1072.5 1280.0 1399.5 1293.5 1342.0 1501.0 1262.5 1284.5 1506.0 [5,] 1245.0 1326.0 1784.0 1476.0 1431.0 1861.0 1774.0 1838.0 1550.0 1983.0 [,11] [,12] [,13] [,14] [1,] 442.0 1144.0 734.0 NA [2,] 984.5 1370.0 1078.5 NA [3,] 1277.0 1498.5 1304.5 NA [4,] 2046.0 1558.5 1448.5 NA [5,] 3523.0 1570.0 1888.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,] 821.9304 823.3512 845.1193 1029.058 989.8436 1071.066 1185.293 [2,] 1075.0696 1069.6488 1226.8807 1419.942 1267.1564 1430.934 1518.707 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 741.9104 980.4399 1062.472 792.8427 1412.524 1135.741 NA [2,] 1166.0896 1254.5601 1503.528 1761.1573 1584.476 1473.259 NA $out [1] 1747 372 128 177 2186 204 2135 236 1990 148 2090 52 1990 1898 2565 [16] 2956 1055 2004 $group [1] 1 1 2 3 4 4 5 5 6 6 7 7 8 9 10 12 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" NA Warning message: In bxp(list(stats = c(736, 835.5, 948.5, 1113, 1245, 668, 802.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7y54t1445019507.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,] 970.1538 952.0 918.00 [2,] 1041.3077 994.5 1034.50 [3,] 1200.4615 1202.0 1163.50 [4,] 1299.2308 1257.0 1259.75 [5,] 1600.7692 1476.0 1556.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1082.821 1082.272 1060.762 [2,] 1318.102 1321.728 1266.238 $out [1] 2086.5385 397.2308 1990.0000 236.0000 2037.0000 358.0000 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(970.153846153846, 1041.30769230769, 1200.46153846154, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1uim01445019507.ps tmp/1uim01445019507.png",intern=TRUE)) character(0) > try(system("convert tmp/24ah11445019507.ps tmp/24ah11445019507.png",intern=TRUE)) character(0) > try(system("convert tmp/3dvgc1445019507.ps tmp/3dvgc1445019507.png",intern=TRUE)) character(0) > try(system("convert tmp/4kply1445019507.ps tmp/4kply1445019507.png",intern=TRUE)) character(0) > try(system("convert tmp/53obf1445019507.ps tmp/53obf1445019507.png",intern=TRUE)) character(0) > try(system("convert tmp/6cd371445019507.ps tmp/6cd371445019507.png",intern=TRUE)) character(0) > try(system("convert tmp/7y54t1445019507.ps tmp/7y54t1445019507.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.439 0.462 2.912