R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(304040,307100,304330,294710,286890,279050,271860,266710,259590,253830,250640,249140,250840,247590,237830,226380,217230,211420,207620,204310,197490,193580,192330,191970,196070,191940,185620,179410,173920,169190,166840,165170,161450,160830,163670,170830,182690,190940,197770,205090,210720,220210,229730,237070,241620,250370,258570,269860,283220,289610,281770,274700,267650,261380,260500,260730,254200,250450,253380,263740,276240,273820,265890,258400,253520,250710,252850,255260,251170,252500,257780,269900,291590,298870,295570,292100,290870,290580,297970,304010,304340,309850,322320,340170,369280,376690,379700,379520,377770,381560,394580,399320,400370,408200,419070,437730) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 304040 250840 196070 182690 283220 276240 291590 369280 NA [2,] 307100 247590 191940 190940 289610 273820 298870 376690 NA [3,] 304330 237830 185620 197770 281770 265890 295570 379700 NA [4,] 294710 226380 179410 205090 274700 258400 292100 379520 NA [5,] 286890 217230 173920 210720 267650 253520 290870 377770 NA [6,] 279050 211420 169190 220210 261380 250710 290580 381560 NA [7,] 271860 207620 166840 229730 260500 252850 297970 394580 NA [8,] 266710 204310 165170 237070 260730 255260 304010 399320 NA [9,] 259590 197490 161450 241620 254200 251170 304340 400370 NA [10,] 253830 193580 160830 250370 250450 252500 309850 408200 NA [11,] 250640 192330 163670 258570 253380 257780 322320 419070 NA [12,] 249140 191970 170830 269860 263740 269900 340170 437730 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 3060 -3250 -4130 8250 6390 -2420 7280 7410 NA [2,] -2770 -9760 -6320 6830 -7840 -7930 -3300 3010 NA [3,] -9620 -11450 -6210 7320 -7070 -7490 -3470 -180 NA [4,] -7820 -9150 -5490 5630 -7050 -4880 -1230 -1750 NA [5,] -7840 -5810 -4730 9490 -6270 -2810 -290 3790 NA [6,] -7190 -3800 -2350 9520 -880 2140 7390 13020 NA [7,] -5150 -3310 -1670 7340 230 2410 6040 4740 NA [8,] -7120 -6820 -3720 4550 -6530 -4090 330 1050 NA [9,] -5760 -3910 -620 8750 -3750 1330 5510 7830 NA [10,] -3190 -1250 2840 8200 2930 5280 12470 10870 NA [11,] -1500 -360 7160 11290 10360 12120 17850 18660 NA [12,] 1700 4100 11860 13360 12500 21690 29110 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/1vsic1424956627.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/2t0q21424956627.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/3ksx21424956627.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/49wnl1424956627.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,] 182690 190940 185620 179410 173920 169190 166840 165170 161450 160830 [2,] 223455 219765 217800 215735 213975 215815 218675 220690 219555 221975 [3,] 279730 281715 273830 266550 260585 256045 256675 257995 252685 251475 [4,] 297815 302985 299950 293405 288880 284815 284915 285360 281965 281840 [5,] 369280 376690 379700 379520 377770 381560 297970 304010 304340 309850 [,11] [,12] [1,] 163670 170830 [2,] 221485 220555 [3,] 255580 266800 [4,] 290445 305035 [5,] 322320 340170 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 238191.4 235227.1 227939.8 223162.4 218742 217500.6 219672.4 221869.4 [2,] 321268.6 328202.9 319720.2 309937.6 302428 294589.4 293677.6 294120.6 [,9] [,10] [,11] [,12] [1,] 217821.9 218033.6 217058 219608.3 [2,] 287548.1 284916.4 294102 313991.7 $out [1] 394580 399320 400370 408200 419070 437730 $group [1] 7 8 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(182690, 223455, 279730, 297815, 369280, 190940, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55kt31424956627.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,] -4130 -9760 -11450 -9150 -7840 -7190 -5150 -7120 -5760 -3190 -1500 1700 [2,] -2835 -7885 -8555 -7435 -6040 -3075 -2490 -6675 -3830 795 3400 7980 [3,] 4725 -4810 -6640 -5185 -3770 630 1320 -3905 355 4105 10825 12500 [4,] 7345 120 -1825 -1490 1750 8455 5390 690 6670 9535 14985 17525 [5,] 8250 6830 7320 5630 9490 13020 7340 4550 8750 12470 18660 29110 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -961.6942 -9281.7079 -10399.475 -8505.962 -8121.6058 -5810.824 -3081.881 [2,] 10411.6942 -338.2921 -2880.525 -1864.038 581.6058 7070.824 5721.881 [,8] [,9] [,10] [,11] [,12] [1,] -8019.1947 -5510.451 -777.2895 4353.453 6799.88 [2,] 209.1947 6220.451 8987.2895 17296.547 18200.12 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4130, -2835, 4725, 7345, 8250, -9760, -7885, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/674f81424956627.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] [1,] 249140 191970 160830 182690 250450 250710 290580 369280 NA [2,] 256710 195535 164420 201430 257350 252675 291845 378645 NA [3,] 275455 209520 170010 224970 262560 256520 298420 388070 NA [4,] 299375 232105 182515 245995 278235 267895 307095 404285 NA [5,] 307100 250840 196070 269860 289610 276240 322320 437730 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 255995.2 192840.2 161756.7 204643.6 253034.2 249578.1 291464.4 376375.4 [2,] 294914.8 226199.8 178263.3 245296.4 272085.8 263461.9 305375.6 399764.6 [,9] [1,] NA [2,] NA $out [1] 340170 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(249140, 256710, 275455, 299375, 307100, 191970, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72jvs1424956627.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,] 258012.5 251475.0 249972.5 [2,] 259886.2 255812.5 251519.4 [3,] 262680.6 259290.0 253871.2 [4,] 268903.1 270315.0 261972.5 [5,] 274167.5 281715.0 267302.5 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 258568.0 252675.3 249103.5 [2,] 266793.3 265904.7 258639.0 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(258012.5, 259886.25, 262680.625, 268903.125, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vsic1424956627.ps tmp/1vsic1424956627.png",intern=TRUE)) character(0) > try(system("convert tmp/2t0q21424956627.ps tmp/2t0q21424956627.png",intern=TRUE)) character(0) > try(system("convert tmp/3ksx21424956627.ps tmp/3ksx21424956627.png",intern=TRUE)) character(0) > try(system("convert tmp/49wnl1424956627.ps tmp/49wnl1424956627.png",intern=TRUE)) character(0) > try(system("convert tmp/55kt31424956627.ps tmp/55kt31424956627.png",intern=TRUE)) character(0) > try(system("convert tmp/674f81424956627.ps tmp/674f81424956627.png",intern=TRUE)) character(0) > try(system("convert tmp/72jvs1424956627.ps tmp/72jvs1424956627.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.535 0.426 2.995