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(2048,2037,2149,2124,2205,2489,2573,2702,2718,2646,2712,2634,2614,2637,2649,2579,2505,2462,2467,2447,2656,2626,2483,2540,2503,2467,2513,2443,2293,2071,2030,2052,1864,1670,1811,1905,1863,2014,2198,2962,3047,3033,3504,3801,3858,3674,3721,3844,4117,4105,4435,4296,4203,4563,4621,4697,4591,4357,4503,4444,4291,4200,4139,3970,3862,3702,3570,3801,3896,3918,3813,3667) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2048 2614 2503 1863 4117 4291 NA [2,] 2037 2637 2467 2014 4105 4200 NA [3,] 2149 2649 2513 2198 4435 4139 NA [4,] 2124 2579 2443 2962 4296 3970 NA [5,] 2205 2505 2293 3047 4203 3862 NA [6,] 2489 2462 2071 3033 4563 3702 NA [7,] 2573 2467 2030 3504 4621 3570 NA [8,] 2702 2447 2052 3801 4697 3801 NA [9,] 2718 2656 1864 3858 4591 3896 NA [10,] 2646 2626 1670 3674 4357 3918 NA [11,] 2712 2483 1811 3721 4503 3813 NA [12,] 2634 2540 1905 3844 4444 3667 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -11 23 -36 151 -12 -91 NA [2,] 112 12 46 184 330 -61 NA [3,] -25 -70 -70 764 -139 -169 NA [4,] 81 -74 -150 85 -93 -108 NA [5,] 284 -43 -222 -14 360 -160 NA [6,] 84 5 -41 471 58 -132 NA [7,] 129 -20 22 297 76 231 NA [8,] 16 209 -188 57 -106 95 NA [9,] -72 -30 -194 -184 -234 22 NA [10,] 66 -143 141 47 146 -105 NA [11,] -78 57 94 123 -59 -146 NA [12,] -20 -37 -42 273 -153 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/fisher/rcomp/tmp/1scty1351020988.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/fisher/rcomp/tmp/2gseq1351020988.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/fisher/rcomp/tmp/3nzi41351020988.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/fisher/rcomp/tmp/44b4x1351020988.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,] 1863.0 2014 2149 2124.0 2205 2071 2030.0 2052.0 1864 1670 1811.0 1905.0 [2,] 2048.0 2037 2198 2443.0 2293 2462 2467.0 2447.0 2656 2626 2483.0 2540.0 [3,] 2558.5 2552 2581 2770.5 2776 2761 3038.5 3251.5 3288 3160 3216.5 3150.5 [4,] 4117.0 4105 4139 3970.0 3862 3702 3570.0 3801.0 3896 3918 3813.0 3844.0 [5,] 4291.0 4200 4435 4296.0 4203 4563 4621.0 4697.0 4591 4357 4503.0 4444.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1223.928 1218.073 1328.992 1785.536 1763.944 1961.16 2327.029 2378.126 [2,] 3893.072 3885.927 3833.008 3755.464 3788.056 3560.84 3749.971 4124.874 [,9] [,10] [,11] [,12] [1,] 2488.16 2326.618 2358.607 2309.378 [2,] 4087.84 3993.382 4074.393 3991.622 $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(1863, 2048, 2558.5, 4117, 4291, 2014, 2037, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5nk651351020988.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,] -91.0 -61 -169 -150.0 -222.0 -132.0 -20.0 -188.0 -234 -143.0 -146 -42 [2,] -36.0 12 -139 -108.0 -160.0 -41.0 22.0 -106.0 -194 -105.0 -78 -42 [3,] -11.5 79 -70 -83.5 -28.5 31.5 102.5 36.5 -128 56.5 -1 -37 [4,] 23.0 184 -25 81.0 284.0 84.0 231.0 95.0 -30 141.0 94 -20 [5,] 23.0 330 -25 85.0 360.0 84.0 297.0 209.0 22 146.0 123 -20 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -49.55691 -31.94556 -143.533682 -205.4111 -314.8943 -49.12904 -32.31175 [2,] 26.55691 189.94556 3.533682 38.4111 257.8943 112.12904 237.31175 [,8] [,9] [,10] [,11] [,12] [1,] -93.15149 -233.7853 -102.1779 -111.9456 -52.54514 [2,] 166.15149 -22.2147 215.1779 109.9456 -21.45486 $out [1] 151 764 471 273 -153 $group [1] 1 3 6 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-91, -36, -11.5, 23, 23, -61, 12, 79, 184, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6hlfp1351020988.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] [1,] 2037.0 2447.0 1670.0 1863.0 4105.0 3570.0 NA [2,] 2136.5 2475.0 1884.5 2580.0 4249.5 3751.5 NA [3,] 2531.0 2559.5 2061.5 3275.5 4439.5 3879.0 NA [4,] 2674.0 2631.5 2455.0 3761.0 4577.0 4054.5 NA [5,] 2718.0 2656.0 2513.0 3858.0 4697.0 4291.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2285.843 2488.119 1801.291 2736.838 4290.125 3740.8 NA [2,] 2776.157 2630.881 2321.709 3814.162 4588.875 4017.2 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(2037, 2136.5, 2531, 2674, 2718, 2447, 2475, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7wor01351020988.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,] 2906.000 2552.00 2941.250 [2,] 3016.500 2671.00 3001.938 [3,] 3094.917 2907.25 3060.500 [4,] 3173.083 3188.25 3173.375 [5,] 3263.833 3288.00 3279.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3023.498 2671.329 2982.306 [2,] 3166.335 3143.171 3138.694 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2906, 3016.5, 3094.91666666667, 3173.08333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1scty1351020988.ps tmp/1scty1351020988.png",intern=TRUE)) character(0) > try(system("convert tmp/2gseq1351020988.ps tmp/2gseq1351020988.png",intern=TRUE)) character(0) > try(system("convert tmp/3nzi41351020988.ps tmp/3nzi41351020988.png",intern=TRUE)) character(0) > try(system("convert tmp/44b4x1351020988.ps tmp/44b4x1351020988.png",intern=TRUE)) character(0) > try(system("convert tmp/5nk651351020988.ps tmp/5nk651351020988.png",intern=TRUE)) character(0) > try(system("convert tmp/6hlfp1351020988.ps tmp/6hlfp1351020988.png",intern=TRUE)) character(0) > try(system("convert tmp/7wor01351020988.ps tmp/7wor01351020988.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.433 0.635 4.058