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(112,118,132,129,121,135,148,148,136,119,104,118,115,126,141,135,125,149,170,170,158,133,114,140,145,150,178,163,172,178,199,199,184,162,146,166,171,180,193,181,183,218,230,242,209,191,172,194,196,196,236,235,229,243,264,272,237,211,180,201,204,188,235,227,234,264,302,293,259,229,203,229,242,233,267,269,270,315,364,347,312,274,237,278,284,277,317,313,318,374,413,405,355,306,271,306,315,301,356,348,355,422,465,467,404,347,305,336,340,318,362,348,363,435,491,505,404,359,310,337,360,342,406,396,420,472,548,559,463,407,362,405,417,391,419,461,472,535,622,606,508,461,390,432) > par1 = '4' > par1 <- '4' > #'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] 144 > (np <- floor(n / par1)) [1] 36 > 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] 36 36 36 36 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 112 121 136 115 125 158 145 172 184 171 183 209 196 229 [2,] 118 135 119 126 149 133 150 178 162 180 218 191 196 243 [3,] 132 148 104 141 170 114 178 199 146 193 230 172 236 264 [4,] 129 148 118 135 170 140 163 199 166 181 242 194 235 272 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 237 204 234 259 242 270 312 284 318 355 315 355 [2,] 211 188 264 229 233 315 274 277 374 306 301 422 [3,] 180 235 302 203 267 364 237 317 413 271 356 465 [4,] 201 227 293 229 269 347 278 313 405 306 348 467 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 404 340 363 404 360 420 463 417 472 508 NA [2,] 347 318 435 359 342 472 407 391 535 461 NA [3,] 305 362 491 310 406 548 362 419 622 390 NA [4,] 336 348 505 337 396 559 405 461 606 432 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 6 14 -17 11 24 -25 5 6 -22 9 35 -18 0 14 [2,] 14 13 -15 15 21 -19 28 21 -16 13 12 -19 40 21 [3,] -3 0 14 -6 0 26 -15 0 20 -12 12 22 -1 8 [4,] -8 -12 -3 -10 -12 5 9 -15 5 2 -33 2 -6 -35 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] -26 -16 30 -30 -9 45 -38 -7 56 -49 -14 67 [2,] -31 47 38 -26 34 49 -37 40 39 -35 55 43 [3,] 21 -8 -9 26 2 -17 41 -4 -8 35 -8 2 [4,] 3 7 -34 13 1 -35 6 5 -50 9 7 -63 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] -57 -22 72 -45 -18 52 -56 -26 63 -47 NA [2,] -42 44 56 -49 64 76 -45 28 87 -71 NA [3,] 31 -14 14 27 -10 11 43 42 -16 42 NA [4,] 4 15 -101 23 24 -96 12 11 -98 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/1rc1o1457453158.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/2rhar1457453158.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/3jyws1457453158.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/4ytc81457453158.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,] 112.0 118.0 104.0 118.0 [2,] 177.5 179.0 179.0 187.5 [3,] 250.5 253.5 265.5 275.0 [4,] 357.5 353.0 363.0 372.0 [5,] 508.0 535.0 622.0 606.0 $n [1] 36 36 36 36 $conf [,1] [,2] [,3] [,4] [1,] 203.1 207.68 217.0467 226.415 [2,] 297.9 299.32 313.9533 323.585 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5s0cq1457453158.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,] -57.0 -71.0 -17 -63 [2,] -25.5 -19.0 -8 -24 [3,] -8.0 21.0 2 2 [4,] 19.0 41.5 24 7 [5,] 72.0 87.0 43 24 $n [1] 36 36 36 35 $conf [,1] [,2] [,3] [,4] [1,] -19.718333 5.068333 -6.426667 -6.279131 [2,] 3.718333 36.931667 10.426667 10.279131 $out [1] -101 -96 -98 $group [1] 4 4 4 $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(-57, -25.5, -8, 19, 72, -71, -19, 21, 41.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63qsg1457453158.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,] 112.0 121.0 104.0 115.0 125.0 114.0 145.0 172.0 146 171.0 183.0 172.0 [2,] 115.0 128.0 111.0 120.5 137.0 123.5 147.5 175.0 154 175.5 200.5 181.5 [3,] 123.5 141.5 118.5 130.5 159.5 136.5 156.5 188.5 164 180.5 224.0 192.5 [4,] 130.5 148.0 127.5 138.0 170.0 149.0 170.5 199.0 175 187.0 236.0 201.5 [5,] 132.0 148.0 136.0 141.0 170.0 158.0 178.0 199.0 184 193.0 242.0 209.0 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 196.0 229.0 180.0 188.0 234.0 203 233.0 270.0 237.0 277.0 318.0 271.0 [2,] 196.0 236.0 190.5 196.0 249.0 216 237.5 292.5 255.5 280.5 346.0 288.5 [3,] 215.5 253.5 206.0 215.5 278.5 229 254.5 331.0 276.0 298.5 389.5 306.0 [4,] 235.5 268.0 224.0 231.0 297.5 244 268.0 355.5 295.0 315.0 409.0 330.5 [5,] 236.0 272.0 237.0 235.0 302.0 259 269.0 364.0 312.0 317.0 413.0 355.0 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 301.0 355.0 305.0 318 363 310.0 342 420.0 362.0 391 472.0 390.0 [2,] 308.0 388.5 320.5 329 399 323.5 351 446.0 383.5 404 503.5 411.0 [3,] 331.5 443.5 341.5 344 463 348.0 378 510.0 406.0 418 570.5 446.5 [4,] 352.0 466.0 375.5 355 498 381.5 401 553.5 435.0 440 614.0 484.5 [5,] 356.0 467.0 404.0 362 505 404.0 406 559.0 463.0 461 622.0 508.0 [,37] [1,] NA [2,] NA [3,] NA [4,] NA [5,] 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 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 111.255 125.7 105.465 116.675 133.43 116.355 138.33 169.54 147.41 171.415 [2,] 135.745 157.3 131.535 144.325 185.57 156.645 174.67 207.46 180.59 189.585 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 195.955 176.7 184.295 228.22 179.535 187.85 240.185 206.88 230.405 281.23 [2,] 252.045 208.3 246.705 278.78 232.465 243.15 316.815 251.12 278.595 380.77 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 244.795 271.245 339.73 272.82 296.74 382.275 298.05 323.46 384.79 302.18 [2,] 307.205 325.755 439.27 339.18 366.26 504.725 384.95 364.54 541.21 393.82 [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 338.5 425.075 365.315 389.56 483.205 388.435 NA [2,] 417.5 594.925 446.685 446.44 657.795 504.565 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" NA Warning message: In bxp(list(stats = c(112, 115, 123.5, 130.5, 132, 121, 128, 141.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/730331457453158.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,] 271.0833 250.50 264.7500 [2,] 271.5417 252.00 266.5000 [3,] 278.3889 259.50 269.6250 [4,] 289.0556 270.25 273.1875 [5,] 293.3333 275.00 275.3750 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 264.5529 245.0825 264.3419 [2,] 292.2249 273.9175 274.9081 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(271.083333333333, 271.541666666667, 278.388888888889, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rc1o1457453158.ps tmp/1rc1o1457453158.png",intern=TRUE)) character(0) > try(system("convert tmp/2rhar1457453158.ps tmp/2rhar1457453158.png",intern=TRUE)) character(0) > try(system("convert tmp/3jyws1457453158.ps tmp/3jyws1457453158.png",intern=TRUE)) character(0) > try(system("convert tmp/4ytc81457453158.ps tmp/4ytc81457453158.png",intern=TRUE)) character(0) > try(system("convert tmp/5s0cq1457453158.ps tmp/5s0cq1457453158.png",intern=TRUE)) character(0) > try(system("convert tmp/63qsg1457453158.ps tmp/63qsg1457453158.png",intern=TRUE)) character(0) > try(system("convert tmp/730331457453158.ps tmp/730331457453158.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.735 0.455 3.226