R version 3.0.3 (2014-03-06) -- "Warm Puppy" Copyright (C) 2014 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(3477,2685,2438,1692,4054,3946,3623,2455,2362,2791,2369,3438,3682,2801,2563,3108,2890,3940,4036,1514,3461,2980,2728,3891,3715,2843,1416,2657,1856,2441,3172,2813,3335,2608,5784,4726,3817,2755,2541,3154,2684,3732,4286,2394,1698,3945,2549,3943,3899,2783,2660,1848,4482,4157,4404,2686,2593,3254,2664,4203,3985,2861,2758,1968,4666,4226,4748,2767,2723,3297,2758,4338) > 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,] 3477 3682 3715 3817 3899 3985 NA [2,] 2685 2801 2843 2755 2783 2861 NA [3,] 2438 2563 1416 2541 2660 2758 NA [4,] 1692 3108 2657 3154 1848 1968 NA [5,] 4054 2890 1856 2684 4482 4666 NA [6,] 3946 3940 2441 3732 4157 4226 NA [7,] 3623 4036 3172 4286 4404 4748 NA [8,] 2455 1514 2813 2394 2686 2767 NA [9,] 2362 3461 3335 1698 2593 2723 NA [10,] 2791 2980 2608 3945 3254 3297 NA [11,] 2369 2728 5784 2549 2664 2758 NA [12,] 3438 3891 4726 3943 4203 4338 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -792 -881 -872 -1062 -1116 -1124 NA [2,] -247 -238 -1427 -214 -123 -103 NA [3,] -746 545 1241 613 -812 -790 NA [4,] 2362 -218 -801 -470 2634 2698 NA [5,] -108 1050 585 1048 -325 -440 NA [6,] -323 96 731 554 247 522 NA [7,] -1168 -2522 -359 -1892 -1718 -1981 NA [8,] -93 1947 522 -696 -93 -44 NA [9,] 429 -481 -727 2247 661 574 NA [10,] -422 -252 3176 -1396 -590 -539 NA [11,] 1069 1163 -1058 1394 1539 1580 NA [12,] 244 -176 -909 -44 -218 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/1a8jm1395094445.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/2kmjr1395094445.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/3vhx41395094445.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/4xjqk1395094445.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,] 3477 2685 2438 1692.0 1856 3732 3172 2394.0 1698 2608 2369 3438 [2,] 3682 2755 2438 1848.0 2684 3732 3623 2394.0 2362 2791 2549 3891 [3,] 3766 2792 2552 2312.5 3472 3943 4161 2570.5 2658 3117 2696 4073 [4,] 3899 2843 2660 3108.0 4482 4157 4404 2767.0 3335 3297 2758 4338 [5,] 3985 2861 2758 3154.0 4666 4226 4748 2813.0 3461 3945 2758 4726 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3626.028 2735.237 2408.803 1499.759 2312.232 3668.861 3657.23 2329.903 [2,] 3905.972 2848.763 2695.197 3125.241 4631.768 4217.139 4664.77 2811.097 [,9] [,10] [,11] [,12] [1,] 2030.384 2790.614 2561.188 3784.671 [2,] 3285.616 3443.386 2830.812 4361.329 $out [1] 1416 2441 1514 5784 $group [1] 3 6 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3477, 3682, 3766, 3899, 3985, 2685, 2755, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b5cw1395094445.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] [1,] -1124.0 -247 -812.0 -801 -440.0 -323.0 -2522 -696.0 -727.0 -590.0 1069.0 [2,] -1116.0 -247 -790.0 -470 -325.0 96.0 -1981 -93.0 -481.0 -590.0 1069.0 [3,] -971.5 -226 -100.5 1072 238.5 384.5 -1805 -68.5 501.5 -480.5 1278.5 [4,] -872.0 -123 613.0 2634 1048.0 554.0 -1168 522.0 661.0 -252.0 1539.0 [5,] -792.0 -103 1241.0 2698 1050.0 731.0 -359 522.0 2247.0 -252.0 1580.0 [,12] [1,] -218 [2,] -218 [3,] -176 [4,] -44 [5,] -44 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1128.8879 -305.984 -1005.4803 -930.1803 -647.1293 89.07521 -2329.411 [2,] -814.1121 -146.016 804.4803 3074.1803 1124.1293 679.92479 -1280.589 [,8] [,9] [,10] [,11] [,12] [1,] -465.1949 -235.1269 -698.5209 975.3348 -298.94796 [2,] 328.1949 1238.1269 -262.4791 1581.6652 -53.05204 $out [1] -1427 1947 3176 -1396 -1058 244 -909 $group [1] 2 8 10 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1124, -1116, -971.5, -872, -792, -247, -247, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65lpg1395094445.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,] 1692.0 1514.0 1416.0 1698.0 1848.0 1968 NA [2,] 2403.5 2764.5 2524.5 2545.0 2662.0 2758 NA [3,] 2738.0 3044.0 2828.0 2954.5 3018.5 3079 NA [4,] 3550.0 3786.5 3525.0 3880.0 4180.0 4282 NA [5,] 4054.0 4036.0 4726.0 4286.0 4482.0 4748 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2215.074 2577.859 2371.665 2345.598 2326.13 2383.893 NA [2,] 3260.926 3510.141 3284.335 3563.402 3710.87 3774.107 NA $out [1] 5784 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1692, 2403.5, 2738, 3550, 4054, 1514, 2764.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7r7471395094445.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,] 2396.000 2312.50 2436.625 [2,] 2566.750 2614.25 2621.062 [3,] 3143.917 2954.50 2931.562 [4,] 3751.417 3854.50 3864.250 [5,] 4089.833 4161.00 4104.125 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2603.582 2388.814 2364.536 [2,] 3684.251 3520.186 3498.589 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2396, 2566.75, 3143.91666666667, 3751.41666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1a8jm1395094445.ps tmp/1a8jm1395094445.png",intern=TRUE)) character(0) > try(system("convert tmp/2kmjr1395094445.ps tmp/2kmjr1395094445.png",intern=TRUE)) character(0) > try(system("convert tmp/3vhx41395094445.ps tmp/3vhx41395094445.png",intern=TRUE)) character(0) > try(system("convert tmp/4xjqk1395094445.ps tmp/4xjqk1395094445.png",intern=TRUE)) character(0) > try(system("convert tmp/5b5cw1395094445.ps tmp/5b5cw1395094445.png",intern=TRUE)) character(0) > try(system("convert tmp/65lpg1395094445.ps tmp/65lpg1395094445.png",intern=TRUE)) character(0) > try(system("convert tmp/7r7471395094445.ps tmp/7r7471395094445.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.249 1.588 9.883