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(982800,946400,1001000,800800,1037400,1019200,1092000,1128400,1255800,1092000,1037400,1292200,1092000,819000,964600,728000,1019200,837200,1110200,1001000,1055600,1183000,1164800,1383200,1001000,837200,928200,673400,964600,746200,1055600,1001000,891800,1274000,1146600,1310400,982800,910000,819000,673400,891800,800800,1092000,1055600,910000,1219400,1128400,1456000,1164800,709800,709800,709800,837200,837200,1128400,1037400,928200,1164800,1073800,1547000,1219400,709800,746200,618800,855400,982800,1237600,1219400,982800,1146600,1019200,1456000,1110200,891800,800800,600600,891800,1073800,1255800,1183000,873600,1255800,982800,1510600,1255800,910000,837200,564200,891800,855400,1292200,1292200,982800,1274000,946400,1474200,1255800,928200,709800,491400,964600,928200,1219400,1401400,1037400,1164800,873600,1510600) > 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,] 982800 1092000 1001000 982800 1164800 1219400 1110200 1255800 1255800 [2,] 946400 819000 837200 910000 709800 709800 891800 910000 928200 [3,] 1001000 964600 928200 819000 709800 746200 800800 837200 709800 [4,] 800800 728000 673400 673400 709800 618800 600600 564200 491400 [5,] 1037400 1019200 964600 891800 837200 855400 891800 891800 964600 [6,] 1019200 837200 746200 800800 837200 982800 1073800 855400 928200 [7,] 1092000 1110200 1055600 1092000 1128400 1237600 1255800 1292200 1219400 [8,] 1128400 1001000 1001000 1055600 1037400 1219400 1183000 1292200 1401400 [9,] 1255800 1055600 891800 910000 928200 982800 873600 982800 1037400 [10,] 1092000 1183000 1274000 1219400 1164800 1146600 1255800 1274000 1164800 [11,] 1037400 1164800 1146600 1128400 1073800 1019200 982800 946400 873600 [12,] 1292200 1383200 1310400 1456000 1547000 1456000 1510600 1474200 1510600 [,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,] -36400 -273000 -163800 -72800 -455000 -509600 -218400 -345800 -327600 [2,] 54600 145600 91000 -91000 0 36400 -91000 -72800 -218400 [3,] -200200 -236600 -254800 -145600 0 -127400 -200200 -273000 -218400 [4,] 236600 291200 291200 218400 127400 236600 291200 327600 473200 [5,] -18200 -182000 -218400 -91000 0 127400 182000 -36400 -36400 [6,] 72800 273000 309400 291200 291200 254800 182000 436800 291200 [7,] 36400 -109200 -54600 -36400 -91000 -18200 -72800 0 182000 [8,] 127400 54600 -109200 -145600 -109200 -236600 -309400 -309400 -364000 [9,] -163800 127400 382200 309400 236600 163800 382200 291200 127400 [10,] -54600 -18200 -127400 -91000 -91000 -127400 -273000 -327600 -291200 [11,] 254800 218400 163800 327600 473200 436800 527800 527800 637000 [12,] -200200 -382200 -327600 -291200 -327600 -345800 -254800 -218400 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/10unj1439043784.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/2ybec1439043784.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/3iyeq1439043784.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/4ixgn1439043784.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,] 982800 709800 709800 491400 837200 746200 1055600 1001000 873600 [2,] 1001000 819000 746200 600600 891800 837200 1092000 1037400 910000 [3,] 1110200 891800 819000 673400 891800 855400 1128400 1128400 982800 [4,] 1219400 910000 928200 709800 964600 982800 1237600 1219400 1037400 [5,] 1255800 946400 1001000 800800 1037400 1073800 1292200 1401400 1055600 [,10] [,11] [,12] [1,] 1092000 873600 1292200 [2,] 1164800 982800 1383200 [3,] 1183000 1037400 1456000 [4,] 1255800 1128400 1510600 [5,] 1274000 1164800 1547000 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 995176 843873.3 723146.7 615888 853458.7 778717.3 1051717 1032547 [2,] 1225224 939726.7 914853.3 730912 930141.3 932082.7 1205083 1224253 [,9] [,10] [,11] [,12] [1,] 915702.7 1135073 960717.3 1388903 [2,] 1049897.3 1230927 1114082.7 1523097 $out [1] 1255800 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(982800, 1001000, 1110200, 1219400, 1255800, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5eiqd1439043784.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,] -509600 -218400 -273000 218400 -218400 254800 -109200 -364000 127400 [2,] -345800 -91000 -236600 236600 -91000 254800 -72800 -309400 127400 [3,] -273000 0 -200200 291200 -36400 291200 -36400 -145600 236600 [4,] -163800 54600 -145600 291200 0 291200 0 -109200 309400 [5,] -36400 145600 -127400 327600 127400 309400 36400 127400 382200 [,10] [,11] [,12] [1,] -327600 163800 -382200 [2,] -273000 254800 -336700 [3,] -127400 436800 -309400 [4,] -91000 527800 -236600 [5,] -18200 637000 -200200 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -368853.3 -76682.67 -248126.7 262444 -84326.67 272029.3 -74741.333 [2,] -177146.7 76682.67 -152273.3 319956 11526.67 310370.7 1941.333 [,8] [,9] [,10] [,11] [,12] [1,] -251038.67 140746.7 -223253.33 293020 -365317.3 [2,] -40161.33 332453.3 -31546.67 580580 -253482.7 $out [1] 0 127400 473200 182000 72800 182000 436800 182000 -163800 $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(-509600, -345800, -273000, -163800, -36400, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6g58a1439043784.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,] 946400 728000 673400 673400 709800 618800 600600 564200 491400 [2,] 991900 900900 864500 855400 773500 800800 882700 873600 900900 [3,] 1037400 1037400 982800 946400 982800 1001000 1028300 964600 1001000 [4,] 1110200 1137500 1101100 1110200 1146600 1219400 1219400 1283100 1237600 [5,] 1255800 1383200 1310400 1456000 1547000 1456000 1510600 1474200 1510600 [,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,] 983442.6 929485.2 874885.2 830184 812626.6 810073.7 874728.9 [2,] 1091357.4 1145314.8 1090714.8 1062616 1152973.4 1191926.3 1181871.1 [,8] [,9] [,10] [1,] 777824.3 847428.9 NA [2,] 1151375.7 1154571.1 NA $out [1] 800800 1292200 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(946400, 991900, 1037400, 1110200, 1255800, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7pbgq1439043784.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,] 651155.6 673400 655200 [2,] 874611.1 873600 887250 [3,] 1016166.7 1010100 1014650 [4,] 1155700.0 1128400 1146600 [5,] 1437800.0 1456000 1446900 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 887960.1 893884 896358.7 [2,] 1144373.2 1126316 1132941.3 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/10unj1439043784.ps tmp/10unj1439043784.png",intern=TRUE)) character(0) > try(system("convert tmp/2ybec1439043784.ps tmp/2ybec1439043784.png",intern=TRUE)) character(0) > try(system("convert tmp/3iyeq1439043784.ps tmp/3iyeq1439043784.png",intern=TRUE)) character(0) > try(system("convert tmp/4ixgn1439043784.ps tmp/4ixgn1439043784.png",intern=TRUE)) character(0) > try(system("convert tmp/5eiqd1439043784.ps tmp/5eiqd1439043784.png",intern=TRUE)) character(0) > try(system("convert tmp/6g58a1439043784.ps tmp/6g58a1439043784.png",intern=TRUE)) character(0) > try(system("convert tmp/7pbgq1439043784.ps tmp/7pbgq1439043784.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.689 0.449 3.155