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(1329,1385,1681,1591,1598,1557,1190,932,1664,1717,1567,1355,1430,1863,1868,1711,1873,2095,1379,1021,1999,2094,2026,1390,1744,2117,1823,1963,1816,1966,1309,1250,2184,2295,1870,1222,1640,2194,2179,1976,1850,2077,1658,1156,2400,2218,1802,1444,1804,1541,2206,1972,1815,1749,1492,1307,1916,2035,1855,1086,1951,1733,1868,1532,1894,1586,1247,1212,2119,1931,1649,1296,1625,1454,1562,1612,1648,1412,1219,1207,1614,1537,1497,1141,1135,1368,1203,1201,1190,1347,607,914,1606,1518,1120,910) > 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] 96 > (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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1329 1430 1744 1640 1804 1951 1625 1135 NA [2,] 1385 1863 2117 2194 1541 1733 1454 1368 NA [3,] 1681 1868 1823 2179 2206 1868 1562 1203 NA [4,] 1591 1711 1963 1976 1972 1532 1612 1201 NA [5,] 1598 1873 1816 1850 1815 1894 1648 1190 NA [6,] 1557 2095 1966 2077 1749 1586 1412 1347 NA [7,] 1190 1379 1309 1658 1492 1247 1219 607 NA [8,] 932 1021 1250 1156 1307 1212 1207 914 NA [9,] 1664 1999 2184 2400 1916 2119 1614 1606 NA [10,] 1717 2094 2295 2218 2035 1931 1537 1518 NA [11,] 1567 2026 1870 1802 1855 1649 1497 1120 NA [12,] 1355 1390 1222 1444 1086 1296 1141 910 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 56 433 373 554 -263 -218 -171 233 NA [2,] 296 5 -294 -15 665 135 108 -165 NA [3,] -90 -157 140 -203 -234 -336 50 -2 NA [4,] 7 162 -147 -126 -157 362 36 -11 NA [5,] -41 222 150 227 -66 -308 -236 157 NA [6,] -367 -716 -657 -419 -257 -339 -193 -740 NA [7,] -258 -358 -59 -502 -185 -35 -12 307 NA [8,] 732 978 934 1244 609 907 407 692 NA [9,] 53 95 111 -182 119 -188 -77 -88 NA [10,] -150 -68 -425 -416 -180 -282 -40 -398 NA [11,] -212 -636 -648 -358 -769 -353 -356 -210 NA [12,] 75 354 418 360 865 329 -6 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/1y3s51424970137.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/22f721424970137.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/3opnd1424970137.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/4c5lh1424970137.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] [1,] 1135.0 1368.0 1203.0 1201.0 1598.0 1347.0 1190.0 914.0 1606.0 1518 [2,] 1379.5 1419.5 1621.5 1561.5 1623.0 1484.5 1204.5 976.5 1639.0 1627 [3,] 1632.5 1637.0 1845.5 1661.5 1815.5 1667.5 1278.0 1181.5 1957.5 1983 [4,] 1774.0 1990.0 2023.5 1967.5 1861.5 2021.5 1435.5 1231.0 2151.5 2156 [5,] 1951.0 2194.0 2206.0 1976.0 1894.0 2095.0 1658.0 1307.0 2400.0 2295 [,11] [,12] [1,] 1120.0 910.0 [2,] 1532.0 1113.5 [3,] 1725.5 1259.0 [4,] 1862.5 1372.5 [5,] 2026.0 1444.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1412.127 1318.311 1620.937 1434.703 1682.27 1367.524 1148.96 1039.333 [2,] 1852.873 1955.689 2070.063 1888.297 1948.73 1967.476 1407.04 1323.667 [,9] [,10] [,11] [,12] [1,] 1671.21 1687.493 1540.878 1114.319 [2,] 2243.79 2278.507 1910.122 1403.681 $out [1] 1190 607 $group [1] 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1135, 1379.5, 1632.5, 1774, 1951, 1368, 1419.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yrcn1424970137.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,] -263.0 -294.0 -336.0 -157.0 -308.0 -740.0 -502.0 407.0 -188 -425 -769.0 [2,] -194.5 -90.0 -218.5 -136.5 -151.0 -686.5 -308.0 650.5 -135 -407 -642.0 [3,] 144.5 56.5 -123.5 -2.0 54.5 -393.0 -122.0 819.5 -12 -231 -357.0 [4,] 403.0 215.5 24.0 99.0 189.5 -298.0 -23.5 956.0 103 -109 -282.5 [5,] 554.0 665.0 140.0 362.0 227.0 -193.0 307.0 1244.0 119 -40 -210.0 [,12] [1,] -6 [2,] 202 [3,] 354 [4,] 389 [5,] 418 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -189.2721 -114.1567 -258.96398 -133.5537 -135.7082 -610.0217 -280.92578 [2,] 478.2721 227.1567 11.96398 129.5537 244.7082 -175.9783 36.92578 [,8] [,9] [,10] [,11] [,12] [1,] 648.8433 -144.9502 -397.46708 -557.8219 242.3266 [2,] 990.1567 120.9502 -64.53292 -156.1781 465.6734 $out [1] 865 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-263, -194.5, 144.5, 403, 554, -294, -90, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68beq1424970137.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,] 932 1021.0 1222.0 1156.0 1086.0 1212.0 1141.0 607.0 NA [2,] 1342 1410.0 1526.5 1649.0 1516.5 1414.0 1315.5 1017.0 NA [3,] 1562 1865.5 1846.5 1913.0 1809.5 1691.0 1517.0 1195.5 NA [4,] 1631 2012.5 2041.5 2186.5 1944.0 1912.5 1613.0 1357.5 NA [5,] 1717 2095.0 2295.0 2400.0 2206.0 2119.0 1648.0 1606.0 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1430.185 1590.696 1611.605 1667.843 1614.514 1463.631 1381.308 1040.196 [2,] 1693.815 2140.304 2081.395 2158.157 2004.486 1918.369 1652.692 1350.804 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(932, 1342, 1562, 1631, 1717, 1021, 1410, 1865.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79bmo1424970137.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,] 1124.875 1181.50 1110.125 [2,] 1422.438 1455.25 1445.688 [3,] 1700.812 1664.50 1724.875 [4,] 1761.188 1830.50 1784.625 [5,] 1937.750 1983.00 1898.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1546.306 1493.346 1570.283 [2,] 1855.319 1835.654 1879.467 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1124.875, 1422.4375, 1700.8125, 1761.1875, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1y3s51424970137.ps tmp/1y3s51424970137.png",intern=TRUE)) character(0) > try(system("convert tmp/22f721424970137.ps tmp/22f721424970137.png",intern=TRUE)) character(0) > try(system("convert tmp/3opnd1424970137.ps tmp/3opnd1424970137.png",intern=TRUE)) character(0) > try(system("convert tmp/4c5lh1424970137.ps tmp/4c5lh1424970137.png",intern=TRUE)) character(0) > try(system("convert tmp/5yrcn1424970137.ps tmp/5yrcn1424970137.png",intern=TRUE)) character(0) > try(system("convert tmp/68beq1424970137.ps tmp/68beq1424970137.png",intern=TRUE)) character(0) > try(system("convert tmp/79bmo1424970137.ps tmp/79bmo1424970137.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.542 0.442 3.010