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(330,310,310,380,330,250,370,380,430,360,440,480,260,340,270,400,330,340,360,480,490,420,430,450,300,320,260,330,260,330,350,500,570,450,420,360,280,360,260,370,200,320,390,480,570,450,460,320,310,410,230,450,230,310,430,540,450,430,480,320,310,380,210,450,120,210,410,660,510,510,450,290,320,380,260,530,180,260,460,620,540,610,460,290,330,440,350,450,240,280,540,540,600,590,410,270,370,350,340,420,210,180,580,560,610,560,410,330) > 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,] 330 260 300 280 310 310 320 330 370 NA [2,] 310 340 320 360 410 380 380 440 350 NA [3,] 310 270 260 260 230 210 260 350 340 NA [4,] 380 400 330 370 450 450 530 450 420 NA [5,] 330 330 260 200 230 120 180 240 210 NA [6,] 250 340 330 320 310 210 260 280 180 NA [7,] 370 360 350 390 430 410 460 540 580 NA [8,] 380 480 500 480 540 660 620 540 560 NA [9,] 430 490 570 570 450 510 540 600 610 NA [10,] 360 420 450 450 430 510 610 590 560 NA [11,] 440 430 420 460 480 450 460 410 410 NA [12,] 480 450 360 320 320 290 290 270 330 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -20 80 20 80 100 70 60 110 -20 NA [2,] 0 -70 -60 -100 -180 -170 -120 -90 -10 NA [3,] 70 130 70 110 220 240 270 100 80 NA [4,] -50 -70 -70 -170 -220 -330 -350 -210 -210 NA [5,] -80 10 70 120 80 90 80 40 -30 NA [6,] 120 20 20 70 120 200 200 260 400 NA [7,] 10 120 150 90 110 250 160 0 -20 NA [8,] 50 10 70 90 -90 -150 -80 60 50 NA [9,] -70 -70 -120 -120 -20 0 70 -10 -50 NA [10,] 80 10 -30 10 50 -60 -150 -180 -150 NA [11,] 40 20 -60 -140 -160 -160 -170 -140 -80 NA [12,] -220 -150 -80 -10 -10 30 40 100 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/148ml1407940211.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/2ixvd1407940211.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/3osxa1407940211.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/4l1k81407940211.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,] 260 310 210 330 120 180 350 380 430 360 410 270 [2,] 300 340 260 380 200 250 370 480 490 430 420 290 [3,] 310 360 260 420 230 280 410 540 540 450 440 320 [4,] 330 380 310 450 260 320 460 560 570 560 460 360 [5,] 370 440 350 530 330 340 580 660 610 610 480 450 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 294.2 338.9333 233.6667 383.1333 198.4 243.1333 362.6 497.8667 497.8667 [2,] 325.8 381.0667 286.3333 456.8667 261.6 316.8667 457.4 582.1333 582.1333 [,10] [,11] [,12] [1,] 381.5333 418.9333 283.1333 [2,] 518.4667 461.0667 356.8667 $out [1] 480 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(260, 300, 310, 330, 370, 310, 340, 360, 380, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5y2e21407940211.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,] -20 -180 70 -350 -80 20 -20 -150 -120 -180 -170 -220 [2,] 20 -120 80 -220 10 70 10 -80 -70 -150 -160 -115 [3,] 70 -90 110 -210 70 120 110 50 -50 -30 -140 -10 [4,] 80 -60 220 -70 80 200 150 60 -10 10 -60 35 [5,] 110 0 270 -50 120 260 250 90 70 80 40 100 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 38.4 -121.6 36.26667 -289 33.13333 51.53333 36.26667 -23.73333 -81.6 [2,] 101.6 -58.4 183.73333 -131 106.86667 188.46667 183.73333 123.73333 -18.4 [,10] [,11] [,12] [1,] -114.26667 -192.66667 -93.79215 [2,] 54.26667 -87.33333 73.79215 $out [1] 400 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-20, 20, 70, 80, 110, -180, -120, -90, -60, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tqzr1407940211.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] [1,] 250 260 260 200 230 120 180 240 180 NA [2,] 320 335 310 300 310 250 275 305 335 NA [3,] 365 380 340 365 420 395 420 425 390 NA [4,] 405 440 435 455 450 480 535 540 560 NA [5,] 480 490 570 570 540 660 620 600 610 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 326.2309 332.1088 282.9867 294.3035 356.1451 290.0955 301.4123 317.8149 [2,] 403.7691 427.8912 397.0133 435.6965 483.8549 499.9045 538.5877 532.1851 [,9] [,10] [1,] 287.376 NA [2,] 492.624 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(250, 320, 365, 405, 480, 260, 335, 380, 440, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7uxyq1407940211.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,] 233.3333 230 230.0 [2,] 294.4444 295 300.0 [3,] 392.7778 385 387.5 [4,] 463.3333 445 467.5 [5,] 530.0000 540 530.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 315.7464 316.584 311.1021 [2,] 469.8091 453.416 463.8979 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(233.333333333333, 294.444444444444, 392.777777777778, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/148ml1407940211.ps tmp/148ml1407940211.png",intern=TRUE)) character(0) > try(system("convert tmp/2ixvd1407940211.ps tmp/2ixvd1407940211.png",intern=TRUE)) character(0) > try(system("convert tmp/3osxa1407940211.ps tmp/3osxa1407940211.png",intern=TRUE)) character(0) > try(system("convert tmp/4l1k81407940211.ps tmp/4l1k81407940211.png",intern=TRUE)) character(0) > try(system("convert tmp/5y2e21407940211.ps tmp/5y2e21407940211.png",intern=TRUE)) character(0) > try(system("convert tmp/6tqzr1407940211.ps tmp/6tqzr1407940211.png",intern=TRUE)) character(0) > try(system("convert tmp/7uxyq1407940211.ps tmp/7uxyq1407940211.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.472 0.405 2.915