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(2745,1395,1550,1378,1318,1395,1483,1049,783,1208,857,48,2681,1249,1705,1472,1413,1651,1525,1095,900,1255,984,101,2655,1309,1844,1825,1629,1718,1595,1539,1513,1475,1184,211,3387,1546,1955,1899,2415,3439,1148,1127,1186,1009,817,236,2762,1035,1500,1519,1539,1452,1409,1288,987,1542,1248,1400,4190,2185,1097,1215,1236,1374,1548,1178,902) > 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] 69 > (np <- floor(n / par1)) [1] 5 > 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 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2745 2681 2655 3387 2762 4190 [2,] 1395 1249 1309 1546 1035 2185 [3,] 1550 1705 1844 1955 1500 1097 [4,] 1378 1472 1825 1899 1519 1215 [5,] 1318 1413 1629 2415 1539 1236 [6,] 1395 1651 1718 3439 1452 1374 [7,] 1483 1525 1595 1148 1409 1548 [8,] 1049 1095 1539 1127 1288 1178 [9,] 783 900 1513 1186 987 902 [10,] 1208 1255 1475 1009 1542 NA [11,] 857 984 1184 817 1248 NA [12,] 48 101 211 236 1400 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -1350 -1432 -1346 -1841 -1727 -2005 [2,] 155 456 535 409 465 -1088 [3,] -172 -233 -19 -56 19 118 [4,] -60 -59 -196 516 20 21 [5,] 77 238 89 1024 -87 138 [6,] 88 -126 -123 -2291 -43 174 [7,] -434 -430 -56 -21 -121 -370 [8,] -266 -195 -26 59 -301 -276 [9,] 425 355 -38 -177 555 NA [10,] -351 -271 -291 -192 -294 NA [11,] -809 -883 -973 -581 152 NA [12,] 2633 2554 3176 2526 2790 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/15w7v1413139033.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/2s2cq1413139033.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/3j3xc1413139033.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/4na291413139033.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] [,10] [,11] [,12] [1,] 2655.0 1035 1097.0 1215.0 1236 1374.0 1409 1049.0 783.0 1009 817 48 [2,] 2681.0 1249 1500.0 1378.0 1318 1395.0 1409 1095.0 900.0 1208 857 101 [3,] 2753.5 1352 1627.5 1495.5 1476 1551.5 1504 1152.5 944.5 1255 984 211 [4,] 3387.0 1546 1844.0 1825.0 1629 1718.0 1548 1288.0 1186.0 1475 1184 236 [5,] 4190.0 1546 1955.0 1899.0 1629 1718.0 1595 1539.0 1513.0 1542 1248 236 $n [1] 6 6 6 6 6 6 6 6 6 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2298.107 1160.425 1405.609 1207.171 1275.395 1343.155 1414.341 1028.009 [2,] 3208.893 1543.575 1849.391 1783.829 1676.605 1759.845 1593.659 1276.991 [,9] [,10] [,11] [,12] [1,] 760.0208 1066.338 752.9426 115.6093 [2,] 1128.9792 1443.662 1215.0574 306.3907 $out [1] 2185 2415 3439 1148 1400 $group [1] 2 5 6 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2655, 2681, 2753.5, 3387, 4190, 1035, 1249, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5iwuk1413139033.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] [,11] [,12] [1,] -2005.0 155.0 -233.0 -60.0 -87.0 -126 -434.0 -301.0 -177 -294 -973 2526 [2,] -1841.0 155.0 -172.0 -60.0 77.0 -126 -430.0 -276.0 -38 -294 -883 2554 [3,] -1579.5 432.5 -37.5 -19.5 113.5 -83 -245.5 -230.5 355 -291 -809 2633 [4,] -1350.0 465.0 19.0 21.0 238.0 88 -56.0 -26.0 425 -271 -581 2790 [5,] -1346.0 535.0 118.0 21.0 238.0 174 -21.0 59.0 555 -271 -581 2790 $n [1] 6 6 6 6 6 6 6 6 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1896.211 232.54 -160.70117 -71.74762 9.6498 -221.03691 -486.74208 [2,] -1262.789 632.46 85.70117 32.74762 217.3502 55.03691 -4.25792 [,8] [,9] [,10] [,11] [,12] [1,] -391.75807 27.84537 -307.2517 -1022.3924 2466.243 [2,] -69.24193 682.15463 -274.7483 -595.6076 2799.757 $out [1] -1088 -196 516 1024 -2291 -351 -192 152 3176 $group [1] 2 4 4 5 6 10 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2005, -1841, -1579.5, -1350, -1346, 155, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61vgq1413139033.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] [1,] 783 900.0 1184.0 236 987.0 902 [2,] 953 1039.5 1392.0 1068 1268.0 1178 [3,] 1348 1334.0 1567.0 1366 1430.5 1236 [4,] 1439 1588.0 1771.5 2185 1529.0 1548 [5,] 1550 1705.0 1844.0 3439 1542.0 1548 $n [1] 12 12 12 12 12 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1126.332 1083.825 1393.908 856.5288 1311.456 1041.133 [2,] 1569.668 1584.175 1740.092 1875.4712 1549.544 1430.867 $out [1] 2745 48 2681 101 2655 211 2762 4190 2185 $group [1] 1 1 2 2 3 3 5 6 6 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(783, 953, 1348, 1439, 1550, 900, 1039.5, 1334, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7s2ca1413139033.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,] 1018.000 944.50 1018.375 [2,] 1128.917 1068.25 1101.125 [3,] 1452.250 1414.00 1430.125 [4,] 1600.083 1527.75 1565.125 [5,] 1838.167 1627.50 1660.875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1237.348 1204.419 1218.491 [2,] 1667.152 1623.581 1641.759 $out [1] 3070.000 399.200 2753.500 211.000 2963.875 168.500 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1018, 1128.91666666667, 1452.25, 1600.08333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15w7v1413139033.ps tmp/15w7v1413139033.png",intern=TRUE)) character(0) > try(system("convert tmp/2s2cq1413139033.ps tmp/2s2cq1413139033.png",intern=TRUE)) character(0) > try(system("convert tmp/3j3xc1413139033.ps tmp/3j3xc1413139033.png",intern=TRUE)) character(0) > try(system("convert tmp/4na291413139033.ps tmp/4na291413139033.png",intern=TRUE)) character(0) > try(system("convert tmp/5iwuk1413139033.ps tmp/5iwuk1413139033.png",intern=TRUE)) character(0) > try(system("convert tmp/61vgq1413139033.ps tmp/61vgq1413139033.png",intern=TRUE)) character(0) > try(system("convert tmp/7s2ca1413139033.ps tmp/7s2ca1413139033.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.389 0.419 2.829