R version 2.15.2 (2012-10-26) -- "Trick or Treat" 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(547084.00,639842.00,770730.00,911599.00,971249.00,925102.00,906046.00,1006991.00,1013942.00,991188.00,819356.00,793778.00,601962.00,685640.00,785923.00,954888.00,1029140.00,972811.00,951330.00,1012865.00,1005502.00,987489.00,828421.00,817308.00,625827.00,683491.00,848657.00,978027.00,1019467.00,980306.00,992574.00,1080411.00,1047988.00,1023560.00,871245.00,824793.00,645999.00,736888.00,874488.00,992614.00,1107708.00,955938.00,1024122.00,1081598.00,1028158.00,1006457.00,826725.00,839116.00,591481.00,671244.00,788395.00,912291.00,987428.00,873452.00,952046.00,1037521.00,958597.00,965368.00,780741.00,814377.00,594739.00,668940.00,815882.00,928023.00,1025552.00,945840.00,1020639.00,1109899.00,1033403.00,1050530.00,840420.00,820378.00,609379.00,678402.00,889241.00,998445.00,1054502.00,1076699.00,1093802.00,1134793.00,1054084.00,1068675.00,857337.00,855380.00) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 547084 601962 625827 645999 591481 594739 609379 NA [2,] 639842 685640 683491 736888 671244 668940 678402 NA [3,] 770730 785923 848657 874488 788395 815882 889241 NA [4,] 911599 954888 978027 992614 912291 928023 998445 NA [5,] 971249 1029140 1019467 1107708 987428 1025552 1054502 NA [6,] 925102 972811 980306 955938 873452 945840 1076699 NA [7,] 906046 951330 992574 1024122 952046 1020639 1093802 NA [8,] 1006991 1012865 1080411 1081598 1037521 1109899 1134793 NA [9,] 1013942 1005502 1047988 1028158 958597 1033403 1054084 NA [10,] 991188 987489 1023560 1006457 965368 1050530 1068675 NA [11,] 819356 828421 871245 826725 780741 840420 857337 NA [12,] 793778 817308 824793 839116 814377 820378 855380 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 92758 83678 57664 90889 79763 74201 69023 NA [2,] 130888 100283 165166 137600 117151 146942 210839 NA [3,] 140869 168965 129370 118126 123896 112141 109204 NA [4,] 59650 74252 41440 115094 75137 97529 56057 NA [5,] -46147 -56329 -39161 -151770 -113976 -79712 22197 NA [6,] -19056 -21481 12268 68184 78594 74799 17103 NA [7,] 100945 61535 87837 57476 85475 89260 40991 NA [8,] 6951 -7363 -32423 -53440 -78924 -76496 -80709 NA [9,] -22754 -18013 -24428 -21701 6771 17127 14591 NA [10,] -171832 -159068 -152315 -179732 -184627 -210110 -211338 NA [11,] -25578 -11113 -46452 12391 33636 -20042 -1957 NA [12,] -191816 -191481 -178794 -247635 -219638 -210999 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/1p24d1362654081.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/20p8v1362654081.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/3osvv1362654081.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/4s0dt1362654081.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,] 591481 668940.0 770730.0 911599.0 971249 925102.0 906046 1006991 1005502 [2,] 593110 670092.0 787159.0 920157.0 1003448 935471.0 951688 1025193 1009722 [3,] 601962 678402.0 815882.0 954888.0 1025552 955938.0 992574 1080411 1028158 [4,] 617603 684565.5 861572.5 985320.5 1041821 976558.5 1022380 1095748 1040696 [5,] 645999 685640.0 889241.0 998445.0 1054502 980306.0 1093802 1134793 1054084 [,10] [,11] [,12] [1,] 965368.0 819356.0 793778.0 [2,] 989338.5 823040.5 815842.5 [3,] 1006457.0 828421.0 820378.0 [4,] 1037045.0 848878.5 831954.5 [5,] 1068675.0 871245.0 855380.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 587335.2 669758.7 771443.5 915973.4 1002636 931401.2 950357.6 1038276 [2,] 616588.8 687045.3 860320.5 993802.6 1048468 980474.8 1034790.4 1122546 [,9] [,10] [,11] [,12] [1,] 1009661 977967.4 812991 810756.2 [2,] 1046655 1034946.6 843851 829999.8 $out [1] 547084 639842 736888 1107708 873452 1076699 958597 780741 $group [1] 1 2 2 5 6 6 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(591481, 593110, 601962, 617603, 645999, 668940, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5shxy1362654081.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] [1,] 57664.0 100283.0 109204.0 41440.0 -151770 -21481.0 40991.0 -80709 [2,] 71612.0 124019.5 115133.5 57853.5 -96844 -3394.0 59505.5 -77710 [3,] 79763.0 137600.0 123896.0 74252.0 -56329 17103.0 85475.0 -53440 [4,] 87283.5 156054.0 135119.5 86333.0 -42654 71491.5 88548.5 -19893 [5,] 92758.0 165166.0 140869.0 115094.0 22197 78594.0 100945.0 6951 [,9] [,10] [,11] [,12] [1,] -24428.0 -211338.0 -46452 -247635.0 [2,] -22227.5 -197368.5 -22810 -219638.0 [3,] -18013.0 -179732.0 -11113 -201407.5 [4,] 10681.0 -165450.0 5217 -191481.0 [5,] 17127.0 -152315.0 33636 -178794.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 70404.23 118469.5 111960.7 57244.5 -88690.39 -27617.41 68130.99 -87967.38 [2,] 89121.77 156730.5 135831.3 91259.5 -23967.61 61823.41 102819.01 -18912.62 [,9] [,10] [,11] [,12] [1,] -37665.425 -198793.2 -27850.272 -219569.7 [2,] 1639.425 -160670.8 5624.272 -183245.3 $out [1] 210839 168965 $group [1] 2 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(57664, 71612, 79763, 87283.5, 92758, 100283, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67m7q1362654081.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] [1,] 547084.0 601962.0 625827.0 645999.0 591481.0 594739.0 609379.0 NA [2,] 782254.0 801615.5 836725.0 832920.5 784568.0 818130.0 856358.5 NA [3,] 908822.5 953109.0 979166.5 974276.0 892871.5 936931.5 1026264.5 NA [4,] 981218.5 996495.5 1021513.5 1026140.0 961982.5 1029477.5 1072687.0 NA [5,] 1013942.0 1029140.0 1080411.0 1107708.0 1037521.0 1109899.0 1134793.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 818073.5 864222.9 894883.2 886147.3 811951.6 840534.5 927595.6 NA [2,] 999571.5 1041995.1 1063449.8 1062404.7 973791.4 1033328.5 1124933.4 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(547084, 782254, 908822.5, 981218.5, 1013942, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7awa81362654081.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,] 602353.0 601962 605356.5 [2,] 824174.7 818130 824132.1 [3,] 957573.9 955413 954376.8 [4,] 1016781.5 1016004 1017913.0 [5,] 1066296.9 1080411 1060470.8 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 869724.7 865161.1 865992 [2,] 1045423.2 1045664.9 1042762 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(602353, 824174.714285714, 957573.928571429, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1p24d1362654081.ps tmp/1p24d1362654081.png",intern=TRUE)) character(0) > try(system("convert tmp/20p8v1362654081.ps tmp/20p8v1362654081.png",intern=TRUE)) character(0) > try(system("convert tmp/3osvv1362654081.ps tmp/3osvv1362654081.png",intern=TRUE)) character(0) > try(system("convert tmp/4s0dt1362654081.ps tmp/4s0dt1362654081.png",intern=TRUE)) character(0) > try(system("convert tmp/5shxy1362654081.ps tmp/5shxy1362654081.png",intern=TRUE)) character(0) > try(system("convert tmp/67m7q1362654081.ps tmp/67m7q1362654081.png",intern=TRUE)) character(0) > try(system("convert tmp/7awa81362654081.ps tmp/7awa81362654081.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.365 0.578 3.926