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(4213144,4197453,4181541,4148612,4474366,4457128,4213144,4050930,4066621,4066621,4084080,4115462,4164303,4164303,4132921,4050930,4474366,4538898,4441437,4213144,4310826,4164303,4230382,4261985,4294914,4213144,4230382,4115462,4474366,4587739,4490278,4310826,4505969,4294914,4490278,4474366,4523207,4343755,4538898,4523207,4816032,4749953,4490278,4359446,4538898,4294914,4474366,4505969,4572048,4425746,4505969,4554810,4734262,4587739,4392596,4181541,4376905,3839875,4099771,4246073,4392596,4181541,4181541,4181541,4294914,4132921,3920319,3742414,3871478,3367598,3676335,3855787,3888716,3709264,3724955,3676335,3839875,3724955,3498430,3334669,3611582,3010241,3400748,3578653,3578653,3367598,3172455,3156764,3334669,3172455,2863939,2651337,2879630,2342821,2830789,3090464,3172455,2993003,2766257,2928471,2993003,2944162,2455973,2229448,2391441,1903473,2407353,2586805,2733107,2489123,2260830,2391441,2455973,2326909,1838941,1626339,1821482,1284673,1870323,2229448) > par1 = '12' > 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] [1,] 4213144 4164303 4294914 4523207 4572048 4392596 3888716 3578653 3172455 [2,] 4197453 4164303 4213144 4343755 4425746 4181541 3709264 3367598 2993003 [3,] 4181541 4132921 4230382 4538898 4505969 4181541 3724955 3172455 2766257 [4,] 4148612 4050930 4115462 4523207 4554810 4181541 3676335 3156764 2928471 [5,] 4474366 4474366 4474366 4816032 4734262 4294914 3839875 3334669 2993003 [6,] 4457128 4538898 4587739 4749953 4587739 4132921 3724955 3172455 2944162 [7,] 4213144 4441437 4490278 4490278 4392596 3920319 3498430 2863939 2455973 [8,] 4050930 4213144 4310826 4359446 4181541 3742414 3334669 2651337 2229448 [9,] 4066621 4310826 4505969 4538898 4376905 3871478 3611582 2879630 2391441 [10,] 4066621 4164303 4294914 4294914 3839875 3367598 3010241 2342821 1903473 [11,] 4084080 4230382 4490278 4474366 4099771 3676335 3400748 2830789 2407353 [12,] 4115462 4261985 4474366 4505969 4246073 3855787 3578653 3090464 2586805 [,10] [,11] [1,] 2733107 NA [2,] 2489123 NA [3,] 2260830 NA [4,] 2391441 NA [5,] 2455973 NA [6,] 2326909 NA [7,] 1838941 NA [8,] 1626339 NA [9,] 1821482 NA [10,] 1284673 NA [11,] 1870323 NA [12,] 2229448 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -15691 0 -81770 -179452 -146302 -211055 -179452 -211055 -179452 [2,] -15912 -31382 17238 195143 80223 0 15691 -195143 -226746 [3,] -32929 -81991 -114920 -15691 48841 0 -48620 -15691 162214 [4,] 325754 423436 358904 292825 179452 113373 163540 177905 64532 [5,] -17238 64532 113373 -66079 -146523 -161993 -114920 -162214 -48841 [6,] -243984 -97461 -97461 -259675 -195143 -212602 -226525 -308516 -488189 [7,] -162214 -228293 -179452 -130832 -211055 -177905 -163761 -212602 -226525 [8,] 15691 97682 195143 179452 195364 129064 276913 228293 161993 [9,] 0 -146523 -211055 -243984 -537030 -503880 -601341 -536809 -487968 [10,] 17459 66079 195364 179452 259896 308737 390507 487968 503880 [11,] 31382 31603 -15912 31603 146302 179452 177905 259675 179452 [12,] 48841 32929 48841 66079 146523 32929 0 81991 146302 [,10] [,11] [1,] -243984 NA [2,] -228293 NA [3,] 130611 NA [4,] 64532 NA [5,] -129064 NA [6,] -487968 NA [7,] -212602 NA [8,] 195143 NA [9,] -536809 NA [10,] 585650 NA [11,] 359125 NA [12,] 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/17obe1436568835.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/21sxn1436568835.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/312741436568835.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/4fg541436568835.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,] 2733107 2489123 2260830 2391441 2455973 2326909 1838941 1626339 1821482 [2,] 3578653 3367598 3172455 3156764 3334669 3172455 2863939 2651337 2879630 [3,] 4188724 4172922 4157231 4083196 4384640 4295024 4066732 3896672 3969050 [4,] 4392596 4213144 4230382 4181541 4474366 4587739 4441437 4213144 4376905 [5,] 4572048 4425746 4538898 4554810 4816032 4749953 4490278 4359446 4538898 [,10] [,11] [,12] [1,] 1284673 1870323 2229448 [2,] 2342821 2830789 3090464 [3,] 3603736 3880208 3985624 [4,] 4164303 4230382 4261985 [5,] 4294914 4490278 4505969 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 3782045 3750454 3628648 3571177 3815202 3587892 3278551 3116331 3220951 [2,] 4595402 4595390 4685814 4595215 4954078 5002157 4854912 4677013 4717148 [,10] [,11] [,12] [1,] 2693651 3180915 3400286 [2,] 4513822 4579500 4570963 $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(2733107, 3578653, 4188723.5, 4392596, 4572048, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sggd1436568835.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,] -243984 -228293 -114920 64532.0 -162214.0 -308516.0 -228293.0 97682.0 [2,] -211055 -195143 -48620 113373.0 -146523.0 -308516.0 -212602.0 129064.0 [3,] -179452 -7956 -15691 178678.5 -90499.5 -235254.5 -195253.5 187297.5 [4,] -81770 17238 48841 325754.0 -17238.0 -195143.0 -163761.0 195364.0 [5,] 0 195143 162214 423436.0 113373.0 -97461.0 -130832.0 276913.0 [,9] [,10] [,11] [,12] [1,] -601341 17459.0 -15912.0 0 [2,] -536809 179452.0 31603.0 32929 [3,] -495924 284316.5 162103.5 48841 [4,] -211055 487968.0 179452.0 81991 [5,] 0 585650.0 359125.0 146523 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -244047.9 -114070.02 -64386.4 72564.48 -155095.44 -291900.2 -219656.4 [2,] -114856.1 98158.02 33004.4 284792.52 -25903.56 -178608.8 -170850.6 [,8] [,9] [,10] [,11] [,12] [1,] 154171.4 -658683.7 130169.6 88232.24 23001.68 [2,] 220423.6 -333164.3 438463.4 235974.76 74680.32 $out [1] -488189 -487968 15691 $group [1] 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-243984, -211055, -179452, -81770, 0, -228293, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qa5m1436568835.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,] 4050930 4050930 4115462 4294914 3839875 3367598 3334669 2342821 1903473 [2,] 4075350 4164303 4262648 4416906 4213807 3799100 3449589 2847364 2399397 [3,] 4165076 4221763 4392596 4514588 4409171 4026620 3643958 3123614 2676531 [4,] 4213144 4376132 4490278 4538898 4563429 4181541 3724955 3253562 2968582 [5,] 4213144 4538898 4587739 4538898 4734262 4392596 3888716 3578653 3172455 [,10] [,11] [1,] 1284673 NA [2,] 1830212 NA [3,] 2245139 NA [4,] 2423707 NA [5,] 2733107 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 4102228 4125147 4288772 4458947 4249706 3852186 3518362 2938344 2416922 [2,] 4227925 4318379 4496420 4570229 4568636 4201054 3769555 3308884 2936140 [,10] [,11] [1,] 1974442 NA [2,] 2515836 NA $out [1] 4474366 4457128 4816032 4749953 3010241 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(4050930, 4075350.5, 4165076.5, 4213144, 4213144, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7mrw11436568835.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,] 3256943 3603736 3324779 [2,] 3596963 3932861 3648503 [3,] 3732038 4074964 3732621 [4,] 3865389 4180823 3887086 [5,] 3989183 4384640 4012172 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3609607 3961867 3623801 [2,] 3854469 4188061 3841440 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(3256943.3, 3596962.85, 3732038.05, 3865389.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17obe1436568835.ps tmp/17obe1436568835.png",intern=TRUE)) character(0) > try(system("convert tmp/21sxn1436568835.ps tmp/21sxn1436568835.png",intern=TRUE)) character(0) > try(system("convert tmp/312741436568835.ps tmp/312741436568835.png",intern=TRUE)) character(0) > try(system("convert tmp/4fg541436568835.ps tmp/4fg541436568835.png",intern=TRUE)) character(0) > try(system("convert tmp/5sggd1436568835.ps tmp/5sggd1436568835.png",intern=TRUE)) character(0) > try(system("convert tmp/6qa5m1436568835.ps tmp/6qa5m1436568835.png",intern=TRUE)) character(0) > try(system("convert tmp/7mrw11436568835.ps tmp/7mrw11436568835.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.468 0.399 2.897