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(1196,1141,6081,-3508,1782,-891,-2043,35,5042,-1837,406,-3621,1987,1627,6692,-3999,679,-215,-2820,799,9957,5154,1302,6287,1891,2191,7336,-2351,881,388,-1936,1120,4438,-3495,1012,-3704,2879,1907,6451,-2814,1613,-40,-3086,292,5283,-1671,3529,-3191,2090,3278,5686,-1817,2322,-705,-1980,646,6077,2632,2356,-1717,1733,2232,6167,-4668,1694,589,-4163,174,5421,-38,3158,-4322,1920,2527,7755,-2567,-388,-2084,-2024,-131,5615,187,2054,-7172) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1196 1987 1891 2879 2090 1733 1920 NA [2,] 1141 1627 2191 1907 3278 2232 2527 NA [3,] 6081 6692 7336 6451 5686 6167 7755 NA [4,] -3508 -3999 -2351 -2814 -1817 -4668 -2567 NA [5,] 1782 679 881 1613 2322 1694 -388 NA [6,] -891 -215 388 -40 -705 589 -2084 NA [7,] -2043 -2820 -1936 -3086 -1980 -4163 -2024 NA [8,] 35 799 1120 292 646 174 -131 NA [9,] 5042 9957 4438 5283 6077 5421 5615 NA [10,] -1837 5154 -3495 -1671 2632 -38 187 NA [11,] 406 1302 1012 3529 2356 3158 2054 NA [12,] -3621 6287 -3704 -3191 -1717 -4322 -7172 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -55 -360 300 -972 1188 499 607 NA [2,] 4940 5065 5145 4544 2408 3935 5228 NA [3,] -9589 -10691 -9687 -9265 -7503 -10835 -10322 NA [4,] 5290 4678 3232 4427 4139 6362 2179 NA [5,] -2673 -894 -493 -1653 -3027 -1105 -1696 NA [6,] -1152 -2605 -2324 -3046 -1275 -4752 60 NA [7,] 2078 3619 3056 3378 2626 4337 1893 NA [8,] 5007 9158 3318 4991 5431 5247 5746 NA [9,] -6879 -4803 -7933 -6954 -3445 -5459 -5428 NA [10,] 2243 -3852 4507 5200 -276 3196 1867 NA [11,] -4027 4985 -4716 -6720 -4073 -7480 -9226 NA [12,] 5608 -4396 6583 5281 3450 6242 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/1s0x81413144681.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/29jeg1413144681.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/3g93j1413144681.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/446gs1413144681.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] [1,] 1733.0 1141.0 5686 -4668.0 -388 -2084 -4163 -131.0 4438.0 -3495.0 406 [2,] 1812.0 1767.0 6124 -3753.5 780 -798 -2953 104.5 5162.5 -1754.0 1157 [3,] 1920.0 2191.0 6451 -2814.0 1613 -215 -2043 292.0 5421.0 -38.0 2054 [4,] 2038.5 2379.5 7014 -2459.0 1738 174 -2002 722.5 5846.0 1409.5 2757 [5,] 2090.0 3278.0 7755 -1817.0 2322 589 -1936 1120.0 6077.0 5154.0 3529 [,12] [1,] -4322 [2,] -4013 [3,] -3621 [4,] -2454 [5,] -1717 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1784.738 1825.225 5919.506 -3587.055 1040.898 -795.4627 -2610.922 [2,] 2055.262 2556.775 6982.494 -2040.945 2185.102 365.4627 -1475.078 [,8] [,9] [,10] [,11] [,12] [1,] -77.05963 5012.825 -1927.191 1098.506 -4552.01 [2,] 661.05963 5829.175 1851.191 3009.494 -2689.99 $out [1] 1196 2879 9957 6287 -7172 $group [1] 1 1 9 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1733, 1812, 1920, 2038.5, 2090, 1141, 1767, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yr091413144681.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] [1,] -972.0 3935.0 -10835.0 2179.0 -3027.0 -4752.0 1893.0 4991.0 -7933.0 -276.0 [2,] -207.5 4239.5 -10506.5 3685.5 -2184.5 -2825.5 2352.0 4999.0 -6916.5 795.5 [3,] 300.0 4940.0 -9687.0 4427.0 -1653.0 -2324.0 3056.0 5247.0 -5459.0 2243.0 [4,] 553.0 5105.0 -9427.0 4984.0 -999.5 -1213.5 3498.5 5588.5 -5115.5 3851.5 [5,] 1188.0 5228.0 -9265.0 6362.0 -493.0 60.0 4337.0 5746.0 -3445.0 5200.0 [,11] [,12] [1,] -9226 3450.0 [2,] -7100 3450.0 [3,] -4716 5444.5 [4,] -4050 6242.0 [5,] -4027 6583.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -154.1583 4423.137 -10331.66 3651.557 -2360.6629 -3286.66 2371.329 4894.96 [2,] 754.1583 5456.863 -9042.34 5202.443 -945.3371 -1361.34 3740.671 5599.04 [,9] [,10] [,11] [,12] [1,] -6534.528 418.0061 -6537.411 3643.57 [2,] -4383.472 4067.9939 -2894.589 7245.43 $out [1] 2408 -7503 9158 3318 -3852 4985 -4396 $group [1] 2 3 8 8 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-972, -207.5, 300, 553, 1188, 3935, 4239.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63fn31413144681.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,] -3621.0 -3999.0 -3704.0 -3191.0 -1980 -4668.0 -7172.0 NA [2,] -1940.0 232.0 -2143.5 -2242.5 -1211 -2100.5 -2054.0 NA [3,] 220.5 1464.5 946.5 952.5 2206 1141.5 28.0 NA [4,] 1489.0 5720.5 2041.0 3204.0 2955 2695.0 2290.5 NA [5,] 6081.0 9957.0 7336.0 6451.0 6077 6167.0 7755.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -1343.49 -1038.842 -962.0785 -1531.685 305.8594 -1045.76 -1953.556 NA [2,] 1784.49 3967.842 2855.0785 3436.685 4106.1406 3328.76 2009.556 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(-3621, -1940, 220.5, 1489, 6081, -3999, 232, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/78m761413144681.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,] -3103.4286 -3621.0 -3233.500 [2,] -1457.0000 -1129.0 -1394.750 [3,] 822.7143 952.5 836.250 [4,] 2051.4286 2122.5 2015.125 [5,] 6595.4286 6451.0 6569.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] -777.5035 -530.531 -719.0169 [2,] 2422.9321 2435.531 2391.5169 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(-3103.42857142857, -1457, 822.714285714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1s0x81413144681.ps tmp/1s0x81413144681.png",intern=TRUE)) character(0) > try(system("convert tmp/29jeg1413144681.ps tmp/29jeg1413144681.png",intern=TRUE)) character(0) > try(system("convert tmp/3g93j1413144681.ps tmp/3g93j1413144681.png",intern=TRUE)) character(0) > try(system("convert tmp/446gs1413144681.ps tmp/446gs1413144681.png",intern=TRUE)) character(0) > try(system("convert tmp/5yr091413144681.ps tmp/5yr091413144681.png",intern=TRUE)) character(0) > try(system("convert tmp/63fn31413144681.ps tmp/63fn31413144681.png",intern=TRUE)) character(0) > try(system("convert tmp/78m761413144681.ps tmp/78m761413144681.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.492 0.445 2.956