R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(2754542000,2899512000,2928886000,3011252000,2932895000,3069307000,2863923000,2585491000,2993900000,3023542000,2491370000,2341705000,2126472000,2196705000,2368313000,2285174000,2163877000,2299241000,2275643000,2163091000,2416149000,2434553000,2281937000,2440464000,2255745000,2389872000,2863148000,2623516000,2558136000,2898129000,2537720000,2543469000,2779739000,2884779000,2711624000,2817771000,2884477000,3058996000,3285298000,2879617000,3220416000,3144280000,2940811000,2986507000,3153720000,2995806000,2990242000,2879837000,2848699000,3138385000,3532447000,3121872000,3309250000,3215022000,2966778000,3010284000,3083824000,3257727000,3180374000,3036414000,2966714000,3067677000,3339789000,3299861000,3193328000,3181266000,3193356000,2898282000,2929524000,3217311000,3126249000,3131083000,3008058000,2868318000,3207495000,3109336000,3070725000,2989963000,3287552000,2835238000,3368961000,3291689000,3008536000,2974109000) > 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] [1,] 2754542000 2126472000 2255745000 2884477000 2848699000 2966714000 [2,] 2899512000 2196705000 2389872000 3058996000 3138385000 3067677000 [3,] 2928886000 2368313000 2863148000 3285298000 3532447000 3339789000 [4,] 3011252000 2285174000 2623516000 2879617000 3121872000 3299861000 [5,] 2932895000 2163877000 2558136000 3220416000 3309250000 3193328000 [6,] 3069307000 2299241000 2898129000 3144280000 3215022000 3181266000 [7,] 2863923000 2275643000 2537720000 2940811000 2966778000 3193356000 [8,] 2585491000 2163091000 2543469000 2986507000 3010284000 2898282000 [9,] 2993900000 2416149000 2779739000 3153720000 3083824000 2929524000 [10,] 3023542000 2434553000 2884779000 2995806000 3257727000 3217311000 [11,] 2491370000 2281937000 2711624000 2990242000 3180374000 3126249000 [12,] 2341705000 2440464000 2817771000 2879837000 3036414000 3131083000 [,7] [,8] [1,] 3008058000 NA [2,] 2868318000 NA [3,] 3207495000 NA [4,] 3109336000 NA [5,] 3070725000 NA [6,] 2989963000 NA [7,] 3287552000 NA [8,] 2835238000 NA [9,] 3368961000 NA [10,] 3291689000 NA [11,] 3008536000 NA [12,] 2974109000 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 144970000 70233000 134127000 174519000 289686000 100963000 [2,] 29374000 171608000 473276000 226302000 394062000 272112000 [3,] 82366000 -83139000 -239632000 -405681000 -410575000 -39928000 [4,] -78357000 -121297000 -65380000 340799000 187378000 -106533000 [5,] 136412000 135364000 339993000 -76136000 -94228000 -12062000 [6,] -205384000 -23598000 -360409000 -203469000 -248244000 12090000 [7,] -278432000 -112552000 5749000 45696000 43506000 -295074000 [8,] 408409000 253058000 236270000 167213000 73540000 31242000 [9,] 29642000 18404000 105040000 -157914000 173903000 287787000 [10,] -532172000 -152616000 -173155000 -5564000 -77353000 -91062000 [11,] -149665000 158527000 106147000 -110405000 -143960000 4834000 [12,] -215233000 -184719000 66706000 -31138000 -69700000 -123025000 [,7] [,8] [1,] -139740000 NA [2,] 339177000 NA [3,] -98159000 NA [4,] -38611000 NA [5,] -80762000 NA [6,] 297589000 NA [7,] -452314000 NA [8,] 533723000 NA [9,] -77272000 NA [10,] -283153000 NA [11,] -34427000 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/1h4z41445104389.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/206f81445104389.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/3hxzs1445104389.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/470t11445104389.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] [1,] 2126472000 2196705000 2368313000 2285174000 2163877000 2898129000 [2,] 2505143500 2629095000 2896017000 2751566500 2745515500 2944046000 [3,] 2848699000 2899512000 3207495000 3011252000 3070725000 3069307000 [4,] 2925595500 3063336500 3312543500 3115604000 3206872000 3162773000 [5,] 3008058000 3138385000 3532447000 3299861000 3309250000 3215022000 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 2275643000 2163091000 2779739000 2884779000 2281937000 2341705000 [2,] 2700821500 2564480000 2854631500 2940292500 2601497000 2629117500 [3,] 2940811000 2835238000 2993900000 3023542000 2990242000 2879837000 [4,] 3080067000 2942394500 3118772000 3237519000 3067392500 3005261500 [5,] 3287552000 3010284000 3368961000 3291689000 3180374000 3131083000 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2597611849 2640189982 2958752094 2793854678 2795210341 2938686764 [2,] 3099786151 3158834018 3456237906 3228649322 3346239659 3199927236 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 2714331706 2609553557 2836159555 2846043129 2712016724 2655209871 [2,] 3167290294 3060922443 3151640445 3201040871 3268467276 3104464129 $out [1] 2299241000 2416149000 2434553000 $group [1] 6 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2126472000, 2505143500, 2848699000, 2925595500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b1mw1445104389.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] [1,] 70233000 29374000 -410575000 -121297000 -94228000 -360409000 -452314000 [2,] 85598000 198955000 -322656500 -92445000 -78449000 -226814000 -286753000 [3,] 134127000 272112000 -98159000 -65380000 -12062000 -203469000 -112552000 [4,] 159744500 366619500 -61533500 74383500 135888000 -5754000 24627500 [5,] 174519000 473276000 82366000 187378000 339993000 297589000 45696000 [,8] [,9] [,10] [,11] [,12] [1,] 31242000 -157914000 -283153000 -149665000 -215233000 [2,] 120376500 -29434000 -228154000 -127182500 -184719000 [3,] 236270000 29642000 -152616000 -34427000 -96362500 [4,] 330733500 139471500 -84207500 55490500 -31138000 [5,] 533723000 287787000 -5564000 158527000 66706000 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89847906 171985465 -254097443 -165007289 -140060599 -335482466 -298503411 [2,] 178406094 372238535 57779443 34247289 115936599 -71455534 73399411 [,8] [,9] [,10] [,11] [,12] [1,] 110648193 -71225640 -238578528 -143516369 -195427206 [2,] 361891807 130509640 -66653472 74662369 2702206 $out [1] 289686000 -139740000 340799000 -532172000 $group [1] 1 1 4 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(70233000, 85598000, 134127000, 159744500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rzsv1445104389.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] [1,] 2341705000 2126472000 2255745000 2879617000 2848699000 2898282000 [2,] 2670016500 2180291000 2540594500 2912644000 3023349000 3017195500 [3,] 2914199000 2283555500 2667570000 2993024000 3130128500 3156174500 [4,] 3002576000 2392231000 2840459500 3149000000 3236374500 3205333500 [5,] 3069307000 2440464000 2898129000 3285298000 3532447000 3339789000 [,7] [,8] [1,] 2835238000 NA [2,] 2982036000 NA [3,] 3039630500 NA [4,] 3247523500 NA [5,] 3368961000 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2762516380 2186888243 2530799561 2885220442 3032966139 3070363495 [2,] 3065881620 2380222757 2804340439 3100827558 3227290861 3241985505 [,7] [,8] [1,] 2918539869 NA [2,] 3160721131 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(2341705000, 2670016500, 2914199000, 3002576000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ddly1445104389.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,] 2692101000 2835238000 2715369500 [2,] 2802917714 2889674500 2825817125 [3,] 2885457929 2992071000 2912014750 [4,] 2965930357 3046424500 3020055625 [5,] 3075053714 3207495000 3104280250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2811106768 2920576273 2823421266 [2,] 2959809089 3063565727 3000608234 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2692101000, 2802917714.28571, 2885457928.57143, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1h4z41445104389.ps tmp/1h4z41445104389.png",intern=TRUE)) character(0) > try(system("convert tmp/206f81445104389.ps tmp/206f81445104389.png",intern=TRUE)) character(0) > try(system("convert tmp/3hxzs1445104389.ps tmp/3hxzs1445104389.png",intern=TRUE)) character(0) > try(system("convert tmp/470t11445104389.ps tmp/470t11445104389.png",intern=TRUE)) character(0) > try(system("convert tmp/5b1mw1445104389.ps tmp/5b1mw1445104389.png",intern=TRUE)) character(0) > try(system("convert tmp/6rzsv1445104389.ps tmp/6rzsv1445104389.png",intern=TRUE)) character(0) > try(system("convert tmp/7ddly1445104389.ps tmp/7ddly1445104389.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.482 0.409 2.921