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(1795,1756,2237,1960,1829,2524,2077,2366,2185,2098,1836,1863,2044,2136,2931,3263,3328,3570,2313,1623,1316,1507,1419,1660,1790,1733,2086,1814,2241,1943,1773,2143,2087,1805,1913,2296,2500,2210,2526,2249,2024,2091,2045,1882,1831,1964,1763,1688,2149,1823,2094,2145,1791,1996,2097,1796,1963,2042,1746,2210,2949,3093,3718,3024,1522,1502,1373,1607,1768,1622,1447,1768) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (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,] 1795 2044 1790 2500 2149 2949 NA [2,] 1756 2136 1733 2210 1823 3093 NA [3,] 2237 2931 2086 2526 2094 3718 NA [4,] 1960 3263 1814 2249 2145 3024 NA [5,] 1829 3328 2241 2024 1791 1522 NA [6,] 2524 3570 1943 2091 1996 1502 NA [7,] 2077 2313 1773 2045 2097 1373 NA [8,] 2366 1623 2143 1882 1796 1607 NA [9,] 2185 1316 2087 1831 1963 1768 NA [10,] 2098 1507 1805 1964 2042 1622 NA [11,] 1836 1419 1913 1763 1746 1447 NA [12,] 1863 1660 2296 1688 2210 1768 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -39 92 -57 -290 -326 144 NA [2,] 481 795 353 316 271 625 NA [3,] -277 332 -272 -277 51 -694 NA [4,] -131 65 427 -225 -354 -1502 NA [5,] 695 242 -298 67 205 -20 NA [6,] -447 -1257 -170 -46 101 -129 NA [7,] 289 -690 370 -163 -301 234 NA [8,] -181 -307 -56 -51 167 161 NA [9,] -87 191 -282 133 79 -146 NA [10,] -262 -88 108 -201 -296 -175 NA [11,] 27 241 383 -75 464 321 NA [12,] 181 130 204 461 739 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/1i7u01448906282.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/2f97i1448906282.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/3pfq41448906282.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/4g46y1448906282.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,] 1790.0 1733.0 2086.0 1814 1522.0 1502.0 1373 1607 1316 1507.0 1419.0 [2,] 1795.0 1756.0 2094.0 1960 1791.0 1943.0 1773 1623 1768 1622.0 1447.0 [3,] 2096.5 1979.5 2381.5 2197 1926.5 2043.5 2061 1839 1897 1884.5 1754.5 [4,] 2500.0 2210.0 2931.0 3024 2241.0 2524.0 2097 2143 2087 2042.0 1836.0 [5,] 2949.0 2210.0 3718.0 3263 2241.0 2524.0 2313 2366 2185 2098.0 1913.0 [,12] [1,] 1660.0 [2,] 1688.0 [3,] 1815.5 [4,] 2210.0 [5,] 2296.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,] 1641.752 1686.655 1841.608 1510.686 1636.235 1668.736 1852.01 1503.583 [2,] 2551.248 2272.345 2921.392 2883.314 2216.765 2418.264 2269.99 2174.417 [,9] [,10] [,11] [,12] [1,] 1691.235 1613.586 1503.582 1478.793 [2,] 2102.765 2155.414 2005.418 2152.207 $out [1] 3093 3328 3570 $group [1] 2 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1790, 1795, 2096.5, 2500, 2949, 1733, 1756, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vebh1448906282.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,] -326 271 -694.0 -354 -298 -447.0 -690.0 -307.0 -282 -296 -75 130 [2,] -290 316 -277.0 -354 -20 -447.0 -301.0 -181.0 -146 -262 27 181 [3,] -48 417 -274.5 -178 136 -149.5 35.5 -53.5 -4 -188 281 204 [4,] 92 625 51.0 65 242 -46.0 289.0 161.0 133 -88 383 461 [5,] 144 795 332.0 427 242 101.0 370.0 167.0 191 108 464 739 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -294.4023 217.685 -486.07059 -448.26853 -32.99846 -408.158 -345.0691 [2,] 198.4023 616.315 -62.92941 92.26853 304.99846 109.158 416.0691 [,8] [,9] [,10] [,11] [,12] [1,] -274.101 -183.964 -300.23562 51.3685 6.152705 [2,] 167.101 175.964 -75.76438 510.6315 401.847295 $out [1] -1502 695 -1257 $group [1] 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-326, -290, -48, 92, 144, 271, 316, 417, 625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6i43x1448906282.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,] 1756.0 1316 1733.0 1688.0 1746.0 1373.0 NA [2,] 1832.5 1565 1797.5 1856.5 1809.5 1512.0 NA [3,] 2018.5 2090 1928.0 2034.5 2019.0 1695.0 NA [4,] 2211.0 3097 2115.0 2229.5 2121.0 2986.5 NA [5,] 2524.0 3570 2296.0 2526.0 2210.0 3718.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1845.864 1391.245 1783.186 1864.372 1876.923 1022.471 NA [2,] 2191.136 2788.755 2072.814 2204.628 2161.077 2367.529 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1756, 1832.5, 2018.5, 2211, 2524, 1316, 1565, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/782c51448906282.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,] 1687.333 1754.50 1669.750 [2,] 1880.583 1861.75 1893.812 [3,] 2034.417 1953.00 1974.312 [4,] 2237.750 2078.75 2160.375 [5,] 2598.667 2381.50 2479.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1871.511 1854.025 1852.732 [2,] 2197.323 2051.975 2095.893 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1687.33333333333, 1880.58333333333, 2034.41666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1i7u01448906282.ps tmp/1i7u01448906282.png",intern=TRUE)) character(0) > try(system("convert tmp/2f97i1448906282.ps tmp/2f97i1448906282.png",intern=TRUE)) character(0) > try(system("convert tmp/3pfq41448906282.ps tmp/3pfq41448906282.png",intern=TRUE)) character(0) > try(system("convert tmp/4g46y1448906282.ps tmp/4g46y1448906282.png",intern=TRUE)) character(0) > try(system("convert tmp/5vebh1448906282.ps tmp/5vebh1448906282.png",intern=TRUE)) character(0) > try(system("convert tmp/6i43x1448906282.ps tmp/6i43x1448906282.png",intern=TRUE)) character(0) > try(system("convert tmp/782c51448906282.ps tmp/782c51448906282.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.669 0.445 3.148