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(1516,1289,1428,1335,1402,1475,1582,1317,1450,1497,1556,981,1807,1573,1756,1708,1737,1679,1872,1598,1747,1882,1369,865,1432,1172,1268,1120,1235,1272,1360,1069,1434,1552,1584,1070,1676,1690,1643,1446,1566,1352,1805,1613,1824,1866,1774,1505,1972,1856,2037,1888,2167,2191,2036,2103,2131,2039,1983,1629,2032,2216,2141,2073,2145,2429,2157,1994,2116,2287,2162,1699) > 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,] 1516 1807 1432 1676 1972 2032 NA [2,] 1289 1573 1172 1690 1856 2216 NA [3,] 1428 1756 1268 1643 2037 2141 NA [4,] 1335 1708 1120 1446 1888 2073 NA [5,] 1402 1737 1235 1566 2167 2145 NA [6,] 1475 1679 1272 1352 2191 2429 NA [7,] 1582 1872 1360 1805 2036 2157 NA [8,] 1317 1598 1069 1613 2103 1994 NA [9,] 1450 1747 1434 1824 2131 2116 NA [10,] 1497 1882 1552 1866 2039 2287 NA [11,] 1556 1369 1584 1774 1983 2162 NA [12,] 981 865 1070 1505 1629 1699 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -227 -234 -260 14 -116 184 NA [2,] 139 183 96 -47 181 -75 NA [3,] -93 -48 -148 -197 -149 -68 NA [4,] 67 29 115 120 279 72 NA [5,] 73 -58 37 -214 24 284 NA [6,] 107 193 88 453 -155 -272 NA [7,] -265 -274 -291 -192 67 -163 NA [8,] 133 149 365 211 28 122 NA [9,] 47 135 118 42 -92 171 NA [10,] 59 -513 32 -92 -56 -125 NA [11,] -575 -504 -514 -269 -354 -463 NA [12,] 826 567 606 467 403 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/1bu2y1393881443.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/21nan1393881443.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/3ht9a1393881443.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/4d3x51393881443.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,] 1432.0 1172.0 1268.0 1120 1235.0 1272 1360.0 1069.0 1434.0 1497 1369 [2,] 1516.0 1289.0 1428.0 1335 1402.0 1352 1582.0 1317.0 1450.0 1552 1556 [3,] 1741.5 1631.5 1699.5 1577 1651.5 1577 1838.5 1605.5 1785.5 1874 1679 [4,] 1972.0 1856.0 2037.0 1888 2145.0 2191 2036.0 1994.0 2116.0 2039 1983 [5,] 2032.0 2216.0 2141.0 2073 2167.0 2429 2157.0 2103.0 2131.0 2287 2162 [,12] [1,] 865.0 [2,] 981.0 [3,] 1287.5 [4,] 1629.0 [5,] 1699.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1447.365 1265.767 1306.675 1220.297 1172.241 1035.818 1545.655 1168.813 [2,] 2035.635 1997.233 2092.325 1933.703 2130.759 2118.182 2131.345 2042.187 [,9] [,10] [,11] [,12] [1,] 1355.908 1559.869 1403.571 869.5191 [2,] 2215.092 2188.131 1954.429 1705.4809 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1432, 1516, 1741.5, 1972, 2032, 1172, 1289, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58ypd1393881443.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,] -260.0 -75.0 -197.0 29.0 -214.0 -272.0 -291.0 28 -92.0 -125 -575.0 [2,] -234.0 -47.0 -149.0 67.0 -58.0 -155.0 -274.0 122 42.0 -125 -514.0 [3,] -171.5 117.5 -120.5 93.5 30.5 97.5 -228.5 141 82.5 -74 -483.5 [4,] 14.0 181.0 -68.0 120.0 73.0 193.0 -163.0 211 135.0 32 -354.0 [5,] 184.0 183.0 -48.0 120.0 73.0 453.0 -163.0 211 171.0 59 -269.0 [,12] [1,] 403 [2,] 467 [3,] 567 [4,] 606 [5,] 606 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -331.46801 -29.56736 -172.74762 59.31329 -53.99923 -126.9712 -300.0986 [2,] -11.53199 264.56736 -68.25238 127.68671 114.99923 321.9712 -156.9014 [,8] [,9] [,10] [,11] [,12] [1,] 83.59213 22.512 -175.27007 -586.7052 468.783 [2,] 198.40787 142.488 27.27007 -380.2948 665.217 $out [1] 279 284 67 365 -513 826 $group [1] 4 5 7 8 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-260, -234, -171.5, 14, 184, -75, -47, 117.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64u7r1393881443.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,] 1289.0 1369.0 1069 1352.0 1856.0 1994.0 NA [2,] 1326.0 1585.5 1146 1535.5 1930.0 2052.5 NA [3,] 1439.0 1722.5 1270 1659.5 2036.5 2143.0 NA [4,] 1506.5 1781.5 1433 1789.5 2117.0 2189.0 NA [5,] 1582.0 1882.0 1584 1866.0 2191.0 2287.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1356.673 1633.103 1139.097 1543.649 1951.208 2080.741 NA [2,] 1521.327 1811.897 1400.903 1775.351 2121.792 2205.259 NA $out [1] 981 865 1629 2429 1699 $group [1] 1 2 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1289, 1326, 1439, 1506.5, 1582, 1369, 1585.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74hda1393881443.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,] 1595.000 1577.00 1587.250 [2,] 1624.167 1591.25 1622.938 [3,] 1722.583 1665.25 1733.625 [4,] 1761.417 1763.50 1765.250 [5,] 1853.833 1874.00 1816.375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1659.983 1586.686 1668.715 [2,] 1785.184 1743.814 1798.535 $out [1] 1291.500 1287.500 1300.625 $group [1] 1 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1595, 1624.16666666667, 1722.58333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bu2y1393881443.ps tmp/1bu2y1393881443.png",intern=TRUE)) character(0) > try(system("convert tmp/21nan1393881443.ps tmp/21nan1393881443.png",intern=TRUE)) character(0) > try(system("convert tmp/3ht9a1393881443.ps tmp/3ht9a1393881443.png",intern=TRUE)) character(0) > try(system("convert tmp/4d3x51393881443.ps tmp/4d3x51393881443.png",intern=TRUE)) character(0) > try(system("convert tmp/58ypd1393881443.ps tmp/58ypd1393881443.png",intern=TRUE)) character(0) > try(system("convert tmp/64u7r1393881443.ps tmp/64u7r1393881443.png",intern=TRUE)) character(0) > try(system("convert tmp/74hda1393881443.ps tmp/74hda1393881443.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.089 1.002 6.115