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,1790,1996,2097,1795,1963,2041,1746,2210,2949,3110,3716,3014,1515,1498,1366,1607,1757,1623,1451,1765) > 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,] 1795 2044 1790 2500 2149 2949 NA [2,] 1756 2136 1733 2210 1823 3110 NA [3,] 2237 2931 2086 2526 2094 3716 NA [4,] 1960 3263 1814 2249 2145 3014 NA [5,] 1829 3328 2241 2024 1790 1515 NA [6,] 2524 3570 1943 2091 1996 1498 NA [7,] 2077 2313 1773 2045 2097 1366 NA [8,] 2366 1623 2143 1882 1795 1607 NA [9,] 2185 1316 2087 1831 1963 1757 NA [10,] 2098 1507 1805 1964 2041 1623 NA [11,] 1836 1419 1913 1763 1746 1451 NA [12,] 1863 1660 2296 1688 2210 1765 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -39 92 -57 -290 -326 161 NA [2,] 481 795 353 316 271 606 NA [3,] -277 332 -272 -277 51 -702 NA [4,] -131 65 427 -225 -355 -1499 NA [5,] 695 242 -298 67 206 -17 NA [6,] -447 -1257 -170 -46 101 -132 NA [7,] 289 -690 370 -163 -302 241 NA [8,] -181 -307 -56 -51 168 150 NA [9,] -87 191 -282 133 78 -134 NA [10,] -262 -88 108 -201 -295 -172 NA [11,] 27 241 383 -75 464 314 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/1qneu1444984563.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/2fdrq1444984563.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/3jj8i1444984563.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/42wzf1444984563.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 1515.0 1498.0 1366 1607.0 1316 1507.0 1419.0 [2,] 1795.0 1756.0 2094.0 1960 1790.0 1943.0 1773 1623.0 1757 1623.0 1451.0 [3,] 2096.5 1979.5 2381.5 2197 1926.5 2043.5 2061 1838.5 1897 1884.5 1754.5 [4,] 2500.0 2210.0 2931.0 3014 2241.0 2524.0 2097 2143.0 2087 2041.0 1836.0 [5,] 2949.0 2210.0 3716.0 3263 2241.0 2524.0 2313 2366.0 2185 2098.0 1913.0 [,12] [1,] 1660 [2,] 1688 [3,] 1814 [4,] 2210 [5,] 2296 $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 1517.136 1635.59 1668.736 1852.01 1503.083 [2,] 2551.248 2272.345 2921.392 2876.864 2217.41 2418.264 2269.99 2173.917 [,9] [,10] [,11] [,12] [1,] 1684.139 1614.876 1506.163 1477.293 [2,] 2109.861 2154.124 2002.837 2150.707 $out [1] 3110 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/576ij1444984563.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 -702.0 -355 -298.0 -447 -690 -307.0 -282.0 -295.0 -75.0 130 [2,] -290 316 -277.0 -355 -17.0 -447 -302 -181.0 -134.0 -262.0 27.0 181 [3,] -48 417 -274.5 -178 136.5 -151 39 -53.5 -4.5 -186.5 277.5 204 [4,] 92 606 51.0 65 242.0 -46 289 150.0 133.0 -88.0 383.0 461 [5,] 161 795 332.0 427 242.0 101 370 168.0 191.0 108.0 464.0 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 229.9406 -486.07059 -448.91357 -30.56337 -409.658 -342.2141 [2,] 198.4023 604.0594 -62.92941 92.91357 303.56337 107.658 420.2141 [,8] [,9] [,10] [,11] [,12] [1,] -267.0057 -176.7236 -298.73562 47.8685 6.152705 [2,] 160.0057 167.7236 -74.26438 507.1315 401.847295 $out [1] -1499 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, 161, 271, 316, 417, 606, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hj7t1444984563.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 1366.0 NA [2,] 1832.5 1565 1797.5 1856.5 1809.0 1506.5 NA [3,] 2018.5 2090 1928.0 2034.5 2018.5 1690.0 NA [4,] 2211.0 3097 2115.0 2229.5 2121.0 2981.5 NA [5,] 2524.0 3570 2296.0 2526.0 2210.0 3716.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.195 1017.243 NA [2,] 2191.136 2788.755 2072.814 2204.628 2160.805 2362.757 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/7ctpa1444984563.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,] 1688.000 1754.50 1671.250 [2,] 1879.583 1861.50 1893.562 [3,] 2033.167 1953.00 1974.312 [4,] 2237.417 2078.75 2160.375 [5,] 2598.333 2381.50 2479.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1869.956 1853.911 1852.618 [2,] 2196.377 2052.089 2096.007 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1688, 1879.58333333333, 2033.16666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qneu1444984563.ps tmp/1qneu1444984563.png",intern=TRUE)) character(0) > try(system("convert tmp/2fdrq1444984563.ps tmp/2fdrq1444984563.png",intern=TRUE)) character(0) > try(system("convert tmp/3jj8i1444984563.ps tmp/3jj8i1444984563.png",intern=TRUE)) character(0) > try(system("convert tmp/42wzf1444984563.ps tmp/42wzf1444984563.png",intern=TRUE)) character(0) > try(system("convert tmp/576ij1444984563.ps tmp/576ij1444984563.png",intern=TRUE)) character(0) > try(system("convert tmp/6hj7t1444984563.ps tmp/6hj7t1444984563.png",intern=TRUE)) character(0) > try(system("convert tmp/7ctpa1444984563.ps tmp/7ctpa1444984563.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.485 0.412 2.922