R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(5731,5040,6102,4904,5369,5578,4619,4731,5011,5227,4146,4625,4736,4219,5116,4205,4121,5103,4300,4578,3809,5657,4249,3830,4736,4840,4413,4571,4106,4801,3956,3829,4453,4027,4121,4798,3233,3554,3952,3951,3685,4312,3867,4140,4114,3818,3377,3453,3502,4017,5410,5184,5529,6434,4962,2980,2937,2969,2731,3163,3145,3173,3723,3224,4114,3446,2955,3879,4278,4177,3698,4449,4162,3961,5246,5170,3682,3495,3770,3291,3580,3898,3477,3054) > 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,] 5731 4736 4736 3233 3502 3145 4162 NA [2,] 5040 4219 4840 3554 4017 3173 3961 NA [3,] 6102 5116 4413 3952 5410 3723 5246 NA [4,] 4904 4205 4571 3951 5184 3224 5170 NA [5,] 5369 4121 4106 3685 5529 4114 3682 NA [6,] 5578 5103 4801 4312 6434 3446 3495 NA [7,] 4619 4300 3956 3867 4962 2955 3770 NA [8,] 4731 4578 3829 4140 2980 3879 3291 NA [9,] 5011 3809 4453 4114 2937 4278 3580 NA [10,] 5227 5657 4027 3818 2969 4177 3898 NA [11,] 4146 4249 4121 3377 2731 3698 3477 NA [12,] 4625 3830 4798 3453 3163 4449 3054 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -691 -517 104 321 515 28 -201 NA [2,] 1062 897 -427 398 1393 550 1285 NA [3,] -1198 -911 158 -1 -226 -499 -76 NA [4,] 465 -84 -465 -266 345 890 -1488 NA [5,] 209 982 695 627 905 -668 -187 NA [6,] -959 -803 -845 -445 -1472 -491 275 NA [7,] 112 278 -127 273 -1982 924 -479 NA [8,] 280 -769 624 -26 -43 399 289 NA [9,] 216 1848 -426 -296 32 -101 318 NA [10,] -1081 -1408 94 -441 -238 -479 -421 NA [11,] 479 -419 677 76 432 751 -423 NA [12,] 111 906 -1565 49 -18 -287 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/15gvk1382196294.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/2p3cw1382196294.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/3vba81382196294.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/4nrin1382196294.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,] 3145.0 3173.0 3723.0 3224 3682.0 3446.0 2955.0 2980 2937.0 2969 2731.0 [2,] 3367.5 3757.5 4182.5 4078 3895.5 3903.5 3818.5 3560 3694.5 3858 3427.0 [3,] 4162.0 4017.0 5116.0 4571 4114.0 4801.0 3956.0 3879 4114.0 4027 3698.0 [4,] 4736.0 4529.5 5328.0 5037 4745.0 5340.5 4459.5 4359 4365.5 4702 4133.5 [5,] 5731.0 5040.0 6102.0 5184 5529.0 6434.0 4962.0 4731 5011.0 5657 4249.0 [,12] [1,] 3054 [2,] 3308 [3,] 3830 [4,] 4537 [5,] 4798 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3344.754 3555.974 4431.926 3998.301 3606.692 3942.847 3573.205 3401.85 [2,] 4979.246 4478.026 5800.074 5143.699 4621.308 5659.153 4338.795 4356.15 [,9] [,10] [,11] [,12] [1,] 3713.29 3522.977 3276.09 3096.061 [2,] 4514.71 4531.023 4119.91 4563.939 $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(3145, 3367.5, 4162, 4736, 5731, 3173, 3757.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5b2uk1382196294.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,] -691.0 -427.0 -1198.0 -1488.0 -668 -1472 -479.0 -43.0 -426.0 -1408.0 [2,] -359.0 474.0 -705.0 -365.5 11 -902 -303.0 -34.5 -198.5 -780.0 [3,] 28.0 897.0 -226.0 -84.0 627 -803 112.0 280.0 32.0 -441.0 [4,] 212.5 1173.5 -38.5 405.0 800 -468 275.5 344.0 267.0 -329.5 [5,] 515.0 1393.0 158.0 890.0 982 -445 924.0 624.0 318.0 94.0 [,11] [,12] [1,] -423.0 -287.0 [2,] -171.5 -287.0 [3,] 432.0 15.5 [4,] 578.0 111.0 [5,] 751.0 111.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -313.2906 479.2699 -624.023 -544.1302 155.8219 -1062.1778 -233.4709 [2,] 369.2906 1314.7301 172.023 376.1302 1098.1781 -543.8222 457.4709 [,8] [,9] [,10] [,11] [,12] [1,] 53.96591 -245.9891 -710.0313 -15.58931 -241.2229 [2,] 506.03409 309.9891 -171.9687 879.58931 272.2229 $out [1] 275 -1982 -769 1848 906 -1565 $group [1] 6 7 8 9 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-691, -359, 28, 212.5, 515, -427, 474, 897, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6x01u1382196294.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,] 4146.0 3809.0 3829.0 3233.0 2731.0 2955.0 3054.0 NA [2,] 4678.0 4163.0 4066.5 3503.5 2974.5 3198.5 3486.0 NA [3,] 5025.5 4274.5 4433.0 3842.5 3759.5 3710.5 3726.0 NA [4,] 5473.5 4919.5 4767.0 4033.0 5297.0 4145.5 4061.5 NA [5,] 6102.0 5657.0 4840.0 4312.0 6434.0 4449.0 4162.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 4662.667 3929.455 4113.497 3600.991 2700.192 3278.567 3463.511 NA [2,] 5388.333 4619.545 4752.503 4084.009 4818.808 4142.433 3988.489 NA $out [1] 5246 5170 $group [1] 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(4146, 4678, 5025.5, 5473.5, 6102, 3809, 4163, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/710091382196294.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,] 3685.571 3698.0 3780.250 [2,] 3972.143 3917.5 3994.750 [3,] 4146.357 4070.5 4141.250 [4,] 4415.357 4366.5 4438.875 [5,] 4851.714 4801.0 4755.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3944.204 3865.708 3938.682 [2,] 4348.510 4275.292 4343.818 $out [1] 5116 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(3685.57142857143, 3972.14285714286, 4146.35714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15gvk1382196294.ps tmp/15gvk1382196294.png",intern=TRUE)) character(0) > try(system("convert tmp/2p3cw1382196294.ps tmp/2p3cw1382196294.png",intern=TRUE)) character(0) > try(system("convert tmp/3vba81382196294.ps tmp/3vba81382196294.png",intern=TRUE)) character(0) > try(system("convert tmp/4nrin1382196294.ps tmp/4nrin1382196294.png",intern=TRUE)) character(0) > try(system("convert tmp/5b2uk1382196294.ps tmp/5b2uk1382196294.png",intern=TRUE)) character(0) > try(system("convert tmp/6x01u1382196294.ps tmp/6x01u1382196294.png",intern=TRUE)) character(0) > try(system("convert tmp/710091382196294.ps tmp/710091382196294.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.154 0.547 3.693