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(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,4060,1538,1388,1547,4473,1570,1535,1352) > 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] 98 > (np <- floor(n / par1)) [1] 8 > 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] 9 9 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2135 1990 2090 1990 1898 2565 2570 2956 1535 [2,] 1157 966 1435 1154 712 910 1125 1055 1352 [3,] 1290 1326 1124 954 1175 1304 1600 2004 NA [4,] 1071 908 1319 887 1240 1331 1492 1462 NA [5,] 1169 1206 1436 825 1329 1681 2492 1144 NA [6,] 1431 1861 1774 966 1550 1983 3523 1454 NA [7,] 945 929 1566 954 1201 1021 990 4060 NA [8,] 1034 1296 1385 770 938 1061 869 1538 NA [9,] 1100 1332 1147 1838 1030 1292 1310 1388 NA [10,] 1297 1352 1274 1371 1060 1274 979 1547 NA [11,] 921 1040 625 589 1035 1024 1244 4473 NA [12,] 236 148 52 116 635 568 442 1570 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -978 -1024 -655 -836 -1186 -1655 -1445 -1901 -183 [2,] 133 360 -311 -200 463 394 475 949 NA [3,] -219 -418 195 -67 65 27 -108 -542 NA [4,] 98 298 117 -62 89 350 1000 -318 NA [5,] 262 655 338 141 221 302 1031 310 NA [6,] -486 -932 -208 -12 -349 -962 -2533 2606 NA [7,] 89 367 -181 -184 -263 40 -121 -2522 NA [8,] 66 36 -238 1068 92 231 441 -150 NA [9,] 197 20 127 -467 30 -18 -331 159 NA [10,] -376 -312 -649 -782 -25 -250 265 2926 NA [11,] -685 -892 -573 -473 -400 -456 -802 -2903 NA [12,] 1754 1942 1938 1782 1930 2002 2514 -35 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/17qyf1420396236.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/21fdn1420396236.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/32dj91420396236.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/4ojfs1420396236.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] [1,] 1535 712 954.0 887.0 825.0 966.0 929.0 770.0 1030.0 979.0 589.0 [2,] 1990 966 1149.5 989.5 1156.5 1442.5 949.5 903.5 1123.5 1167.0 773.0 [3,] 2090 1125 1297.0 1279.5 1267.5 1662.0 1005.5 1047.5 1301.0 1285.5 1029.5 [4,] 2565 1157 1463.0 1396.5 1558.5 1922.0 1383.5 1340.5 1360.0 1361.5 1142.0 [5,] 2956 1435 1600.0 1492.0 1681.0 1983.0 1566.0 1538.0 1388.0 1547.0 1244.0 [,12] [1,] 52.0 [2,] 132.0 [3,] 339.0 [4,] 601.5 [5,] 635.0 $n [1] 9 9 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1787.167 1024.407 1121.874 1052.144 1042.937 1394.144 763.0614 803.3855 [2,] 2392.833 1225.593 1472.126 1506.856 1492.063 1929.856 1247.9386 1291.6145 [,9] [,10] [,11] [,12] [1,] 1168.888 1176.85 823.3713 76.73056 [2,] 1433.112 1394.15 1235.6287 601.26944 $out [1] 2004 2492 3523 4060 1838 4473 1570 $group [1] 3 5 6 7 9 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1535, 1990, 2090, 2565, 2956, 712, 966, 1125, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55nzz1420396236.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,] -1901 -311.0 -542.0 -318.0 141.0 -962.0 -263.0 -238 -467.0 -782.0 -892.0 [2,] -1445 -33.5 -318.5 13.5 241.5 -947.0 -223.5 -57 -174.5 -512.5 -847.0 [3,] -1024 377.0 -87.5 107.5 306.0 -417.5 -151.0 79 25.0 -281.0 -629.0 [4,] -836 469.0 46.0 324.0 496.5 -110.0 64.5 336 143.0 120.0 -464.5 [5,] -183 949.0 195.0 350.0 655.0 -12.0 367.0 441 197.0 265.0 -400.0 [,12] [1,] 1754 [2,] 1768 [3,] 1934 [4,] 1972 [5,] 2002 $n [1] 9 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1344.74 96.29629 -291.1149 -65.94976 163.5533 -885.06022 -311.880935 [2,] -703.26 657.70371 116.1149 280.94976 448.4467 50.06022 9.880935 [,8] [,9] [,10] [,11] [,12] [1,] -140.5354 -152.3601 -634.32358 -842.67 1820.043 [2,] 298.5354 202.3601 72.32358 -415.33 2047.957 $out [1] 1000 1031 -2533 2606 -2522 1068 2926 -2903 2514 -35 $group [1] 4 5 6 6 7 8 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1901, -1445, -1024, -836, -183, -311, -33.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6pmql1420396236.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] [1,] 921.0 908.0 625.0 116.0 635.0 568.0 442.0 1055.0 1352.0 [2,] 989.5 947.5 1135.5 797.5 984.0 1022.5 984.5 1421.0 1352.0 [3,] 1128.5 1251.0 1352.0 954.0 1117.5 1283.0 1277.0 1542.5 1443.5 [4,] 1293.5 1342.0 1501.0 1262.5 1284.5 1506.0 2046.0 2480.0 1535.0 [5,] 1431.0 1861.0 1774.0 1838.0 1550.0 1983.0 3523.0 4060.0 1535.0 $n [1] 12 12 12 12 12 12 12 12 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 989.8436 1071.066 1185.293 741.9104 980.4399 1062.472 792.8427 [2,] 1267.1564 1430.934 1518.707 1166.0896 1254.5601 1503.528 1761.1573 [,8] [,9] [1,] 1059.483 1239.047 [2,] 2025.517 1647.953 $out [1] 2135 236 1990 148 2090 52 1990 1898 2565 4473 $group [1] 1 1 2 2 3 3 4 5 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(921, 989.5, 1128.5, 1293.5, 1431, 908, 947.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7xt121420396236.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,] 1096.222 1005.5 969.000 [2,] 1162.562 1038.5 1090.500 [3,] 1325.875 1273.5 1218.812 [4,] 1434.250 1299.0 1309.312 [5,] 1817.750 1662.0 1330.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1201.957 1154.684 1119.011 [2,] 1449.793 1392.316 1318.614 $out [1] 2192.111 470.875 2090.000 339.000 2277.500 1669.875 362.375 $group [1] 1 1 2 2 3 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1096.22222222222, 1162.5625, 1325.875, 1434.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17qyf1420396236.ps tmp/17qyf1420396236.png",intern=TRUE)) character(0) > try(system("convert tmp/21fdn1420396236.ps tmp/21fdn1420396236.png",intern=TRUE)) character(0) > try(system("convert tmp/32dj91420396236.ps tmp/32dj91420396236.png",intern=TRUE)) character(0) > try(system("convert tmp/4ojfs1420396236.ps tmp/4ojfs1420396236.png",intern=TRUE)) character(0) > try(system("convert tmp/55nzz1420396236.ps tmp/55nzz1420396236.png",intern=TRUE)) character(0) > try(system("convert tmp/6pmql1420396236.ps tmp/6pmql1420396236.png",intern=TRUE)) character(0) > try(system("convert tmp/7xt121420396236.ps tmp/7xt121420396236.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.502 0.512 3.040