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(498.10,498.76,498.88,498.88,498.88,498.88,499.48,501.21,502.05,502.05,502.05,504.10,506.81,516.88,520.43,520.68,520.68,520.68,521.03,521.25,521.25,521.25,521.65,521.65,522.77,518.72,519.27,519.38,521.29,521.29,521.29,523.47,523.86,524.14,524.14,524.14,534.60,534.99,535.39,535.39,535.39,535.39,535.39,535.64,536.08,537.80,537.80,537.80,537.85,544.39,545.15,544.65,544.65,544.65,545.73,548.94,550.94,551.22,551.22,551.22,553.12,565.37,566.73,566.73,566.78,566.78,566.78,566.78,566.93,566.93,566.93,566.93,574.38,574.40,574.40,574.40,574.40,574.40,574.50,574.50,574.67,574.66,574.66,574.94,576.10,583.38,584.15,584.15,584.15,584.15,585.14,585.14,585.67,586.49,586.81,586.85) > 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,] 498.10 506.81 522.77 534.60 537.85 553.12 574.38 576.10 NA [2,] 498.76 516.88 518.72 534.99 544.39 565.37 574.40 583.38 NA [3,] 498.88 520.43 519.27 535.39 545.15 566.73 574.40 584.15 NA [4,] 498.88 520.68 519.38 535.39 544.65 566.73 574.40 584.15 NA [5,] 498.88 520.68 521.29 535.39 544.65 566.78 574.40 584.15 NA [6,] 498.88 520.68 521.29 535.39 544.65 566.78 574.40 584.15 NA [7,] 499.48 521.03 521.29 535.39 545.73 566.78 574.50 585.14 NA [8,] 501.21 521.25 523.47 535.64 548.94 566.78 574.50 585.14 NA [9,] 502.05 521.25 523.86 536.08 550.94 566.93 574.67 585.67 NA [10,] 502.05 521.25 524.14 537.80 551.22 566.93 574.66 586.49 NA [11,] 502.05 521.65 524.14 537.80 551.22 566.93 574.66 586.81 NA [12,] 504.10 521.65 524.14 537.80 551.22 566.93 574.94 586.85 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.66 10.07 -4.05 0.39 6.54 12.25 0.02 7.28 NA [2,] 0.12 3.55 0.55 0.40 0.76 1.36 0.00 0.77 NA [3,] 0.00 0.25 0.11 0.00 -0.50 0.00 0.00 0.00 NA [4,] 0.00 0.00 1.91 0.00 0.00 0.05 0.00 0.00 NA [5,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 NA [6,] 0.60 0.35 0.00 0.00 1.08 0.00 0.10 0.99 NA [7,] 1.73 0.22 2.18 0.25 3.21 0.00 0.00 0.00 NA [8,] 0.84 0.00 0.39 0.44 2.00 0.15 0.17 0.53 NA [9,] 0.00 0.00 0.28 1.72 0.28 0.00 -0.01 0.82 NA [10,] 0.00 0.40 0.00 0.00 0.00 0.00 0.00 0.32 NA [11,] 2.05 0.00 0.00 0.00 0.00 0.00 0.28 0.04 NA [12,] 2.71 1.12 10.46 0.05 1.90 7.45 1.16 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/1378i1432651602.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/2jia51432651602.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/3hyd61432651602.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/403p01432651602.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] [1,] 498.100 498.760 498.880 498.880 498.880 498.880 499.48 501.21 502.050 [2,] 514.790 517.800 519.850 520.030 520.985 520.985 521.16 522.36 522.555 [3,] 536.225 539.690 540.270 540.020 540.020 540.020 540.56 542.29 543.510 [4,] 563.750 569.885 570.565 570.565 570.590 570.590 570.64 570.64 570.800 [5,] 576.100 583.380 584.150 584.150 584.150 584.150 585.14 585.14 585.670 [,10] [,11] [,12] [1,] 502.050 502.050 504.100 [2,] 522.695 522.895 522.895 [3,] 544.510 544.510 544.510 [4,] 570.795 570.795 570.935 [5,] 586.490 586.810 586.850 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 508.8752 510.5946 511.9399 511.7904 512.3099 512.3099 512.9198 515.3201 [2,] 563.5748 568.7854 568.6001 568.2496 567.7301 567.7301 568.2002 569.2599 [,9] [,10] [,11] [,12] [1,] 516.5597 517.6406 517.7524 517.6742 [2,] 570.4603 571.3794 571.2676 571.3458 $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(498.1, 514.79, 536.225, 563.75, 576.1, 498.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5lxmf1432651602.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,] -4.050 0.000 0.000 0.000 0 0.000 0.000 0.000 -0.01 0.00 0.00 0.05 [2,] 0.205 0.260 0.000 0.000 0 0.000 0.000 0.160 0.00 0.00 0.00 1.14 [3,] 3.600 0.655 0.000 0.000 0 0.225 0.235 0.415 0.14 0.00 0.00 1.90 [4,] 8.675 1.065 0.055 0.025 0 0.795 1.955 0.685 0.55 0.16 0.16 5.08 [5,] 12.250 1.360 0.110 0.050 0 1.080 3.210 0.840 0.82 0.32 0.28 10.46 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.131464 0.2053154 -0.03072379 -0.01396536 0 -0.2190984 -0.8570911 [2,] 8.331464 1.1046846 0.03072379 0.01396536 0 0.6690984 1.3270911 [,8] [,9] [,10] [,11] [,12] [1,] 0.1217275 -0.1672379 -0.0893783 -0.0893783 -0.4529044 [2,] 0.7082725 0.4472379 0.0893783 0.0893783 4.2529044 $out [1] 3.55 0.25 -0.50 1.91 2.00 1.72 0.40 2.05 $group [1] 2 3 3 4 8 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4.04999999999995, 0.204999999999984, 3.59999999999997, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67xzt1432651602.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,] 498.10 520.430 518.720 534.60 537.85 566.73 574.38 583.380 NA [2,] 498.88 520.555 520.335 535.39 544.65 566.73 574.40 584.150 NA [3,] 499.18 520.855 522.030 535.39 545.44 566.78 574.45 584.645 NA [4,] 502.05 521.250 524.000 536.94 551.08 566.93 574.66 586.080 NA [5,] 504.10 521.650 524.140 537.80 551.22 566.93 574.94 586.850 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 497.7341 520.538 520.3584 534.683 542.5072 566.6888 574.3314 583.7647 NA [2,] 500.6259 521.172 523.7016 536.097 548.3728 566.8712 574.5686 585.5253 NA $out [1] 506.81 516.88 553.12 565.37 576.10 $group [1] 2 2 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(498.1, 498.88, 499.18, 502.05, 504.1, 520.43, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7vhbo1432651602.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,] 542.1113 536.225 542.9438 [2,] 543.0412 540.020 544.4475 [3,] 543.4725 540.415 544.9394 [4,] 545.3744 544.010 546.0881 [5,] 545.9538 544.510 546.2250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 542.4083 538.5951 544.1911 [2,] 544.5367 542.2349 545.6877 $out [1] 537.9663 538.6075 $group [1] 1 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(542.11125, 543.04125, 543.4725, 545.374375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1378i1432651602.ps tmp/1378i1432651602.png",intern=TRUE)) character(0) > try(system("convert tmp/2jia51432651602.ps tmp/2jia51432651602.png",intern=TRUE)) character(0) > try(system("convert tmp/3hyd61432651602.ps tmp/3hyd61432651602.png",intern=TRUE)) character(0) > try(system("convert tmp/403p01432651602.ps tmp/403p01432651602.png",intern=TRUE)) character(0) > try(system("convert tmp/5lxmf1432651602.ps tmp/5lxmf1432651602.png",intern=TRUE)) character(0) > try(system("convert tmp/67xzt1432651602.ps tmp/67xzt1432651602.png",intern=TRUE)) character(0) > try(system("convert tmp/7vhbo1432651602.ps tmp/7vhbo1432651602.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.476 0.439 2.940