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(790,766,1040,949,758,1023,921,775,907,835,871,836,789,811,996,778,603,990,735,800,706,766,870,647,726,784,884,696,893,674,703,799,793,799,1022,758,1021,944,915,864,1022,891,1087,822,890,1092,967,833,1104,1063,1103,1039,1185,1047,1155,878,879,1133,920,943) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 790 789 726 1021 1104 NA [2,] 766 811 784 944 1063 NA [3,] 1040 996 884 915 1103 NA [4,] 949 778 696 864 1039 NA [5,] 758 603 893 1022 1185 NA [6,] 1023 990 674 891 1047 NA [7,] 921 735 703 1087 1155 NA [8,] 775 800 799 822 878 NA [9,] 907 706 793 890 879 NA [10,] 835 766 799 1092 1133 NA [11,] 871 870 1022 967 920 NA [12,] 836 647 758 833 943 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -24 22 58 -77 -41 NA [2,] 274 185 100 -29 40 NA [3,] -91 -218 -188 -51 -64 NA [4,] -191 -175 197 158 146 NA [5,] 265 387 -219 -131 -138 NA [6,] -102 -255 29 196 108 NA [7,] -146 65 96 -265 -277 NA [8,] 132 -94 -6 68 1 NA [9,] -72 60 6 202 254 NA [10,] 36 104 223 -125 -213 NA [11,] -35 -223 -264 -134 23 NA [12,] -47 79 263 271 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/1w9091413140746.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/26gyl1413140746.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/3syq71413140746.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/4d0671413140746.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,] 726 766 884 696 603 891 703 775 706 766 870 647 [2,] 789 784 915 778 758 891 735 799 793 799 871 758 [3,] 790 811 996 864 893 990 921 800 879 835 920 833 [4,] 1021 944 1040 949 1022 1023 1087 822 890 1092 967 836 [5,] 1104 1063 1103 1039 1185 1047 1155 822 907 1133 1022 943 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 626.0694 697.9444 907.6753 743.1718 706.4583 896.7291 672.2777 [2,] 953.9306 924.0556 1084.3247 984.8282 1079.5417 1083.2709 1169.7223 [,8] [,9] [,10] [,11] [,12] [1,] 783.7483 810.46 627.9669 852.1666 777.8854 [2,] 816.2517 947.54 1042.0331 987.8334 888.1146 $out [1] 674 878 $group [1] 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(726, 789, 790, 1021, 1104, 766, 784, 811, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5eus01413140746.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,] -77 -29 -218 -191 -219 -255 -277 -94 -72 -213 -264 -47 [2,] -41 40 -188 -175 -138 -102 -265 -6 6 -125 -223 16 [3,] -24 100 -91 146 -131 29 -146 1 60 36 -134 171 [4,] 22 185 -64 158 265 108 65 68 202 104 -35 267 [5,] 58 274 -51 197 387 196 96 132 254 223 23 271 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -68.51564 -2.456635 -178.618088 -89.29696 -415.7588 -119.3855 -379.17717 [2,] 20.51564 202.456635 -3.381912 381.29696 153.7588 177.3855 87.17717 [,8] [,9] [,10] [,11] [,12] [1,] -51.28821 -78.49311 -125.8108 -266.840326 -27.29 [2,] 53.28821 198.49311 197.8108 -1.159674 369.29 $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(-77, -41, -24, 22, 58, -29, 40, 100, 185, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6k5q81413140746.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] [1,] 758.0 603.0 674.0 822.0 878.0 NA [2,] 782.5 720.5 714.5 877.0 931.5 NA [3,] 853.5 783.5 788.5 929.5 1055.0 NA [4,] 935.0 840.5 841.5 1021.5 1118.5 NA [5,] 1040.0 996.0 1022.0 1092.0 1185.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 783.9437 728.7672 730.5744 863.5926 969.708 NA [2,] 923.0563 838.2328 846.4256 995.4074 1140.292 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(758, 782.5, 853.5, 935, 1040, 603, 720.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7f4rt1413140746.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,] 803.4 790.0 797.00 [2,] 850.1 822.0 852.50 [3,] 889.1 871.5 897.50 [4,] 925.0 920.5 932.25 [5,] 987.6 996.0 977.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 854.9376 826.5735 861.1255 [2,] 923.2624 916.4265 933.8745 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(803.4, 850.1, 889.1, 925, 987.6, 790, 822, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1w9091413140746.ps tmp/1w9091413140746.png",intern=TRUE)) character(0) > try(system("convert tmp/26gyl1413140746.ps tmp/26gyl1413140746.png",intern=TRUE)) character(0) > try(system("convert tmp/3syq71413140746.ps tmp/3syq71413140746.png",intern=TRUE)) character(0) > try(system("convert tmp/4d0671413140746.ps tmp/4d0671413140746.png",intern=TRUE)) character(0) > try(system("convert tmp/5eus01413140746.ps tmp/5eus01413140746.png",intern=TRUE)) character(0) > try(system("convert tmp/6k5q81413140746.ps tmp/6k5q81413140746.png",intern=TRUE)) character(0) > try(system("convert tmp/7f4rt1413140746.ps tmp/7f4rt1413140746.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.405 0.362 2.800