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(173019,173690,172439,171914,171968,169500,173898,172308,171568,164939,161275,160770,162466,160185,154836,154103,150495,142707,149962,149967,144572,143819,141070,144119,145330,143279,139063,139202,133632,134476,141859,140693,138047,138346,140167,146796,152228,155410,159032,160312,157687,160141,167421,167628,164403,163405,163229,171154,173323,172381,168983,165380,161641,161933,172018,168455,164332,161193,157645,161694,163411,161834,159511,156359,154223,151497,160607,159672,155601,154668,153960,157307,165218,165616,162212,159787,157454,156485,165887,166836,163541,163973,164805,167521,174347,173374,172198,171055,168385,167281,177670,177280,174846,174476,174595,178392,185345,183293,181081,177795,173552,170734,179293,178659,175894,174815,173506,175376) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 173019 162466 145330 152228 173323 163411 165218 174347 185345 NA [2,] 173690 160185 143279 155410 172381 161834 165616 173374 183293 NA [3,] 172439 154836 139063 159032 168983 159511 162212 172198 181081 NA [4,] 171914 154103 139202 160312 165380 156359 159787 171055 177795 NA [5,] 171968 150495 133632 157687 161641 154223 157454 168385 173552 NA [6,] 169500 142707 134476 160141 161933 151497 156485 167281 170734 NA [7,] 173898 149962 141859 167421 172018 160607 165887 177670 179293 NA [8,] 172308 149967 140693 167628 168455 159672 166836 177280 178659 NA [9,] 171568 144572 138047 164403 164332 155601 163541 174846 175894 NA [10,] 164939 143819 138346 163405 161193 154668 163973 174476 174815 NA [11,] 161275 141070 140167 163229 157645 153960 164805 174595 173506 NA [12,] 160770 144119 146796 171154 161694 157307 167521 178392 175376 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 671 -2281 -2051 3182 -942 -1577 398 -973 -2052 NA [2,] -1251 -5349 -4216 3622 -3398 -2323 -3404 -1176 -2212 NA [3,] -525 -733 139 1280 -3603 -3152 -2425 -1143 -3286 NA [4,] 54 -3608 -5570 -2625 -3739 -2136 -2333 -2670 -4243 NA [5,] -2468 -7788 844 2454 292 -2726 -969 -1104 -2818 NA [6,] 4398 7255 7383 7280 10085 9110 9402 10389 8559 NA [7,] -1590 5 -1166 207 -3563 -935 949 -390 -634 NA [8,] -740 -5395 -2646 -3225 -4123 -4071 -3295 -2434 -2765 NA [9,] -6629 -753 299 -998 -3139 -933 432 -370 -1079 NA [10,] -3664 -2749 1821 -176 -3548 -708 832 119 -1309 NA [11,] -505 3049 6629 7925 4049 3347 2716 3797 1870 NA [12,] 1696 1211 5432 2169 1717 7911 6826 6953 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/1aad91444925438.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/2dmpe1444925438.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/3lh7u1444925438.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/4unhk1444925438.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,] 152228 143279 154836 139202 133632 134476 141859 149967 138047 143819 [2,] 162466 160185 159032 156359 154223 151497 160607 159672 155601 154668 [3,] 165218 165616 162212 160312 157687 160141 167421 167628 164332 163405 [4,] 173323 173374 172198 171055 168385 167281 173898 172308 171568 164939 [5,] 185345 183293 181081 177795 173552 170734 179293 178659 175894 174815 [,11] [,12] [1,] 140167 144119 [2,] 153960 157307 [3,] 161275 161694 [4,] 164805 171154 [5,] 174595 178392 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 159500 158669.8 155277.9 152572.1 150228.3 151828.1 160421.1 160973 [2,] 170936 172562.2 169146.1 168051.9 165145.7 168453.9 174420.9 174283 [,9] [,10] [,11] [,12] [1,] 155922.7 157995.6 155563.3 154401.2 [2,] 172741.3 168814.4 166986.7 168986.8 $out [1] 145330 139063 140693 138346 $group [1] 1 3 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(152228, 162466, 165218, 173323, 185345, 143279, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5m0pu1444925438.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,] -2281 -5349 -3603 -5570 -2818 4398 -1590 -5395 -1079 -3664 1870 1211.0 [2,] -2051 -3404 -3152 -3739 -2726 7280 -1166 -4071 -1079 -2749 2716 1706.5 [3,] -973 -2323 -1143 -2670 -1104 8559 -634 -3225 -933 -708 3347 3800.5 [4,] 398 -1251 -525 -2333 292 9402 5 -2646 -370 119 4049 6889.5 [5,] 3182 -1176 1280 -2136 2454 10389 949 -740 432 1821 4049 7911.0 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2262.8067 -3456.913 -2526.5533 -3410.493 -2693.48 7441.413 -1250.72667 [2,] 316.8067 -1189.087 240.5533 -1929.507 485.48 9676.587 -17.27333 [,8] [,9] [,10] [,11] [,12] [1,] -3975.5 -1306.4067 -2218.48 2644.953 905.2018 [2,] -2474.5 -559.5933 802.48 4049.047 6695.7982 $out [1] 3622 54 -7788 -3563 -6629 -3139 -505 6629 7925 $group [1] 2 4 5 7 9 9 11 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2281, -2051, -973, 398, 3182, -5349, -3404, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6854a1444925438.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] [1,] 160770.0 141070.0 133632.0 152228.0 157645.0 151497.0 156485.0 167281.0 [2,] 167219.5 143969.0 138196.5 158359.5 161667.5 154445.5 160999.5 171626.5 [3,] 171941.0 149964.5 139684.5 161770.5 164856.0 156833.0 164389.0 174411.5 [4,] 172729.0 154469.5 142569.0 165912.0 170500.5 160139.5 165751.5 176063.0 [5,] 173898.0 162466.0 146796.0 171154.0 173323.0 163411.0 167521.0 178392.0 [,9] [,10] [1,] 170734.0 NA [2,] 174183.5 NA [3,] 176844.5 NA [4,] 180187.0 NA [5,] 185345.0 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 169428.1 145175.2 137690.2 158325.8 160827.2 154235.9 162221.6 172388 [2,] 174453.9 154753.8 141678.8 165215.2 168884.8 159430.1 166556.4 176435 [,9] [,10] [1,] 174106.3 NA [2,] 179582.7 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(160770, 167219.5, 171941, 172729, 173898, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7yoaf1444925438.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,] 157194.9 157687.0 159382.5 [2,] 159438.1 160793.5 160553.8 [3,] 162168.7 162808.5 163968.8 [4,] 165006.3 165417.0 166384.8 [5,] 166076.3 167628.0 167894.5 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 159629.0 160699.7 161309.2 [2,] 164708.3 164917.3 166628.3 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(157194.888888889, 159438.111111111, 162168.666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1aad91444925438.ps tmp/1aad91444925438.png",intern=TRUE)) character(0) > try(system("convert tmp/2dmpe1444925438.ps tmp/2dmpe1444925438.png",intern=TRUE)) character(0) > try(system("convert tmp/3lh7u1444925438.ps tmp/3lh7u1444925438.png",intern=TRUE)) character(0) > try(system("convert tmp/4unhk1444925438.ps tmp/4unhk1444925438.png",intern=TRUE)) character(0) > try(system("convert tmp/5m0pu1444925438.ps tmp/5m0pu1444925438.png",intern=TRUE)) character(0) > try(system("convert tmp/6854a1444925438.ps tmp/6854a1444925438.png",intern=TRUE)) character(0) > try(system("convert tmp/7yoaf1444925438.ps tmp/7yoaf1444925438.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.665 0.449 3.139