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(254,200,165,123,162,145,145,161,155,173,160,47,232,143,161,159,243,192,157,143,221,227,132,41,273,182,188,162,140,186,178,236,202,184,119,16,340,151,240,235,174,309,174,207,209,171,117,10,339,139,186,155,153,222,102,107,188,162,185,24,394,209,248,254,202,258,215,309,240,258,276,48,455,345,311,346,310,297,300,274,292,304,186,14,321,206,160,217,204,246,234,175,364,328,158,40,556,193,221,278,230,253,240,252,228,306,206,48,557,279,399,364,306,471,293,333,316,329,265,61,679,428,394,352,387,590,177,199,203,255,261,115,537,172,425,244,313,335,222,223,179,335,286,154,443,165,275,304,303,342,322,291,300,491,266,176) > 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] 156 > (np <- floor(n / par1)) [1] 13 > 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] 13 13 13 13 13 13 13 13 13 13 13 13 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 254 232 273 340 339 394 455 321 556 557 679 537 443 [2,] 200 143 182 151 139 209 345 206 193 279 428 172 165 [3,] 165 161 188 240 186 248 311 160 221 399 394 425 275 [4,] 123 159 162 235 155 254 346 217 278 364 352 244 304 [5,] 162 243 140 174 153 202 310 204 230 306 387 313 303 [6,] 145 192 186 309 222 258 297 246 253 471 590 335 342 [7,] 145 157 178 174 102 215 300 234 240 293 177 222 322 [8,] 161 143 236 207 107 309 274 175 252 333 199 223 291 [9,] 155 221 202 209 188 240 292 364 228 316 203 179 300 [10,] 173 227 184 171 162 258 304 328 306 329 255 335 491 [11,] 160 132 119 117 185 276 186 158 206 265 261 286 266 [12,] 47 41 16 10 24 48 14 40 48 61 115 154 176 [,14] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] -54 -89 -91 -189 -200 -185 -110 -115 -363 -278 -251 -365 -278 [2,] -35 18 6 89 47 39 -34 -46 28 120 -34 253 110 [3,] -42 -2 -26 -5 -31 6 35 57 57 -35 -42 -181 29 [4,] 39 84 -22 -61 -2 -52 -36 -13 -48 -58 35 69 -1 [5,] -17 -51 46 135 69 56 -13 42 23 165 203 22 39 [6,] 0 -35 -8 -135 -120 -43 3 -12 -13 -178 -413 -113 -20 [7,] 16 -14 58 33 5 94 -26 -59 12 40 22 1 -31 [8,] -6 78 -34 2 81 -69 18 189 -24 -17 4 -44 9 [9,] 18 6 -18 -38 -26 18 12 -36 78 13 52 156 191 [10,] -13 -95 -65 -54 23 18 -118 -170 -100 -64 6 -49 -225 [11,] -113 -91 -103 -107 -161 -228 -172 -118 -158 -204 -146 -132 -90 [12,] 185 232 324 329 370 407 307 516 509 618 422 289 NA [,14] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] 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/1cesr1452208516.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/2nwu81452208516.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/36cxe1452208516.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/4xbk61452208516.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,] 232 139 160 123 140 145 102 107 155 162 117 10 [2,] 321 165 186 162 174 222 174 175 202 184 158 24 [3,] 394 193 240 244 230 258 215 223 221 258 186 47 [4,] 537 209 311 304 306 335 240 274 292 328 265 61 [5,] 679 209 425 364 387 471 322 333 364 491 286 115 $n [1] 13 13 13 13 13 13 13 13 13 13 13 13 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 299.346 173.7186 185.2234 181.7737 172.1559 208.4819 186.0779 179.6169 [2,] 488.654 212.2814 294.7766 306.2263 287.8441 307.5181 243.9221 266.3831 [,9] [,10] [,11] [,12] [1,] 181.5608 194.8973 139.1112 30.78611 [2,] 260.4392 321.1027 232.8888 63.21389 $out [1] 345 279 428 590 154 176 $group [1] 2 2 2 6 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(232, 321, 394, 537, 679, 139, 165, 193, 209, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bkn51452208516.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,] -365 -46 -42 -61 -17 -178 -59 -69 -38 -225 -228 185.0 [2,] -278 -34 -35 -48 22 -120 -14 -24 -18 -100 -161 298.0 [3,] -189 28 -5 -13 42 -35 12 2 13 -64 -132 349.5 [4,] -110 89 29 35 69 -12 33 18 52 -13 -107 465.5 [5,] -54 253 57 84 135 3 94 81 156 23 -90 618.0 $n [1] 13 13 13 13 13 13 13 13 13 13 13 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -262.6198 -25.90022 -33.04564 -49.37169 21.40398 -82.32702 -8.596018 [2,] -115.3802 81.90022 23.04564 23.37169 62.59602 12.32702 32.596018 [,8] [,9] [,10] [,11] [,12] [1,] -16.40495 -17.67492 -102.12454 -155.6635 273.1021 [2,] 20.40495 43.67492 -25.87546 -108.3365 425.8979 $out [1] -181 -51 165 203 -413 189 191 $group [1] 3 5 5 5 6 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-365, -278, -189, -110, -54, -46, -34, 28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gt6z1452208516.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] [,9] [,10] [,11] [,12] [,13] [1,] 123.0 41 119 117.0 102.0 202 274 40.0 193.0 265.0 115.0 154.0 266.0 [2,] 145.0 143 151 161.0 123.0 212 283 167.5 213.5 286.0 201.0 200.5 270.5 [3,] 160.5 160 183 190.5 158.5 251 302 211.5 235.0 322.5 306.5 265.0 301.5 [4,] 169.0 224 195 237.5 187.0 267 328 283.5 265.5 381.5 411.0 335.0 332.0 [5,] 200.0 243 236 340.0 222.0 309 346 364.0 306.0 471.0 679.0 425.0 342.0 [,14] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 149.5534 123.0554 162.9313 155.6078 129.3092 225.9141 281.4752 158.5916 [2,] 171.4466 196.9446 203.0687 225.3922 187.6908 276.0859 322.5248 264.4084 [,9] [,10] [,11] [,12] [,13] [,14] [1,] 211.2825 278.9418 210.7176 203.6536 273.4494 NA [2,] 258.7175 366.0582 402.2824 326.3464 329.5506 NA $out [1] 254 47 273 16 10 339 24 394 48 455 186 14 556 48 557 61 537 443 165 [20] 491 176 $group [1] 1 1 3 3 4 5 5 6 6 7 7 7 9 9 10 10 12 13 13 13 13 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" NA Warning message: In bxp(list(stats = c(123, 145, 160.5, 169, 200, 41, 143, 160, 224, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7z2le1452208516.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,] 201.3077 186.0 187.00 [2,] 214.2692 204.0 209.25 [3,] 239.3846 226.5 236.50 [4,] 265.2308 251.0 252.25 [5,] 295.8462 258.0 278.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 216.1407 205.063 216.8874 [2,] 262.6285 247.937 256.1126 $out [1] 413.84615 61.07692 394.00000 47.00000 429.00000 42.50000 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(201.307692307692, 214.269230769231, 239.384615384615, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cesr1452208516.ps tmp/1cesr1452208516.png",intern=TRUE)) character(0) > try(system("convert tmp/2nwu81452208516.ps tmp/2nwu81452208516.png",intern=TRUE)) character(0) > try(system("convert tmp/36cxe1452208516.ps tmp/36cxe1452208516.png",intern=TRUE)) character(0) > try(system("convert tmp/4xbk61452208516.ps tmp/4xbk61452208516.png",intern=TRUE)) character(0) > try(system("convert tmp/5bkn51452208516.ps tmp/5bkn51452208516.png",intern=TRUE)) character(0) > try(system("convert tmp/6gt6z1452208516.ps tmp/6gt6z1452208516.png",intern=TRUE)) character(0) > try(system("convert tmp/7z2le1452208516.ps tmp/7z2le1452208516.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.815 0.518 3.372