R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(2322,2347,2963,1900,2723,2555,2176,2444,1944,2089,1978,2081,2435,2246,2641,1966,2398,2334,2333,2421,1531,2215,1927,1698,2482,1974,2369,2097,2264,1938,2360,2176,1478,2158,1690,1886,2450,1811,2196,1997,2199,1970,2239,1937,1311,2149,1673,2378,2770,1764,2310,1971,1899,2554,1948,2138,1469,2059,1771,1761) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2322 2435 2482 2450 2770 NA [2,] 2347 2246 1974 1811 1764 NA [3,] 2963 2641 2369 2196 2310 NA [4,] 1900 1966 2097 1997 1971 NA [5,] 2723 2398 2264 2199 1899 NA [6,] 2555 2334 1938 1970 2554 NA [7,] 2176 2333 2360 2239 1948 NA [8,] 2444 2421 2176 1937 2138 NA [9,] 1944 1531 1478 1311 1469 NA [10,] 2089 2215 2158 2149 2059 NA [11,] 1978 1927 1690 1673 1771 NA [12,] 2081 1698 1886 2378 1761 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 25 -189 -508 -639 -1006 NA [2,] 616 395 395 385 546 NA [3,] -1063 -675 -272 -199 -339 NA [4,] 823 432 167 202 -72 NA [5,] -168 -64 -326 -229 655 NA [6,] -379 -1 422 269 -606 NA [7,] 268 88 -184 -302 190 NA [8,] -500 -890 -698 -626 -669 NA [9,] 145 684 680 838 590 NA [10,] -111 -288 -468 -476 -288 NA [11,] 103 -229 196 705 -10 NA [12,] 354 784 564 392 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/1zfvs1476823253.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/2nfip1476823253.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/3hj8g1476823253.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/4f75r1476823253.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] [,12] [1,] 2435 1764 2196 1966 2199 1938 1948 1937 1469 2059 1673 1698 [2,] 2435 1811 2310 1966 2199 1970 2176 2138 1469 2089 1690 1761 [3,] 2450 1974 2369 1971 2264 2334 2239 2176 1478 2149 1771 1886 [4,] 2482 2246 2641 1997 2398 2554 2333 2421 1531 2158 1927 2081 [5,] 2482 2347 2963 1997 2398 2555 2360 2444 1531 2215 1978 2378 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2416.79 1666.63 2135.116 1949.095 2123.387 1921.347 2128.064 1976.033 [2,] 2483.21 2281.37 2602.884 1992.905 2404.613 2746.653 2349.936 2375.967 [,9] [,10] [,11] [,12] [1,] 1434.191 2100.245 1603.536 1659.889 [2,] 1521.809 2197.755 1938.464 2112.111 $out [1] 2322 2770 1900 2097 2723 1899 1944 1311 $group [1] 1 1 4 4 5 5 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2435, 2435, 2450, 2482, 2482, 1764, 1811, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wlll1476823253.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,] -1006 385 -1063 -72 -326 -606 -302 -698 590 -476 -229 354 [2,] -639 395 -675 167 -229 -379 -184 -698 590 -468 -10 373 [3,] -508 395 -339 202 -168 -1 88 -669 680 -288 103 478 [4,] -189 546 -272 432 -64 269 190 -626 684 -288 196 674 [5,] 25 616 -199 823 -64 422 268 -626 684 -111 196 784 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -825.9689 288.3038 -623.75878 14.75167 -284.58858 -458.8752 -176.2675 [2,] -190.0311 501.6962 -54.24122 389.24833 -51.41142 456.8752 352.2675 [,8] [,9] [,10] [,11] [,12] [1,] -719.875 613.5798 -415.1875 -42.55908 240.21 [2,] -618.125 746.4202 -160.8125 248.55908 715.79 $out [1] 655 -500 -890 145 838 705 $group [1] 5 8 8 9 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1006, -639, -508, -189, 25, 385, 395, 395, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6av8l1476823253.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] [1,] 1900.0 1531.0 1478.0 1673 1469.0 NA [2,] 2029.5 1946.5 1912.0 1874 1767.5 NA [3,] 2249.0 2289.5 2127.5 2073 1959.5 NA [4,] 2499.5 2409.5 2312.0 2219 2224.0 NA [5,] 2963.0 2641.0 2482.0 2450 2770.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2034.63 2078.323 1945.057 1915.643 1751.287 NA [2,] 2463.37 2500.677 2309.943 2230.357 2167.713 NA $out [1] 1311 $group [1] 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(1900, 2029.5, 2249, 2499.5, 2963, 1531, 1946.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7gk2c1476823253.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,] 1546.6 1478.0 1500.00 [2,] 1973.5 1928.5 1951.25 [3,] 2172.6 2162.5 2189.00 [4,] 2283.4 2299.0 2289.00 [5,] 2495.8 2450.0 2475.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2031.253 1993.512 2034.95 [2,] 2313.947 2331.488 2343.05 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1546.6, 1973.5, 2172.6, 2283.4, 2495.8, 1478, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zfvs1476823253.ps tmp/1zfvs1476823253.png",intern=TRUE)) character(0) > try(system("convert tmp/2nfip1476823253.ps tmp/2nfip1476823253.png",intern=TRUE)) character(0) > try(system("convert tmp/3hj8g1476823253.ps tmp/3hj8g1476823253.png",intern=TRUE)) character(0) > try(system("convert tmp/4f75r1476823253.ps tmp/4f75r1476823253.png",intern=TRUE)) character(0) > try(system("convert tmp/5wlll1476823253.ps tmp/5wlll1476823253.png",intern=TRUE)) character(0) > try(system("convert tmp/6av8l1476823253.ps tmp/6av8l1476823253.png",intern=TRUE)) character(0) > try(system("convert tmp/7gk2c1476823253.ps tmp/7gk2c1476823253.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.489 0.132 2.663