R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-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(369.82,373.1,374.55,375.01,374.81,375.31,375.31,375.39,375.59,376.26,377.18,377.26,377.26,381.87,387.09,387.14,388.78,389.16,389.16,389.42,389.49,388.97,388.97,389.09,389.09,391.76,390.96,391.76,392.8,393.06,393.06,393.26,393.87,394.47,394.57,394.57,394.57,399.57,406.13,407.03,409.46,409.9,409.9,410.14,410.54,410.69,410.79,410.97,410.97,413.8,423.31,423.85,426.6,426.26,426.26,426.32,427.14,427.55,428.29,428.8,428.8,434.87,435.66,440.75,440.99,441.04,441.04,441.88,441.92,442.48,442.81,442.81) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 369.82 377.26 389.09 394.57 410.97 428.80 NA [2,] 373.10 381.87 391.76 399.57 413.80 434.87 NA [3,] 374.55 387.09 390.96 406.13 423.31 435.66 NA [4,] 375.01 387.14 391.76 407.03 423.85 440.75 NA [5,] 374.81 388.78 392.80 409.46 426.60 440.99 NA [6,] 375.31 389.16 393.06 409.90 426.26 441.04 NA [7,] 375.31 389.16 393.06 409.90 426.26 441.04 NA [8,] 375.39 389.42 393.26 410.14 426.32 441.88 NA [9,] 375.59 389.49 393.87 410.54 427.14 441.92 NA [10,] 376.26 388.97 394.47 410.69 427.55 442.48 NA [11,] 377.18 388.97 394.57 410.79 428.29 442.81 NA [12,] 377.26 389.09 394.57 410.97 428.80 442.81 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.28 4.61 2.67 5.00 2.83 6.07 NA [2,] 1.45 5.22 -0.80 6.56 9.51 0.79 NA [3,] 0.46 0.05 0.80 0.90 0.54 5.09 NA [4,] -0.20 1.64 1.04 2.43 2.75 0.24 NA [5,] 0.50 0.38 0.26 0.44 -0.34 0.05 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.08 0.26 0.20 0.24 0.06 0.84 NA [8,] 0.20 0.07 0.61 0.40 0.82 0.04 NA [9,] 0.67 -0.52 0.60 0.15 0.41 0.56 NA [10,] 0.92 0.00 0.10 0.10 0.74 0.33 NA [11,] 0.08 0.12 0.00 0.18 0.51 0.00 NA [12,] 0.00 0.00 0.00 0.00 0.00 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/fisher/rcomp/tmp/1wd9x1350567287.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/fisher/rcomp/tmp/27o6d1350567287.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/fisher/rcomp/tmp/319g51350567287.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/fisher/rcomp/tmp/4n2vr1350567287.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,] 369.82 373.100 374.550 375.010 374.81 375.31 375.31 375.39 375.590 376.26 [2,] 377.26 381.870 387.090 387.140 388.78 389.16 389.16 389.42 389.490 388.97 [3,] 391.83 395.665 398.545 399.395 401.13 401.48 401.48 401.70 402.205 402.58 [4,] 410.97 413.800 423.310 423.850 426.60 426.26 426.26 426.32 427.140 427.55 [5,] 428.80 434.870 435.660 440.750 440.99 441.04 441.04 441.88 441.920 442.48 [,11] [,12] [1,] 377.18 377.26 [2,] 388.97 389.09 [3,] 402.68 402.77 [4,] 428.29 428.80 [5,] 442.81 442.81 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 370.086 375.0691 375.1819 375.7159 376.7349 377.5493 377.5493 377.8983 [2,] 413.574 416.2609 421.9081 423.0741 425.5251 425.4107 425.4107 425.5017 [,9] [,10] [,11] [,12] [1,] 377.9195 377.6947 377.3173 377.1558 [2,] 426.4905 427.4653 428.0427 428.3842 $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(369.82, 377.26, 391.83, 410.97, 428.8, 373.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5q5di1350567287.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,] 2.670 -0.800 0.05 -0.20 -0.34 0 0.06 0.04 -0.520 0.000 0.00 0 [2,] 2.830 0.790 0.46 0.24 0.05 0 0.08 0.07 0.150 0.100 0.00 0 [3,] 3.945 3.335 0.67 1.34 0.32 0 0.22 0.30 0.485 0.215 0.10 0 [4,] 5.000 6.560 0.90 2.43 0.44 0 0.26 0.61 0.600 0.740 0.18 0 [5,] 6.070 9.510 0.90 2.75 0.50 0 0.26 0.82 0.670 0.920 0.18 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.54528 -0.3868364 0.3861858 -0.07262073 0.0684374 0 0.1038942 [2,] 5.34472 7.0568364 0.9538142 2.75262073 0.5715626 0 0.3361058 [,8] [,9] [,10] [,11] [,12] [1,] -0.04831744 0.1947355 -0.1978207 -0.01610581 0 [2,] 0.64831744 0.7752645 0.6278207 0.21610581 0 $out [1] 5.09 0.84 0.51 $group [1] 3 7 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2.67000000000002, 2.82999999999998, 3.94500000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/64y8k1350567287.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] [1,] 373.100 387.090 389.09 406.130 423.310 434.870 NA [2,] 374.680 387.115 391.76 406.580 423.580 438.205 NA [3,] 375.310 388.970 393.06 409.900 426.290 441.040 NA [4,] 375.925 389.160 394.17 410.615 427.345 442.200 NA [5,] 377.260 389.490 394.57 410.970 428.800 442.810 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 374.7421 388.0373 391.9608 408.0596 424.5728 439.2179 NA [2,] 375.8779 389.9027 394.1592 411.7404 428.0072 442.8621 NA $out [1] 369.82 377.26 381.87 394.57 399.57 410.97 413.80 428.80 $group [1] 1 2 2 4 4 5 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(373.1, 374.68, 375.31, 375.925, 377.26, 387.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7u75b1350567287.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,] 399.1617 395.6650 403.5362 [2,] 403.6033 398.9700 403.7531 [3,] 405.7883 401.4800 406.1525 [4,] 406.5808 402.3925 406.8138 [5,] 407.2500 402.7700 407.4013 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 404.4303 399.919 404.7565 [2,] 407.1464 403.041 407.5485 $out [1] 395.0850 391.8300 393.5437 397.2925 $group [1] 1 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(399.161666666667, 403.603333333333, 405.788333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wd9x1350567287.ps tmp/1wd9x1350567287.png",intern=TRUE)) character(0) > try(system("convert tmp/27o6d1350567287.ps tmp/27o6d1350567287.png",intern=TRUE)) character(0) > try(system("convert tmp/319g51350567287.ps tmp/319g51350567287.png",intern=TRUE)) character(0) > try(system("convert tmp/4n2vr1350567287.ps tmp/4n2vr1350567287.png",intern=TRUE)) character(0) > try(system("convert tmp/5q5di1350567287.ps tmp/5q5di1350567287.png",intern=TRUE)) character(0) > try(system("convert tmp/64y8k1350567287.ps tmp/64y8k1350567287.png",intern=TRUE)) character(0) > try(system("convert tmp/7u75b1350567287.ps tmp/7u75b1350567287.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.456 0.636 4.086