R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing 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(530.3,527.76,521.41,1601.93,1577.49,1551.43,1551.43,1516.88,1485.95,1438.22,1385.06,1329.49,1329.49,1276.16,1242.34,1181.59,1160.21,1135.18,1135.18,1084.96,1077.35,1061.13,1029.98,1013.08,1013.08,996.04,975.02,951.89,944.4,932.47,932.47,920.44,900.18,886.9,867.74,859.03,859.03,844.99,834.82,825.62,816.92,813.21,813.21,811.03,804.16,788.62,778.76,765.91,765.91,753.85,742.22,732.11,729.94,731.22,731.22,729.11,726.94,720.52,709.36,703.21,703.21,695.88,681.63,672.1,665.49,658.93,658.93,656,650.66,645.93,638.74,634.67) > 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,] 530.30 1329.49 1013.08 859.03 765.91 703.21 NA [2,] 527.76 1276.16 996.04 844.99 753.85 695.88 NA [3,] 521.41 1242.34 975.02 834.82 742.22 681.63 NA [4,] 1601.93 1181.59 951.89 825.62 732.11 672.10 NA [5,] 1577.49 1160.21 944.40 816.92 729.94 665.49 NA [6,] 1551.43 1135.18 932.47 813.21 731.22 658.93 NA [7,] 1551.43 1135.18 932.47 813.21 731.22 658.93 NA [8,] 1516.88 1084.96 920.44 811.03 729.11 656.00 NA [9,] 1485.95 1077.35 900.18 804.16 726.94 650.66 NA [10,] 1438.22 1061.13 886.90 788.62 720.52 645.93 NA [11,] 1385.06 1029.98 867.74 778.76 709.36 638.74 NA [12,] 1329.49 1013.08 859.03 765.91 703.21 634.67 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.54 -53.33 -17.04 -14.04 -12.06 -7.33 NA [2,] -6.35 -33.82 -21.02 -10.17 -11.63 -14.25 NA [3,] 1080.52 -60.75 -23.13 -9.20 -10.11 -9.53 NA [4,] -24.44 -21.38 -7.49 -8.70 -2.17 -6.61 NA [5,] -26.06 -25.03 -11.93 -3.71 1.28 -6.56 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] -34.55 -50.22 -12.03 -2.18 -2.11 -2.93 NA [8,] -30.93 -7.61 -20.26 -6.87 -2.17 -5.34 NA [9,] -47.73 -16.22 -13.28 -15.54 -6.42 -4.73 NA [10,] -53.16 -31.15 -19.16 -9.86 -11.16 -7.19 NA [11,] -55.57 -16.90 -8.71 -12.85 -6.15 -4.07 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/wessaorg/rcomp/tmp/107ot1369598541.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/2sg1k1369598541.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/395rh1369598541.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/422mw1369598541.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,] 530.30 527.76 521.41 672.100 665.49 658.93 658.93 656.000 650.66 [2,] 703.21 695.88 681.63 732.110 729.94 731.22 731.22 729.110 726.94 [3,] 812.47 799.42 788.52 888.755 880.66 872.84 872.84 865.735 852.17 [4,] 1013.08 996.04 975.02 1181.590 1160.21 1135.18 1135.18 1084.960 1077.35 [5,] 1329.49 1276.16 1242.34 1601.930 1577.49 1551.43 1551.43 1516.880 1485.95 [,10] [,11] [,12] [1,] 645.93 638.74 634.67 [2,] 720.52 709.36 703.21 [3,] 837.76 823.25 812.47 [4,] 1061.13 1029.98 1013.08 [5,] 1438.22 1385.06 1329.49 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 612.5938 605.8071 599.274 598.8259 603.122 612.2728 612.2728 [2,] 1012.3462 993.0329 977.766 1178.6841 1158.198 1133.4072 1133.4072 [,8] [,9] [,10] [,11] [,12] [1,] 636.2003 626.1442 618.0555 616.4397 612.5938 [2,] 1095.2697 1078.1958 1057.4645 1030.0603 1012.3462 $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(530.3, 703.21, 812.47, 1013.08, 1329.49, 527.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50ioz1369598541.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] [1,] -17.04 -33.82 -23.13 -24.440 -26.060 0 -50.22 -30.93 -16.22 -53.16 [2,] -17.04 -21.02 -23.13 -21.380 -25.030 0 -34.55 -20.26 -16.22 -31.15 [3,] -13.05 -12.94 -9.82 -8.095 -9.245 0 -7.48 -7.24 -14.41 -15.16 [4,] -7.33 -10.17 -9.20 -6.610 -3.710 0 -2.18 -5.34 -6.42 -9.86 [5,] -2.54 -6.35 -9.20 -2.170 1.280 0 -2.11 -2.17 -4.73 -7.19 [,11] [,12] [1,] -16.90 0 [2,] -16.90 0 [3,] -10.78 0 [4,] -6.15 0 [5,] -4.07 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -19.313264 -19.9386 -18.8052999 -17.622127 -22.997089 0 -28.3597 [2,] -6.786736 -5.9414 -0.8347001 1.432127 4.507089 0 13.3997 [,8] [,9] [,10] [,11] [,12] [1,] -16.863882 -20.731317 -28.892738 -17.714097 0 [2,] 2.383882 -8.088683 -1.427262 -3.845903 0 $out [1] -53.33 1080.52 -60.75 -47.73 -55.57 $group [1] 1 3 3 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-17.0400000000001, -17.0400000000001, -13.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6wdqo1369598541.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,] 521.410 1013.080 859.030 765.91 709.360 634.670 NA [2,] 929.895 1069.240 893.540 796.39 723.730 648.295 NA [3,] 1462.085 1135.180 932.470 813.21 730.580 658.930 NA [4,] 1551.430 1211.965 963.455 830.22 737.165 676.865 NA [5,] 1601.930 1329.490 1013.080 859.03 753.850 703.210 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1178.599 1070.082 900.5813 797.7799 724.4522 645.899 NA [2,] 1745.571 1200.278 964.3587 828.6401 736.7078 671.961 NA $out [1] 765.91 703.21 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(521.41, 929.895, 1462.085, 1551.43, 1601.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7p8e91369598541.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,] 832.9067 788.520 818.3737 [2,] 875.5342 812.470 846.7263 [3,] 932.2133 844.965 883.6050 [4,] 970.4067 872.840 918.1100 [5,] 994.2067 888.755 939.8262 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 888.9413 817.4298 851.0464 [2,] 975.4853 872.5002 916.1636 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(832.906666666667, 875.534166666667, 932.213333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/107ot1369598541.ps tmp/107ot1369598541.png",intern=TRUE)) character(0) > try(system("convert tmp/2sg1k1369598541.ps tmp/2sg1k1369598541.png",intern=TRUE)) character(0) > try(system("convert tmp/395rh1369598541.ps tmp/395rh1369598541.png",intern=TRUE)) character(0) > try(system("convert tmp/422mw1369598541.ps tmp/422mw1369598541.png",intern=TRUE)) character(0) > try(system("convert tmp/50ioz1369598541.ps tmp/50ioz1369598541.png",intern=TRUE)) character(0) > try(system("convert tmp/6wdqo1369598541.ps tmp/6wdqo1369598541.png",intern=TRUE)) character(0) > try(system("convert tmp/7p8e91369598541.ps tmp/7p8e91369598541.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.479 0.945 5.422