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(1053000,1014000,1072500,858000,1111500,1092000,1170000,1209000,1345500,1170000,1111500,1384500,1170000,877500,1033500,780000,1092000,897000,1189500,1072500,1131000,1267500,1248000,1482000,1072500,897000,994500,721500,1033500,799500,1131000,1072500,955500,1365000,1228500,1404000,1053000,975000,877500,721500,955500,858000,1170000,1131000,975000,1306500,1209000,1560000,1248000,760500,760500,760500,897000,897000,1209000,1111500,994500,1248000,1150500,1657500,1306500,760500,799500,663000,916500,1053000,1326000,1306500,1053000,1228500,1092000,1560000,1189500,955500,858000,643500,955500,1150500,1345500,1267500,936000,1345500,1053000,1618500,1345500,975000,897000,604500,955500,916500,1384500,1384500,1053000,1365000,1014000,1579500,1345500,994500,760500,526500,1033500,994500,1306500,1501500,1111500,1248000,936000,1618500) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1053000 1170000 1072500 1053000 1248000 1306500 1189500 1345500 1345500 [2,] 1014000 877500 897000 975000 760500 760500 955500 975000 994500 [3,] 1072500 1033500 994500 877500 760500 799500 858000 897000 760500 [4,] 858000 780000 721500 721500 760500 663000 643500 604500 526500 [5,] 1111500 1092000 1033500 955500 897000 916500 955500 955500 1033500 [6,] 1092000 897000 799500 858000 897000 1053000 1150500 916500 994500 [7,] 1170000 1189500 1131000 1170000 1209000 1326000 1345500 1384500 1306500 [8,] 1209000 1072500 1072500 1131000 1111500 1306500 1267500 1384500 1501500 [9,] 1345500 1131000 955500 975000 994500 1053000 936000 1053000 1111500 [10,] 1170000 1267500 1365000 1306500 1248000 1228500 1345500 1365000 1248000 [11,] 1111500 1248000 1228500 1209000 1150500 1092000 1053000 1014000 936000 [12,] 1384500 1482000 1404000 1560000 1657500 1560000 1618500 1579500 1618500 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -39000 -292500 -175500 -78000 -487500 -546000 -234000 -370500 -351000 [2,] 58500 156000 97500 -97500 0 39000 -97500 -78000 -234000 [3,] -214500 -253500 -273000 -156000 0 -136500 -214500 -292500 -234000 [4,] 253500 312000 312000 234000 136500 253500 312000 351000 507000 [5,] -19500 -195000 -234000 -97500 0 136500 195000 -39000 -39000 [6,] 78000 292500 331500 312000 312000 273000 195000 468000 312000 [7,] 39000 -117000 -58500 -39000 -97500 -19500 -78000 0 195000 [8,] 136500 58500 -117000 -156000 -117000 -253500 -331500 -331500 -390000 [9,] -175500 136500 409500 331500 253500 175500 409500 312000 136500 [10,] -58500 -19500 -136500 -97500 -97500 -136500 -292500 -351000 -312000 [11,] 273000 234000 175500 351000 507000 468000 565500 565500 682500 [12,] -214500 -409500 -351000 -312000 -351000 -370500 -273000 -234000 NA [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] 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/1hddr1439199148.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/2q0l71439199148.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/36fi31439199148.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/4zkzv1439199148.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,] 1053000 760500 760500 526500 897000 799500 1131000 1072500 936000 [2,] 1072500 877500 799500 643500 955500 897000 1170000 1111500 975000 [3,] 1189500 955500 877500 721500 955500 916500 1209000 1209000 1053000 [4,] 1306500 975000 994500 760500 1033500 1053000 1326000 1306500 1111500 [5,] 1345500 1014000 1072500 858000 1111500 1150500 1384500 1501500 1131000 [,10] [,11] [,12] [1,] 1170000 936000 1384500 [2,] 1248000 1053000 1482000 [3,] 1267500 1111500 1560000 [4,] 1345500 1209000 1618500 [5,] 1365000 1248000 1657500 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1066260 904150 774800 659880 914420 834340 1126840 1106300 981110 [2,] 1312740 1006850 980200 783120 996580 998660 1291160 1311700 1124890 [,10] [,11] [,12] [1,] 1216150 1029340 1488110 [2,] 1318850 1193660 1631890 $out [1] 1345500 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1053000, 1072500, 1189500, 1306500, 1345500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5t9uq1439199148.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] [1,] -546000 -234000 -292500 234000 -234000 273000 -117000 -390000 136500 [2,] -370500 -97500 -253500 253500 -97500 273000 -78000 -331500 136500 [3,] -292500 0 -214500 312000 -39000 312000 -39000 -156000 253500 [4,] -175500 58500 -156000 312000 0 312000 0 -117000 331500 [5,] -39000 156000 -136500 351000 136500 331500 39000 136500 409500 [,10] [,11] [,12] [1,] -351000 175500 -409500 [2,] -292500 273000 -360750 [3,] -136500 468000 -331500 [4,] -97500 565500 -253500 [5,] -19500 682500 -214500 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -395200 -82160 -265850 281190 -90350 291460 -80080 -268970 150800 -239200 [2,] -189800 82160 -163150 342810 12350 332540 2080 -43030 356200 -33800 [,11] [,12] [1,] 313950 -391411.4 [2,] 622050 -271588.6 $out [1] 0 136500 507000 195000 78000 195000 468000 195000 -175500 $group [1] 3 4 4 5 6 6 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-546000, -370500, -292500, -175500, -39000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66ffy1439199148.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] [,9] [1,] 1014000 780000 721500 721500 760500 663000 643500 604500 526500 [2,] 1062750 965250 926250 916500 828750 858000 945750 936000 965250 [3,] 1111500 1111500 1053000 1014000 1053000 1072500 1101750 1033500 1072500 [4,] 1189500 1218750 1179750 1189500 1228500 1306500 1306500 1374750 1326000 [5,] 1345500 1482000 1404000 1560000 1657500 1560000 1618500 1579500 1618500 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1053688 995876.9 937376.9 889482.9 870671.3 867936.1 937209.5 [2,] 1169312 1227123.1 1168623.1 1138517.1 1235328.7 1277063.9 1266290.5 [,8] [,9] [,10] [1,] 833383.2 907959.5 NA [2,] 1233616.8 1237040.5 NA $out [1] 858000 1384500 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(1014000, 1062750, 1111500, 1189500, 1345500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7zo9z1439199148.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,] 697666.7 721500 702000 [2,] 937083.3 936000 950625 [3,] 1088750.0 1082250 1087125 [4,] 1238250.0 1209000 1228500 [5,] 1540500.0 1560000 1550250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 951385.9 957732.9 960384.3 [2,] 1226114.1 1206767.1 1213865.7 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1hddr1439199148.ps tmp/1hddr1439199148.png",intern=TRUE)) character(0) > try(system("convert tmp/2q0l71439199148.ps tmp/2q0l71439199148.png",intern=TRUE)) character(0) > try(system("convert tmp/36fi31439199148.ps tmp/36fi31439199148.png",intern=TRUE)) character(0) > try(system("convert tmp/4zkzv1439199148.ps tmp/4zkzv1439199148.png",intern=TRUE)) character(0) > try(system("convert tmp/5t9uq1439199148.ps tmp/5t9uq1439199148.png",intern=TRUE)) character(0) > try(system("convert tmp/66ffy1439199148.ps tmp/66ffy1439199148.png",intern=TRUE)) character(0) > try(system("convert tmp/7zo9z1439199148.ps tmp/7zo9z1439199148.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.495 0.456 2.983