R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-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(124275,58605,21828,42811,65963,128457,26867,143540,107458,258558,22475,294584,159848,289458,117950,78351,84589,44324,52285,185486,23846,13257,166999,148488,74747,55700,218584,187888,44788,18840,48787,69100,41892,90588,148574,50201,86828,102785,118844,145288,56790,287525,187880,87740,55258,58769,43366,77051,91574,15533,18425,65192,81059,73322,91261,86166,61842,25192,21059,15855,12618,101667,224275,55700,60748,41848,61781,120077,42032,46485,36861,55027,48999,68352,126987,86526,125340,69029,153287,135724,92108,119906,79798,97206) > 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,] 124275 159848 74747 86828 91574 12618 48999 NA [2,] 58605 289458 55700 102785 15533 101667 68352 NA [3,] 21828 117950 218584 118844 18425 224275 126987 NA [4,] 42811 78351 187888 145288 65192 55700 86526 NA [5,] 65963 84589 44788 56790 81059 60748 125340 NA [6,] 128457 44324 18840 287525 73322 41848 69029 NA [7,] 26867 52285 48787 187880 91261 61781 153287 NA [8,] 143540 185486 69100 87740 86166 120077 135724 NA [9,] 107458 23846 41892 55258 61842 42032 92108 NA [10,] 258558 13257 90588 58769 25192 46485 119906 NA [11,] 22475 166999 148574 43366 21059 36861 79798 NA [12,] 294584 148488 50201 77051 15855 55027 97206 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -65670 129610 -19047 15957 -76041 89049 19353 NA [2,] -36777 -171508 162884 16059 2892 122608 58635 NA [3,] 20983 -39599 -30696 26444 46767 -168575 -40461 NA [4,] 23152 6238 -143100 -88498 15867 5048 38814 NA [5,] 62494 -40265 -25948 230735 -7737 -18900 -56311 NA [6,] -101590 7961 29947 -99645 17939 19933 84258 NA [7,] 116673 133201 20313 -100140 -5095 58296 -17563 NA [8,] -36082 -161640 -27208 -32482 -24324 -78045 -43616 NA [9,] 151100 -10589 48696 3511 -36650 4453 27798 NA [10,] -236083 153742 57986 -15403 -4133 -9624 -40108 NA [11,] 272109 -18511 -98373 33685 -5204 18166 17408 NA [12,] -134736 -73741 36627 14523 -3237 -6028 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/1xepo1350662916.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/2duya1350662916.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/362cw1350662916.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/4g9ek1350662916.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,] 12618.0 15533.0 18425.0 42811 44788 18840.0 26867 69100 23846 [2,] 61873.0 57152.5 69889.0 60446 58769 43086.0 50536 86953 41962 [3,] 86828.0 68352.0 118844.0 78351 65963 69029.0 61781 120077 55258 [4,] 107924.5 102226.0 172785.5 115907 82824 100889.5 122274 139632 76975 [5,] 159848.0 102785.0 224275.0 187888 84589 128457.0 187880 185486 107458 [,10] [,11] [,12] [1,] 13257.0 21059 15855 [2,] 35838.5 29668 52614 [3,] 58769.0 43366 77051 [4,] 105247.0 114186 122847 [5,] 119906.0 166999 148488 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 59326.79 41434.83 57395.87 45230.59 51597.74 34509.68 18940.22 [2,] 114329.21 95269.17 180292.13 111471.41 80328.26 103548.32 104621.78 [,8] [,9] [,10] [,11] [,12] [1,] 88617.95 34348.8 17319.36 -7106.786 35108.99 [2,] 151536.05 76167.2 100218.64 93838.786 118993.01 $out [1] 289458 125340 287525 258558 294584 $group [1] 2 5 6 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(12618, 61873, 86828, 107924.5, 159848, 15533, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52idp1350662916.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] [1,] -76041.0 -171508.0 -40461.0 -88498.0 -56311.0 -101590 -100140.0 -78045.0 [2,] -42358.5 -16942.5 -40030.0 -41725.0 -33106.5 -45842 -11329.0 -60830.5 [3,] 15957.0 16059.0 -30696.0 6238.0 -18900.0 17939 20313.0 -36082.0 [4,] 54201.0 90621.5 23713.5 19509.5 27378.5 24940 87484.5 -29845.0 [5,] 129610.0 162884.0 46767.0 38814.0 62494.0 84258 133201.0 -24324.0 [,9] [,10] [,11] [,12] [1,] -36650 -40108.0 -18511.0 -134736.0 [2,] -3539 -27755.5 -11857.5 -73741.0 [3,] 4453 -9624.0 17408.0 -4632.5 [4,] 38247 26926.5 25925.5 14523.0 [5,] 48696 57986.0 33685.0 36627.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -41706.78 -48176.49 -68762.59 -30330.26 -55020.67 -24330.87 -38696.83 [2,] 73620.78 80294.49 7370.59 42806.26 17220.67 60208.87 79322.83 [,8] [,9] [,10] [,11] [,12] [1,] -54586.04 -20500.93 -42279.21 -5155.398 -61565.63 [2,] -17577.96 29406.93 23031.21 39971.398 52300.63 $out [1] -168575 -143100 230735 -161640 151100 -236083 153742 272109 -98373 $group [1] 3 4 5 8 9 10 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-76041, -42358.5, 15957, 54201, 129610, -171508, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6e0f01350662916.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,] 21828.0 13257.0 18840.0 43366.0 15533.0 12618.0 48999.0 NA [2,] 34839.0 48304.5 46787.5 57779.5 19742.0 41940.0 74413.5 NA [3,] 86710.5 101269.5 62400.0 87284.0 63517.0 55363.5 94657.0 NA [4,] 135998.5 163423.5 119581.0 132066.0 83612.5 81724.0 126163.5 NA [5,] 258558.0 289458.0 218584.0 187880.0 91574.0 120077.0 153287.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 40570.97 48762.95 29198.4 53401.43 34385.24 37217.75 71053.48 NA [2,] 132850.03 153776.05 95601.6 121166.57 92648.76 73509.25 118260.52 NA $out [1] 294584 287525 224275 $group [1] 1 4 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(21828, 34839, 86710.5, 135998.5, 258558, 13257, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7d0bt1350662916.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,] 60633.71 43366.0 59468.50 [2,] 79869.00 60275.0 71361.75 [3,] 91707.43 68690.5 82294.00 [4,] 102179.43 82589.5 87953.50 [5,] 120984.71 86828.0 88176.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 81531.49 58512.71 74726.39 [2,] 101883.36 78868.29 89861.61 $out [1] 118844.0 120077.0 121337.2 113292.5 $group [1] 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(60633.7142857143, 79869, 91707.4285714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1xepo1350662916.ps tmp/1xepo1350662916.png",intern=TRUE)) character(0) > try(system("convert tmp/2duya1350662916.ps tmp/2duya1350662916.png",intern=TRUE)) character(0) > try(system("convert tmp/362cw1350662916.ps tmp/362cw1350662916.png",intern=TRUE)) character(0) > try(system("convert tmp/4g9ek1350662916.ps tmp/4g9ek1350662916.png",intern=TRUE)) character(0) > try(system("convert tmp/52idp1350662916.ps tmp/52idp1350662916.png",intern=TRUE)) character(0) > try(system("convert tmp/6e0f01350662916.ps tmp/6e0f01350662916.png",intern=TRUE)) character(0) > try(system("convert tmp/7d0bt1350662916.ps tmp/7d0bt1350662916.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.862 0.624 4.476