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(1263600,1216800,1287000,1029600,1333800,1310400,1404000,1450800,1614600,1404000,1333800,1661400,1404000,1053000,1240200,936000,1310400,1076400,1427400,1287000,1357200,1521000,1497600,1778400,1287000,1076400,1193400,865800,1240200,959400,1357200,1287000,1146600,1638000,1474200,1684800,1263600,1170000,1053000,865800,1146600,1029600,1404000,1357200,1170000,1567800,1450800,1872000,1497600,912600,912600,912600,1076400,1076400,1450800,1333800,1193400,1497600,1380600,1989000,1567800,912600,959400,795600,1099800,1263600,1591200,1567800,1263600,1474200,1310400,1872000,1427400,1146600,1029600,772200,1146600,1380600,1614600,1521000,1123200,1614600,1263600,1942200,1614600,1170000,1076400,725400,1146600,1099800,1661400,1661400,1263600,1638000,1216800,1895400,1614600,1193400,912600,631800,1240200,1193400,1567800,1801800,1333800,1497600,1123200,1942200) > 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,] 1263600 1404000 1287000 1263600 1497600 1567800 1427400 1614600 1614600 [2,] 1216800 1053000 1076400 1170000 912600 912600 1146600 1170000 1193400 [3,] 1287000 1240200 1193400 1053000 912600 959400 1029600 1076400 912600 [4,] 1029600 936000 865800 865800 912600 795600 772200 725400 631800 [5,] 1333800 1310400 1240200 1146600 1076400 1099800 1146600 1146600 1240200 [6,] 1310400 1076400 959400 1029600 1076400 1263600 1380600 1099800 1193400 [7,] 1404000 1427400 1357200 1404000 1450800 1591200 1614600 1661400 1567800 [8,] 1450800 1287000 1287000 1357200 1333800 1567800 1521000 1661400 1801800 [9,] 1614600 1357200 1146600 1170000 1193400 1263600 1123200 1263600 1333800 [10,] 1404000 1521000 1638000 1567800 1497600 1474200 1614600 1638000 1497600 [11,] 1333800 1497600 1474200 1450800 1380600 1310400 1263600 1216800 1123200 [12,] 1661400 1778400 1684800 1872000 1989000 1872000 1942200 1895400 1942200 [,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,] -46800 -351000 -210600 -93600 -585000 -655200 -280800 -444600 -421200 [2,] 70200 187200 117000 -117000 0 46800 -117000 -93600 -280800 [3,] -257400 -304200 -327600 -187200 0 -163800 -257400 -351000 -280800 [4,] 304200 374400 374400 280800 163800 304200 374400 421200 608400 [5,] -23400 -234000 -280800 -117000 0 163800 234000 -46800 -46800 [6,] 93600 351000 397800 374400 374400 327600 234000 561600 374400 [7,] 46800 -140400 -70200 -46800 -117000 -23400 -93600 0 234000 [8,] 163800 70200 -140400 -187200 -140400 -304200 -397800 -397800 -468000 [9,] -210600 163800 491400 397800 304200 210600 491400 374400 163800 [10,] -70200 -23400 -163800 -117000 -117000 -163800 -351000 -421200 -374400 [11,] 327600 280800 210600 421200 608400 561600 678600 678600 819000 [12,] -257400 -491400 -421200 -374400 -421200 -444600 -327600 -280800 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/1dnkj1436883975.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/2an8t1436883975.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/3sg9e1436883975.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/4tkje1436883975.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,] 1263600 912600 912600 631800 1076400 959400 1357200 1287000 1123200 [2,] 1287000 1053000 959400 772200 1146600 1076400 1404000 1333800 1170000 [3,] 1427400 1146600 1053000 865800 1146600 1099800 1450800 1450800 1263600 [4,] 1567800 1170000 1193400 912600 1240200 1263600 1591200 1567800 1333800 [5,] 1614600 1216800 1287000 1029600 1333800 1380600 1661400 1801800 1357200 [,10] [,11] [,12] [1,] 1404000 1123200 1661400 [2,] 1497600 1263600 1778400 [3,] 1521000 1333800 1872000 [4,] 1614600 1450800 1942200 [5,] 1638000 1497600 1989000 $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,] 1279512 1084980 929760 791856 1097304 1001208 1352208 1327560 1177332 [2,] 1575288 1208220 1176240 939744 1195896 1198392 1549392 1574040 1349868 [,10] [,11] [,12] [1,] 1459380 1235208 1785732 [2,] 1582620 1432392 1958268 $out [1] 1614600 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1263600, 1287000, 1427400, 1567800, 1614600, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hjeq1436883975.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,] -655200 -280800 -351000 280800 -280800 327600 -140400 -468000 163800 [2,] -444600 -117000 -304200 304200 -117000 327600 -93600 -397800 163800 [3,] -351000 0 -257400 374400 -46800 374400 -46800 -187200 304200 [4,] -210600 70200 -187200 374400 0 374400 0 -140400 397800 [5,] -46800 187200 -163800 421200 163800 397800 46800 163800 491400 [,10] [,11] [,12] [1,] -421200 210600 -491400 [2,] -351000 327600 -432900 [3,] -163800 561600 -397800 [4,] -117000 678600 -304200 [5,] -23400 819000 -257400 $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,] -474240 -98592 -319020 337428 -108420 349752 -96096 -322764 180960 -287040 [2,] -227760 98592 -195780 411372 14820 399048 2496 -51636 427440 -40560 [,11] [,12] [1,] 376740 -469693.7 [2,] 746460 -325906.3 $out [1] 0 163800 608400 234000 93600 234000 561600 234000 -210600 $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(-655200, -444600, -351000, -210600, -46800, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60e8f1436883975.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,] 1216800 936000 865800 865800 912600 795600 772200 725400 631800 [2,] 1275300 1158300 1111500 1099800 994500 1029600 1134900 1123200 1158300 [3,] 1333800 1333800 1263600 1216800 1263600 1287000 1322100 1240200 1287000 [4,] 1427400 1462500 1415700 1427400 1474200 1567800 1567800 1649700 1591200 [5,] 1614600 1778400 1684800 1872000 1989000 1872000 1942200 1895400 1942200 [,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] [,8] [,9] [1,] 1264426 1195052 1124852 1067379 1044806 1041523 1124651 1000060 1089551 [2,] 1403174 1472548 1402348 1366221 1482394 1532477 1519549 1480340 1484449 [,10] [1,] NA [2,] NA $out [1] 1029600 1661400 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(1216800, 1275300, 1333800, 1427400, 1614600, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ct0g1436883975.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,] 837200 865800 842400 [2,] 1124500 1123200 1140750 [3,] 1306500 1298700 1304550 [4,] 1485900 1450800 1474200 [5,] 1848600 1872000 1860300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1141663 1149279 1152461 [2,] 1471337 1448121 1456639 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1dnkj1436883975.ps tmp/1dnkj1436883975.png",intern=TRUE)) character(0) > try(system("convert tmp/2an8t1436883975.ps tmp/2an8t1436883975.png",intern=TRUE)) character(0) > try(system("convert tmp/3sg9e1436883975.ps tmp/3sg9e1436883975.png",intern=TRUE)) character(0) > try(system("convert tmp/4tkje1436883975.ps tmp/4tkje1436883975.png",intern=TRUE)) character(0) > try(system("convert tmp/5hjeq1436883975.ps tmp/5hjeq1436883975.png",intern=TRUE)) character(0) > try(system("convert tmp/60e8f1436883975.ps tmp/60e8f1436883975.png",intern=TRUE)) character(0) > try(system("convert tmp/7ct0g1436883975.ps tmp/7ct0g1436883975.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.358 0.449 2.845