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(1165010 + ,1160665 + ,1156265 + ,1147162.5 + ,1237238.75 + ,1232481.25 + ,1165010 + ,1120157.5 + ,1124488.75 + ,1124488.75 + ,1129328.75 + ,1138005 + ,1151507.5 + ,1151507.5 + ,1142831.25 + ,1120157.5 + ,1237238.75 + ,1255086.25 + ,1228136.25 + ,1165010 + ,1192015 + ,1151507.5 + ,1169781.25 + ,1178512.5 + ,1187615 + ,1165010 + ,1169781.25 + ,1138005 + ,1237238.75 + ,1268588.75 + ,1241638.75 + ,1192015 + ,1245983.75 + ,1187615 + ,1241638.75 + ,1237238.75 + ,1250755 + ,1201131.25 + ,1255086.25 + ,1250755 + ,1331715 + ,1313441.25 + ,1241638.75 + ,1205462.5 + ,1255086.25 + ,1187615 + ,1237238.75 + ,1245983.75 + ,1264257.5 + ,1223805 + ,1245983.75 + ,1259486.25 + ,1309110 + ,1268588.75 + ,1214633.75 + ,1156265 + ,1210288.75 + ,1061788.75 + ,1133660 + ,1174112.5 + ,1214633.75 + ,1156265 + ,1156265 + ,1156265 + ,1187615 + ,1142831.25 + ,1084036.25 + ,1034838.75 + ,1070533.75 + ,931205 + ,1016578.75 + ,1066188.75 + ,1075305 + ,1025681.25 + ,1030012.5 + ,1016578.75 + ,1061788.75 + ,1030012.5 + ,967381.25 + ,922102.5 + ,998662.5 + ,832383.75 + ,940362.5 + ,989560 + ,989560 + ,931205 + ,877236.25 + ,872905 + ,922102.5 + ,877236.25 + ,791931.25 + ,733136.25 + ,796276.25 + ,647831.25 + ,782760 + ,854562.5 + ,877236.25 + ,827626.25 + ,764926.25 + ,809778.75 + ,827626.25 + ,814110 + ,679126.25 + ,616481.25 + ,661278.75 + ,526350 + ,665678.75 + ,715302.5 + ,755755 + ,688283.75 + ,625157.5 + ,661278.75 + ,679126.25 + ,643431.25 + ,508502.5 + ,449707.5 + ,503676.25 + ,355231.25 + ,517178.75 + ,616481.25) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1165010 1151508 1187615 1250755 1264258 1214634 1075305.0 989560.0 [2,] 1160665 1151508 1165010 1201131 1223805 1156265 1025681.2 931205.0 [3,] 1156265 1142831 1169781 1255086 1245984 1156265 1030012.5 877236.2 [4,] 1147162 1120158 1138005 1250755 1259486 1156265 1016578.8 872905.0 [5,] 1237239 1237239 1237239 1331715 1309110 1187615 1061788.8 922102.5 [6,] 1232481 1255086 1268589 1313441 1268589 1142831 1030012.5 877236.2 [7,] 1165010 1228136 1241639 1241639 1214634 1084036 967381.2 791931.2 [8,] 1120158 1165010 1192015 1205462 1156265 1034839 922102.5 733136.2 [9,] 1124489 1192015 1245984 1255086 1210289 1070534 998662.5 796276.2 [10,] 1124489 1151508 1187615 1187615 1061789 931205 832383.8 647831.2 [11,] 1129329 1169781 1241639 1237239 1133660 1016579 940362.5 782760.0 [12,] 1138005 1178512 1237239 1245984 1174112 1066189 989560.0 854562.5 [,9] [,10] [,11] [1,] 877236.2 755755.0 NA [2,] 827626.2 688283.8 NA [3,] 764926.2 625157.5 NA [4,] 809778.8 661278.8 NA [5,] 827626.2 679126.2 NA [6,] 814110.0 643431.2 NA [7,] 679126.2 508502.5 NA [8,] 616481.2 449707.5 NA [9,] 661278.8 503676.2 NA [10,] 526350.0 355231.2 NA [11,] 665678.8 517178.8 NA [12,] 715302.5 616481.2 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -4345.00 0.00 -22605.00 -49623.75 -40452.50 -58368.75 -49623.75 [2,] -4400.00 -8676.25 4771.25 53955.00 22178.75 0.00 4331.25 [3,] -9102.50 -22673.75 -31776.25 -4331.25 13502.50 0.00 -13433.75 [4,] 90076.25 117081.25 99233.75 80960.00 49623.75 31350.00 45210.00 [5,] -4757.50 17847.50 31350.00 -18273.75 -40521.25 -44783.75 -31776.25 [6,] -67471.25 -26950.00 -26950.00 -71802.50 -53955.00 -58795.00 -62631.25 [7,] -44852.50 -63126.25 -49623.75 -36176.25 -58368.75 -49197.50 -45278.75 [8,] 4331.25 27005.00 53968.75 49623.75 54023.75 35695.00 76560.00 [9,] 0.00 -40507.50 -58368.75 -67471.25 -148500.00 -139328.75 -166278.75 [10,] 4840.00 18273.75 54023.75 49623.75 71871.25 85373.75 107978.75 [11,] 8676.25 8731.25 -4400.00 8745.00 40452.50 49610.00 49197.50 [12,] 13502.50 9102.50 13516.25 18273.75 40521.25 9116.25 0.00 [,8] [,9] [,10] [,11] [1,] -58355.00 -49610.00 -67471.25 NA [2,] -53968.75 -62700.00 -63126.25 NA [3,] -4331.25 44852.50 36121.25 NA [4,] 49197.50 17847.50 17847.50 NA [5,] -44866.25 -13516.25 -35695.00 NA [6,] -85305.00 -134983.75 -134928.75 NA [7,] -58795.00 -62645.00 -58795.00 NA [8,] 63140.00 44797.50 53968.75 NA [9,] -148445.00 -134928.75 -148445.00 NA [10,] 134928.75 139328.75 161947.50 NA [11,] 71802.50 49623.75 99302.50 NA [12,] 22673.75 40452.50 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/1qu441376997722.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/264vd1376997722.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/3fvi71376997722.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/4zbq11376997722.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] [1,] 755755 688283.8 625157.5 661278.8 679126.2 643431.2 508502.5 [2,] 989560 931205.0 877236.2 872905.0 922102.5 877236.2 791931.2 [3,] 1158259 1153886.2 1149548.1 1129081.2 1212426.9 1187656.2 1124523.1 [4,] 1214634 1165010.0 1169781.2 1156265.0 1237238.8 1268588.8 1228136.2 [5,] 1264258 1223805.0 1255086.2 1259486.2 1331715.0 1313441.2 1241638.8 [,8] [,9] [,10] [,11] [,12] [1,] 449707.5 503676.2 355231.2 517178.8 616481.2 [2,] 733136.2 796276.2 647831.2 782760.0 854562.5 [3,] 1077498.1 1097511.2 996496.9 1072953.8 1102096.9 [4,] 1165010.0 1210288.8 1151507.5 1169781.2 1178512.5 [5,] 1205462.5 1255086.2 1187615.0 1241638.8 1245983.8 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1045803 1037068 1003381 987503.3 1054972 992120.9 906577.7 861716.8 [2,] 1270715 1270705 1295715 1270659.2 1369882 1383191.6 1342468.5 1293279.5 [,9] [,10] [,11] [,12] [1,] 890654.1 744840.1 879582.5 940238.5 [2,] 1304368.4 1248153.6 1266325.0 1263955.2 $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(755755, 989560, 1158258.75, 1214633.75, 1264257.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5k6go1376997722.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] [1,] -67471.25 -63126.25 -31776.25 17847.50 -44866.25 -85305.00 -63126.25 [2,] -58355.00 -53968.75 -13433.75 31350.00 -40521.25 -85305.00 -58795.00 [3,] -49616.88 -2200.00 -4331.25 49410.62 -25025.00 -65051.25 -53996.25 [4,] -22605.00 4771.25 13502.50 90076.25 -4757.50 -53955.00 -45278.75 [5,] 0.00 53955.00 44852.50 117081.25 31350.00 -26950.00 -36176.25 [,8] [,9] [,10] [,11] [,12] [1,] 27005.00 -166278.75 4840.00 -4400.00 0.00 [2,] 35695.00 -148445.00 49623.75 8731.25 9116.25 [3,] 51796.25 -137128.75 78622.50 44825.00 13516.25 [4,] 54023.75 -58368.75 134928.75 49623.75 22673.75 [5,] 76560.00 0.00 161947.50 99302.50 40521.25 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -67479.00 -31548.85 -17789.674 20068.65 -42893.995 -80714.96 -60749.51 [2,] -31754.75 27148.85 9127.174 78752.60 -7156.005 -49387.54 -47242.99 [,8] [,9] [,10] [,11] [,12] [1,] 42638.48 -182134.44 36000.72 24393.48 6375.967 [2,] 60954.02 -92123.06 121244.28 65256.52 20656.533 $out [1] -134983.75 -134928.75 4331.25 $group [1] 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-67471.25, -58355, -49616.875, -22605, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6r5xs1376997722.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,] 1120158 1120158 1138005 1187615 1061789 931205 922102.5 647831.2 [2,] 1126909 1151508 1178698 1221351 1165189 1050514 953871.9 787345.6 [3,] 1151714 1167396 1214627 1248369 1219219 1113434 1007620.6 863733.8 [4,] 1165010 1210076 1241639 1255086 1261872 1156265 1030012.5 899669.4 [5,] 1165010 1255086 1268589 1255086 1309110 1214634 1075305.0 989560.0 [,9] [,10] [,11] [1,] 526350.0 355231.2 NA [2,] 663478.8 506089.4 NA [3,] 740114.4 620819.4 NA [4,] 820868.1 670202.5 NA [5,] 877236.2 755755.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1134336 1140682 1185919 1232982 1175122 1065200 972892.4 812502.1 [2,] 1169092 1194109 1243335 1263756 1263317 1161668 1042348.9 914965.4 [,9] [,10] [,11] [1,] 668328.0 545966.3 NA [2,] 811900.7 695672.5 NA $out [1] 1237238.8 1232481.2 1331715.0 1313441.2 832383.8 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(1120157.5, 1126908.75, 1151713.75, 1165010, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7sfed1376997722.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,] 900601.6 996496.9 919361.1 [2,] 994624.8 1087504.7 1008876.2 [3,] 1031974.6 1126802.2 1032134.3 [4,] 1068849.4 1156072.5 1074847.8 [5,] 1103080.0 1212426.9 1109437.7 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 998120.3 1095528 1002044 [2,] 1065828.9 1158076 1062224 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(900601.625, 994624.8125, 1031974.625, 1068849.375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qu441376997722.ps tmp/1qu441376997722.png",intern=TRUE)) character(0) > try(system("convert tmp/264vd1376997722.ps tmp/264vd1376997722.png",intern=TRUE)) character(0) > try(system("convert tmp/3fvi71376997722.ps tmp/3fvi71376997722.png",intern=TRUE)) character(0) > try(system("convert tmp/4zbq11376997722.ps tmp/4zbq11376997722.png",intern=TRUE)) character(0) > try(system("convert tmp/5k6go1376997722.ps tmp/5k6go1376997722.png",intern=TRUE)) character(0) > try(system("convert tmp/6r5xs1376997722.ps tmp/6r5xs1376997722.png",intern=TRUE)) character(0) > try(system("convert tmp/7sfed1376997722.ps tmp/7sfed1376997722.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.243 1.264 6.491