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(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 = '4' > par1 <- '4' > #'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] 156 > (np <- floor(n / par1)) [1] 39 > 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] 39 39 39 39 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 254 162 155 232 243 221 273 140 202 340 174 209 339 153 [2,] 200 145 173 143 192 227 182 186 184 151 309 171 139 222 [3,] 165 145 160 161 157 132 188 178 119 240 174 117 186 102 [4,] 123 161 47 159 143 41 162 236 16 235 207 10 155 107 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 188 394 202 240 455 310 292 321 204 364 556 230 [2,] 162 209 258 258 345 297 304 206 246 328 193 253 [3,] 185 248 215 276 311 300 186 160 234 158 221 240 [4,] 24 254 309 48 346 274 14 217 175 40 278 252 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 228 557 306 316 679 387 203 537 313 179 443 303 [2,] 306 279 471 329 428 590 255 172 335 335 165 342 [3,] 206 399 293 265 394 177 261 425 222 286 275 322 [4,] 48 364 333 61 352 199 115 244 223 154 304 291 [,39] [,40] [1,] 300 NA [2,] 491 NA [3,] 266 NA [4,] 176 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] -54 -17 18 -89 -51 6 -91 46 -18 -189 135 -38 -200 69 [2,] -35 0 -13 18 -35 -95 6 -8 -65 89 -135 -54 47 -120 [3,] -42 16 -113 -2 -14 -91 -26 58 -103 -5 33 -107 -31 5 [4,] 39 -6 185 84 78 232 -22 -34 324 -61 2 329 -2 81 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] -26 -185 56 18 -110 -13 12 -115 42 -36 -363 23 [2,] 23 39 -43 18 -34 3 -118 -46 -12 -170 28 -13 [3,] -161 6 94 -228 35 -26 -172 57 -59 -118 57 12 [4,] 370 -52 -69 407 -36 18 307 -13 189 516 -48 -24 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 78 -278 165 13 -251 203 52 -365 22 156 -278 39 [2,] -100 120 -178 -64 -34 -413 6 253 -113 -49 110 -20 [3,] -158 -35 40 -204 -42 22 -146 -181 1 -132 29 -31 [4,] 509 -58 -17 618 35 4 422 69 -44 289 -1 9 [,39] [,40] [1,] 191 NA [2,] -225 NA [3,] -90 NA [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/12mh31445174148.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/2s1l61445174148.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/3ka0h1445174148.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/4sp2s1445174148.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] [1,] 140.0 139.0 102.0 10 [2,] 203.5 183.0 163.0 84 [3,] 273.0 246.0 215.0 175 [4,] 339.5 318.5 270.5 253 [5,] 537.0 491.0 425.0 364 $n [1] 39 39 39 39 $conf [,1] [,2] [,3] [,4] [1,] 238.5917 211.7182 187.8022 132.2426 [2,] 307.4083 280.2818 242.1978 217.7574 $out [1] 556 557 679 590 $group [1] 1 1 1 2 $names [1] "1" "2" "3" "4" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5f5uc1445174148.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] [1,] -278.0 -178 -228 -69.0 [2,] -100.5 -80 -110 -22.0 [3,] -13.0 -34 -31 26.5 [4,] 44.0 12 14 289.0 [5,] 203.0 120 94 618.0 $n [1] 39 39 39 38 $conf [,1] [,2] [,3] [,4] [1,] -49.55886 -57.27623 -62.3723079 -53.21236 [2,] 23.55886 -10.72377 0.3723079 106.21236 $out [1] -363 -365 -413 253 -225 $group [1] 1 1 2 2 2 $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(-278, -100.5, -13, 44, 203, -178, -80, -34, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69h841445174148.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] [1,] 123.0 145.0 47.0 143.0 143.0 41.0 162.0 140 16.0 151.0 174.0 10.0 [2,] 144.0 145.0 101.0 151.0 150.0 86.5 172.0 159 67.5 193.0 174.0 63.5 [3,] 182.5 153.0 157.5 160.0 174.5 176.5 185.0 182 151.5 237.5 190.5 144.0 [4,] 227.0 161.5 166.5 196.5 217.5 224.0 230.5 211 193.0 290.0 258.0 190.0 [5,] 254.0 162.0 173.0 232.0 243.0 227.0 273.0 236 202.0 340.0 309.0 209.0 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 139.0 102.0 24.0 209.0 202.0 48 311.0 274.0 14 160.0 175.0 40 [2,] 147.0 104.5 93.0 228.5 208.5 144 328.0 285.5 100 183.0 189.5 99 [3,] 170.5 130.0 173.5 251.0 236.5 249 345.5 298.5 239 211.5 219.0 243 [4,] 262.5 187.5 186.5 324.0 283.5 267 400.5 305.0 298 269.0 240.0 346 [5,] 339.0 222.0 188.0 394.0 309.0 276 455.0 310.0 304 321.0 246.0 364 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 193.0 230.0 48 279.0 293.0 61.0 352.0 177.0 115 172.0 222.0 154.0 [2,] 207.0 235.0 127 321.5 299.5 163.0 373.0 188.0 159 208.0 222.5 166.5 [3,] 249.5 246.0 217 381.5 319.5 290.5 411.0 293.0 229 334.5 268.0 232.5 [4,] 417.0 252.5 267 478.0 402.0 322.5 553.5 488.5 258 481.0 324.0 310.5 [5,] 556.0 253.0 306 557.0 471.0 329.0 679.0 590.0 261 537.0 335.0 335.0 [,37] [,38] [,39] [,40] [1,] 165.0 291.0 176.0 NA [2,] 220.0 297.0 221.0 NA [3,] 289.5 312.5 283.0 NA [4,] 373.5 332.0 395.5 NA [5,] 443.0 342.0 491.0 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 [39] 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 116.93 139.965 105.755 124.055 121.175 67.875 138.785 140.92 52.355 [2,] 248.07 166.035 209.245 195.945 227.825 285.125 231.215 223.08 250.645 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 160.87 124.14 44.065 79.255 64.43 99.635 175.555 177.25 151.83 288.225 [2,] 314.13 256.86 243.935 261.745 195.57 247.365 326.445 295.75 346.17 402.775 [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [1,] 283.095 82.58 143.56 179.105 47.87 83.6 232.175 106.4 257.865 238.525 [2,] 313.905 395.42 279.44 258.895 438.13 415.4 259.825 327.6 505.135 400.475 [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 164.495 268.405 55.605 150.79 118.83 187.815 118.74 168.235 284.85 [2,] 416.505 553.595 530.395 307.21 550.17 348.185 346.26 410.765 340.15 [,39] [,40] [1,] 145.145 NA [2,] 420.855 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" NA Warning message: In bxp(list(stats = c(123, 144, 182.5, 227, 254, 145, 145, 153, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7d7ar1445174148.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,] 176.8462 175.0 168.500 [2,] 200.5897 195.0 192.625 [3,] 242.6923 230.5 233.750 [4,] 279.2949 259.5 261.125 [5,] 297.5385 273.0 271.500 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 180.5153 179.545 179.635 [2,] 304.8694 281.455 287.865 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(176.846153846154, 200.589743589744, 242.692307692308, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12mh31445174148.ps tmp/12mh31445174148.png",intern=TRUE)) character(0) > try(system("convert tmp/2s1l61445174148.ps tmp/2s1l61445174148.png",intern=TRUE)) character(0) > try(system("convert tmp/3ka0h1445174148.ps tmp/3ka0h1445174148.png",intern=TRUE)) character(0) > try(system("convert tmp/4sp2s1445174148.ps tmp/4sp2s1445174148.png",intern=TRUE)) character(0) > try(system("convert tmp/5f5uc1445174148.ps tmp/5f5uc1445174148.png",intern=TRUE)) character(0) > try(system("convert tmp/69h841445174148.ps tmp/69h841445174148.png",intern=TRUE)) character(0) > try(system("convert tmp/7d7ar1445174148.ps tmp/7d7ar1445174148.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.512 0.422 2.966