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(2201,1239,966,1001,1079,909,1038,817,817,926,555,156,1604,610,635,623,744,939,993,634,858,849,458,109,1538,739,855,834,1004,1355,968,811,1121,960,973,233,1662,894,966,859,946,1156,895,952,1078,689,621,587,1425,1022,1406,776,1105,2244,679,665,704,449,560,229,1158,908,1104,731,989,1308,757,896,917,844,815,401) > 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,] 2201 1604 1538 1662 1425 1158 NA [2,] 1239 610 739 894 1022 908 NA [3,] 966 635 855 966 1406 1104 NA [4,] 1001 623 834 859 776 731 NA [5,] 1079 744 1004 946 1105 989 NA [6,] 909 939 1355 1156 2244 1308 NA [7,] 1038 993 968 895 679 757 NA [8,] 817 634 811 952 665 896 NA [9,] 817 858 1121 1078 704 917 NA [10,] 926 849 960 689 449 844 NA [11,] 555 458 973 621 560 815 NA [12,] 156 109 233 587 229 401 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -962 -994 -799 -768 -403 -250 NA [2,] -273 25 116 72 384 196 NA [3,] 35 -12 -21 -107 -630 -373 NA [4,] 78 121 170 87 329 258 NA [5,] -170 195 351 210 1139 319 NA [6,] 129 54 -387 -261 -1565 -551 NA [7,] -221 -359 -157 57 -14 139 NA [8,] 0 224 310 126 39 21 NA [9,] 109 -9 -161 -389 -255 -73 NA [10,] -371 -391 13 -68 111 -29 NA [11,] -399 -349 -740 -34 -331 -414 NA [12,] 1448 1429 1429 838 929 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/1tssb1424699663.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/2joew1424699663.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/3os5k1424699663.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/4hust1424699663.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,] 1158 610 635 623 946.0 909 679.0 634 704.0 449.0 458.0 109 [2,] 1425 739 855 731 946.0 939 757.0 665 817.0 689.0 555.0 156 [3,] 1571 901 966 805 996.5 1232 931.5 814 887.5 846.5 590.5 231 [4,] 1662 1022 1104 859 1079.0 1355 993.0 896 1078.0 926.0 815.0 401 [5,] 1662 1239 1406 1001 1105.0 1355 1038.0 952 1121.0 960.0 973.0 587 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1418.127 718.4559 805.387 722.4359 910.7107 963.6666 779.2724 [2,] 1723.873 1083.5441 1126.613 887.5641 1082.2893 1500.3334 1083.7276 [,8] [,9] [,10] [,11] [,12] [1,] 664.9975 719.1466 693.6273 422.7916 72.96709 [2,] 963.0025 1055.8534 999.3727 758.2084 389.03291 $out [1] 2201 744 2244 $group [1] 1 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1158, 1425, 1571, 1662, 1662, 610, 739, 901, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52juh1424699663.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,] -994.0 25 -630 78.0 195.0 -551 -359.0 0.0 -389 -391.0 -414 838 [2,] -962.0 25 -373 87.0 195.0 -551 -221.0 21.0 -255 -371.0 -414 929 [3,] -783.5 94 -64 145.5 264.5 -324 -85.5 82.5 -117 -48.5 -374 1429 [4,] -403.0 196 -12 258.0 351.0 54 57.0 224.0 -9 13.0 -331 1429 [5,] -250.0 384 35 329.0 351.0 129 139.0 310.0 109 111.0 -331 1448 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1144.0731 -16.30052 -296.8567 35.19948 163.875 -714.24454 -264.81898 [2,] -422.9269 204.30052 168.8567 255.80052 365.125 66.24454 93.81898 [,8] [,9] [,10] [,11] [,12] [1,] -48.44156 -275.67795 -296.1924 -427.5377 1075.701 [2,] 213.44156 41.67795 199.1924 -320.4623 1782.299 $out [1] -273 -170 1139 -1565 -740 -34 $group [1] 2 5 5 6 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-994, -962, -783.5, -403, -250, 25, 25, 94, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6z7me1424699663.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,] 555.0 458.0 739.0 587.0 229.0 401.0 NA [2,] 817.0 616.5 822.5 774.0 612.5 786.0 NA [3,] 946.0 689.5 964.0 920.5 740.0 902.0 NA [4,] 1058.5 898.5 1062.5 1022.0 1255.5 1046.5 NA [5,] 1239.0 993.0 1355.0 1156.0 1425.0 1308.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 835.8502 560.8779 854.5344 807.3855 446.7234 783.1842 NA [2,] 1056.1498 818.1221 1073.4656 1033.6145 1033.2766 1020.8158 NA $out [1] 2201 156 1604 109 1538 233 1662 2244 $group [1] 1 1 2 2 3 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(555, 817, 946, 1058.5, 1239, 458, 616.5, 689.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72dwj1424699663.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,] 663.6667 590.50 661.3750 [2,] 791.0000 809.50 793.1875 [3,] 895.1667 894.25 887.3750 [4,] 983.2500 981.25 992.3125 [5,] 988.6667 1232.00 1168.2500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 807.4802 815.9137 796.5528 [2,] 982.8532 972.5863 978.1972 $out [1] 1598.0000 1318.5000 285.8333 1571.0000 231.0000 1550.3750 266.6250 $group [1] 1 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1tssb1424699663.ps tmp/1tssb1424699663.png",intern=TRUE)) character(0) > try(system("convert tmp/2joew1424699663.ps tmp/2joew1424699663.png",intern=TRUE)) character(0) > try(system("convert tmp/3os5k1424699663.ps tmp/3os5k1424699663.png",intern=TRUE)) character(0) > try(system("convert tmp/4hust1424699663.ps tmp/4hust1424699663.png",intern=TRUE)) character(0) > try(system("convert tmp/52juh1424699663.ps tmp/52juh1424699663.png",intern=TRUE)) character(0) > try(system("convert tmp/6z7me1424699663.ps tmp/6z7me1424699663.png",intern=TRUE)) character(0) > try(system("convert tmp/72dwj1424699663.ps tmp/72dwj1424699663.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.425 0.462 2.908