R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(161949,161634,161287,160652,167176,166856,161949,158687,159007,159007,159323,159990,159990,157043,155745,157043,161634,160967,154763,149510,148527,146563,147892,149510,148874,147545,144950,147545,149856,149190,141656,138394,135132,132505,132190,134150,131523,130541,129559,135132,135768,132505,123670,119745,113541,110910,112208,114172,114172,112559,112208,117465,121710,119745,113190,109932,103061,98817,102079,105341,105341,101097,100781,106319,109932,108630,102079,97835,88652,85075,86372,91946,92261,84092,87039,94226,97488,95523,86692,80484,73297,67724,70004,74910,73613,66426,68706,75893,79821,77541,68706,64782,58893,52684,53666,58573,59208,53319,54302,62502,64462,61173,49075,42871,34671,26502,29129,32706,32075,25835,29444,38280,42204,40244,32391,26186,19631,12093,13427,15707) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 161949 159990 148874 131523 114172 105341 92261 73613 59208 32075 NA [2,] 161634 157043 147545 130541 112559 101097 84092 66426 53319 25835 NA [3,] 161287 155745 144950 129559 112208 100781 87039 68706 54302 29444 NA [4,] 160652 157043 147545 135132 117465 106319 94226 75893 62502 38280 NA [5,] 167176 161634 149856 135768 121710 109932 97488 79821 64462 42204 NA [6,] 166856 160967 149190 132505 119745 108630 95523 77541 61173 40244 NA [7,] 161949 154763 141656 123670 113190 102079 86692 68706 49075 32391 NA [8,] 158687 149510 138394 119745 109932 97835 80484 64782 42871 26186 NA [9,] 159007 148527 135132 113541 103061 88652 73297 58893 34671 19631 NA [10,] 159007 146563 132505 110910 98817 85075 67724 52684 26502 12093 NA [11,] 159323 147892 132190 112208 102079 86372 70004 53666 29129 13427 NA [12,] 159990 149510 134150 114172 105341 91946 74910 58573 32706 15707 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -315 -2947 -1329 -982 -1613 -4244 -8169 -7187 -5889 -6240 NA [2,] -347 -1298 -2595 -982 -351 -316 2947 2280 983 3609 NA [3,] -635 1298 2595 5573 5257 5538 7187 7187 8200 8836 NA [4,] 6524 4591 2311 636 4245 3613 3262 3928 1960 3924 NA [5,] -320 -667 -666 -3263 -1965 -1302 -1965 -2280 -3289 -1960 NA [6,] -4907 -6204 -7534 -8835 -6555 -6551 -8831 -8835 -12098 -7853 NA [7,] -3262 -5253 -3262 -3925 -3258 -4244 -6208 -3924 -6204 -6205 NA [8,] 320 -983 -3262 -6204 -6871 -9183 -7187 -5889 -8200 -6555 NA [9,] 0 -1964 -2627 -2631 -4244 -3577 -5573 -6209 -8169 -7538 NA [10,] 316 1329 -315 1298 3262 1297 2280 982 2627 1334 NA [11,] 667 1618 1960 1964 3262 5574 4906 4907 3577 2280 NA [12,] 0 -636 -2627 0 0 315 -1297 635 -631 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/1zagx1344661727.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/2t6001344661727.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/3ovys1344661727.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/4yrf61344661727.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,] 32075.0 25835 29444.0 38280 42204 40244.0 32391.0 26186.0 19631.0 [2,] 73613.0 66426 68706.0 75893 79821 77541.0 68706.0 64782.0 58893.0 [3,] 109756.5 106828 106494.5 111892 115821 114187.5 107634.5 103883.5 95856.5 [4,] 148874.0 147545 144950.0 147545 149856 149190.0 141656.0 138394.0 135132.0 [5,] 161949.0 161634 161287.0 160652 167176 166856.0 161949.0 158687.0 159007.0 [,10] [,11] [,12] [1,] 12093 13427.0 15707.0 [2,] 52684 53666.0 58573.0 [3,] 91946 94225.5 98643.5 [4,] 132505 132190.0 134150.0 [5,] 159007 159323.0 159990.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 72153.1 66297.71 68399.96 76091.8 80828.72 78388.8 71185.77 [2,] 147359.9 147358.29 144589.04 147692.2 150813.28 149986.2 144083.23 [,8] [,9] [,10] [,11] [,12] [1,] 67104.01 57764.46 52064.25 54991.78 60882.22 [2,] 140662.99 133948.54 131827.75 133459.22 136404.78 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(32075, 73613, 109756.5, 148874, 161949, 25835, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vefx1344661727.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,] -8169.0 -2595.0 -635.0 636.0 -3289.0 -12098.0 -6208.0 -9183.0 -8169.0 [2,] -6240.0 -982.0 2595.0 2311.0 -2280.0 -8835.0 -6204.0 -7187.0 -6209.0 [3,] -3595.5 -331.5 5555.5 3768.5 -1962.5 -7693.5 -4084.5 -6379.5 -3910.5 [4,] -1329.0 2280.0 7187.0 4245.0 -667.0 -6551.0 -3262.0 -3262.0 -2627.0 [5,] -315.0 3609.0 8836.0 6524.0 -320.0 -4907.0 -3258.0 320.0 0.0 [,10] [,11] [,12] [1,] -315.0 667 -1297 [2,] 982.0 1960 -636 [3,] 1313.5 2771 0 [4,] 2280.0 4906 0 [5,] 3262.0 5574 635 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -6049.231 -1961.325 3261.154 2802.196 -2768.419 -8834.677 -5554.44 [2,] -1141.769 1298.325 7849.846 4734.804 -1156.581 -6552.323 -2614.56 [,8] [,9] [,10] [,11] [,12] [1,] -8340.586 -5700.21 664.9674 1299.061 -334.96 [2,] -4418.414 -2120.79 1962.0326 4242.939 334.96 $out [1] -2627 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-8169, -6240, -3595.5, -1329, -315, -2595, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6676k1344661727.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,] 158687.0 146563.0 132190.0 110910.0 98817.0 85075 67724.0 52684 26502.0 [2,] 159165.0 149018.5 134641.0 113856.5 104201.0 90299 74103.5 58733 33688.5 [3,] 160969.5 155254.0 143303.0 126614.5 112383.5 100939 85392.0 67566 51197.0 [4,] 161949.0 158516.5 148209.5 132014.0 115818.5 105830 93243.5 74753 60190.5 [5,] 161949.0 161634.0 149856.0 135768.0 121710.0 109932 97488.0 79821 64462.0 [,10] [,11] [1,] 12093.0 NA [2,] 17669.0 NA [3,] 27815.0 NA [4,] 35335.5 NA [5,] 42204.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 159699.7 150921.9 137114.3 118332.7 107084.7 93855.21 76662.12 60259.17 [2,] 162239.3 159586.1 149491.7 134896.3 117682.3 108022.79 94121.88 74872.83 [,9] [,10] [,11] [1,] 39109.26 19757.19 NA [2,] 63284.74 35872.81 NA $out [1] 167176 166856 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(158687, 159165, 160969.5, 161949, 161949, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7bb6i1344661727.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,] 89188.00 91946.0 91775.12 [2,] 93570.85 97250.0 96010.25 [3,] 103713.10 106661.2 106124.62 [4,] 108703.15 110824.2 111932.31 [5,] 113005.10 115821.0 115285.88 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 96811.16 100469.9 98862.47 [2,] 110615.04 112852.6 113386.78 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(89188, 93570.85, 103713.1, 108703.15, 113005.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zagx1344661727.ps tmp/1zagx1344661727.png",intern=TRUE)) character(0) > try(system("convert tmp/2t6001344661727.ps tmp/2t6001344661727.png",intern=TRUE)) character(0) > try(system("convert tmp/3ovys1344661727.ps tmp/3ovys1344661727.png",intern=TRUE)) character(0) > try(system("convert tmp/4yrf61344661727.ps tmp/4yrf61344661727.png",intern=TRUE)) character(0) > try(system("convert tmp/5vefx1344661727.ps tmp/5vefx1344661727.png",intern=TRUE)) character(0) > try(system("convert tmp/6676k1344661727.ps tmp/6676k1344661727.png",intern=TRUE)) character(0) > try(system("convert tmp/7bb6i1344661727.ps tmp/7bb6i1344661727.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.032 0.554 2.769