R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" 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(10670.5,11129,13474.5,12317.8,11990.1,13478.3,11762.4,11149.1,13597.2,13367.9,13304.2,12407.2,13008.3,13379.5,15696,13529.6,14857,14375.1,12958.4,12612.8,14405.2,13655.8,13783.1,12336.1,13366.7,14042.4,15412,13566.5,13981.5,14042,13131,12771.2,13600.1,14886.9,13813.1,11551,13750.5,13415.4,15040.9,14349.5,13900.2,13956.6,13951,11802.1,14219.1,14914.5,14098.2,12773.6,14225,13513,14754.4,14447.7,13777.8,14328.6,14106.1,12157,15425.1,15448.8,13604.5,12269.3) > 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,] 10670.5 13008.3 13366.7 13750.5 14225.0 NA [2,] 11129.0 13379.5 14042.4 13415.4 13513.0 NA [3,] 13474.5 15696.0 15412.0 15040.9 14754.4 NA [4,] 12317.8 13529.6 13566.5 14349.5 14447.7 NA [5,] 11990.1 14857.0 13981.5 13900.2 13777.8 NA [6,] 13478.3 14375.1 14042.0 13956.6 14328.6 NA [7,] 11762.4 12958.4 13131.0 13951.0 14106.1 NA [8,] 11149.1 12612.8 12771.2 11802.1 12157.0 NA [9,] 13597.2 14405.2 13600.1 14219.1 15425.1 NA [10,] 13367.9 13655.8 14886.9 14914.5 15448.8 NA [11,] 13304.2 13783.1 13813.1 14098.2 13604.5 NA [12,] 12407.2 12336.1 11551.0 12773.6 12269.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 458.5 371.2 675.7 -335.1 -712.0 NA [2,] 2345.5 2316.5 1369.6 1625.5 1241.4 NA [3,] -1156.7 -2166.4 -1845.5 -691.4 -306.7 NA [4,] -327.7 1327.4 415.0 -449.3 -669.9 NA [5,] 1488.2 -481.9 60.5 56.4 550.8 NA [6,] -1715.9 -1416.7 -911.0 -5.6 -222.5 NA [7,] -613.3 -345.6 -359.8 -2148.9 -1949.1 NA [8,] 2448.1 1792.4 828.9 2417.0 3268.1 NA [9,] -229.3 -749.4 1286.8 695.4 23.7 NA [10,] -63.7 127.3 -1073.8 -816.3 -1844.3 NA [11,] -897.0 -1447.0 -2262.1 -1324.6 -1335.2 NA [12,] 601.1 1030.6 2199.5 1451.4 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/1bsh81457461387.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/2g1b11457461387.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/3gdtv1457461387.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/4ybs91457461387.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] [1,] 13008.3 13379.5 14754.4 12317.8 13777.8 13478.3 11762.4 11149.1 13597.2 [2,] 13008.3 13379.5 14754.4 13529.6 13777.8 13956.6 12958.4 11802.1 13600.1 [3,] 13366.7 13415.4 15040.9 13566.5 13900.2 14042.0 13131.0 12157.0 14219.1 [4,] 13750.5 13513.0 15412.0 14349.5 13981.5 14328.6 13951.0 12612.8 14405.2 [5,] 14225.0 13513.0 15696.0 14447.7 13981.5 14375.1 14106.1 12771.2 15425.1 [,10] [,11] [,12] [1,] 13367.9 13304.2 12269.3 [2,] 13655.8 13604.5 12269.3 [3,] 14886.9 13783.1 12336.1 [4,] 14914.5 13813.1 12407.2 [5,] 15448.8 14098.2 12407.2 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 12842.26 13321.07 14576.24 12987.16 13756.27 13779.15 12429.63 11584.16 [2,] 13891.14 13509.73 15505.56 14145.84 14044.13 14304.85 13832.37 12729.84 [,9] [,10] [,11] [,12] [1,] 13650.22 13997.51 13635.7 12238.66 [2,] 14787.98 15776.29 13930.5 12433.54 $out [1] 10670.5 11129.0 14042.4 13474.5 11990.1 14857.0 11551.0 12773.6 $group [1] 1 2 2 3 5 5 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(13008.3, 13008.3, 13366.7, 13750.5, 14225, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mugc1457461387.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] [1,] -712.0 1241.4 -2166.4 -669.9 -481.9 -1715.9 -2148.9 828.9 -749.4 -1844.3 [2,] -335.1 1369.6 -1845.5 -449.3 56.4 -1416.7 -1949.1 1792.4 -229.3 -1073.8 [3,] 371.2 1625.5 -1156.7 -327.7 60.5 -911.0 -613.3 2417.0 23.7 -816.3 [4,] 458.5 2316.5 -691.4 415.0 550.8 -222.5 -359.8 2448.1 695.4 -63.7 [5,] 675.7 2345.5 -306.7 1327.4 550.8 -5.6 -345.6 3268.1 1286.8 127.3 [,11] [,12] [1,] -1447.0 601.10 [2,] -1447.0 815.85 [3,] -1335.2 1241.00 [4,] -1324.6 1825.45 [5,] -1324.6 2199.50 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -189.5558 956.4228 -1972.1842 -938.4122 -288.8418 -1754.81871 -1736.2954 [2,] 931.9558 2294.5772 -341.2158 283.0122 409.8418 -67.18129 509.6954 [,8] [,9] [,10] [,11] [,12] [1,] 1953.684 -629.6907 -1530.0341 -1421.688 443.416 [2,] 2880.316 677.0907 -102.5659 -1248.712 2038.584 $out [1] 1488.2 -897.0 -2262.1 $group [1] 5 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-712, -335.1, 371.200000000001, 458.5, 675.699999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qp6x1457461387.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,] 10670.50 12336.10 12771.20 12773.60 12157.00 NA [2,] 11455.75 12983.35 13248.85 13582.95 13558.75 NA [3,] 12362.50 13592.70 13706.60 13953.80 14165.55 NA [4,] 13421.20 14390.15 14042.20 14284.30 14601.05 NA [5,] 13597.20 15696.00 14886.90 15040.90 15448.80 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 11466.05 12951.05 13344.75 13633.91 13690.15 NA [2,] 13258.95 14234.35 14068.45 14273.69 14640.95 NA $out [1] 15412.0 11551.0 11802.1 $group [1] 3 3 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(10670.5, 11455.75, 12362.5, 13421.2, 13597.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7dojt1457461387.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,] 12098.44 12157.00 13379.40 [2,] 13050.03 13248.85 13412.83 [3,] 13671.77 13674.80 13794.22 [4,] 14142.73 14130.55 14072.62 [5,] 14875.56 15040.90 14285.15 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 13173.38 13272.65 13493.29 [2,] 14170.16 14076.95 14095.16 $out [1] 15083.20 12207.45 12338.25 $group [1] 3 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(12098.44, 13050.03, 13671.77, 14142.73, 14875.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bsh81457461387.ps tmp/1bsh81457461387.png",intern=TRUE)) character(0) > try(system("convert tmp/2g1b11457461387.ps tmp/2g1b11457461387.png",intern=TRUE)) character(0) > try(system("convert tmp/3gdtv1457461387.ps tmp/3gdtv1457461387.png",intern=TRUE)) character(0) > try(system("convert tmp/4ybs91457461387.ps tmp/4ybs91457461387.png",intern=TRUE)) character(0) > try(system("convert tmp/5mugc1457461387.ps tmp/5mugc1457461387.png",intern=TRUE)) character(0) > try(system("convert tmp/6qp6x1457461387.ps tmp/6qp6x1457461387.png",intern=TRUE)) character(0) > try(system("convert tmp/7dojt1457461387.ps tmp/7dojt1457461387.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.299 0.429 2.746