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(411,2930,2773,2785,2789,2815,3034,3089,3035,3061,2951,2891,2817,2793,2805,2757,2786,2773,2609,2653,2537,2727,2558,2585,2558,2574,2561,2639,2450,2422,2559,2372,2359,2548,2534,2370,2540,2474,2390,2640,2523,2681,2666,2522,2646,2691,2729,2727,2731,2772,2911,2860,3003,397,2550,3038,3011,3082,3192,3143,3033,3211,3170,3293,3039,3038,3067,2974,3059,2859,2727,2560,2652,2571,2499,2601,2577,2498,2539,2493,2533,2461,2488,2724,2486,2389,2442,2402,2436,2477,2311,2498,2369,2576,2604,2543,2679,2469,2503,2571,2565,2743,2598,2590,2787,2753,772,1992,2816,2739,2708,2708,2853,2794,2750,2713,2762,2769,2660,2691,2705,2591,2608,2610,2527,2616,2618,2555,2505,2492,2428,2439,2477,2650,2560,2803,2641,2483,2520,2406,2454,2629) > par1 = '52' > par1 <- '52' > #'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] 142 > (np <- floor(n / par1)) [1] 2 > 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] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 [39] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > arr [,1] [,2] [,3] [1,] 411 3003 2787 [2,] 2930 397 2753 [3,] 2773 2550 772 [4,] 2785 3038 1992 [5,] 2789 3011 2816 [6,] 2815 3082 2739 [7,] 3034 3192 2708 [8,] 3089 3143 2708 [9,] 3035 3033 2853 [10,] 3061 3211 2794 [11,] 2951 3170 2750 [12,] 2891 3293 2713 [13,] 2817 3039 2762 [14,] 2793 3038 2769 [15,] 2805 3067 2660 [16,] 2757 2974 2691 [17,] 2786 3059 2705 [18,] 2773 2859 2591 [19,] 2609 2727 2608 [20,] 2653 2560 2610 [21,] 2537 2652 2527 [22,] 2727 2571 2616 [23,] 2558 2499 2618 [24,] 2585 2601 2555 [25,] 2558 2577 2505 [26,] 2574 2498 2492 [27,] 2561 2539 2428 [28,] 2639 2493 2439 [29,] 2450 2533 2477 [30,] 2422 2461 2650 [31,] 2559 2488 2560 [32,] 2372 2724 2803 [33,] 2359 2486 2641 [34,] 2548 2389 2483 [35,] 2534 2442 2520 [36,] 2370 2402 2406 [37,] 2540 2436 2454 [38,] 2474 2477 2629 [39,] 2390 2311 NA [40,] 2640 2498 NA [41,] 2523 2369 NA [42,] 2681 2576 NA [43,] 2666 2604 NA [44,] 2522 2543 NA [45,] 2646 2679 NA [46,] 2691 2469 NA [47,] 2729 2503 NA [48,] 2727 2571 NA [49,] 2731 2565 NA [50,] 2772 2743 NA [51,] 2911 2598 NA [52,] 2860 2590 NA > darr [,1] [,2] [,3] [1,] 2519 -2606 -34 [2,] -157 2153 -1981 [3,] 12 488 1220 [4,] 4 -27 824 [5,] 26 71 -77 [6,] 219 110 -31 [7,] 55 -49 0 [8,] -54 -110 145 [9,] 26 178 -59 [10,] -110 -41 -44 [11,] -60 123 -37 [12,] -74 -254 49 [13,] -24 -1 7 [14,] 12 29 -109 [15,] -48 -93 31 [16,] 29 85 14 [17,] -13 -200 -114 [18,] -164 -132 17 [19,] 44 -167 2 [20,] -116 92 -83 [21,] 190 -81 89 [22,] -169 -72 2 [23,] 27 102 -63 [24,] -27 -24 -50 [25,] 16 -79 -13 [26,] -13 41 -64 [27,] 78 -46 11 [28,] -189 40 38 [29,] -28 -72 173 [30,] 137 27 -90 [31,] -187 236 243 [32,] -13 -238 -162 [33,] 189 -97 -158 [34,] -14 53 37 [35,] -164 -40 -114 [36,] 170 34 48 [37,] -66 41 175 [38,] -84 -166 NA [39,] 250 187 NA [40,] -117 -129 NA [41,] 158 207 NA [42,] -15 28 NA [43,] -144 -61 NA [44,] 124 136 NA [45,] 45 -210 NA [46,] 38 34 NA [47,] -2 68 NA [48,] 4 -6 NA [49,] 41 178 NA [50,] 139 -145 NA [51,] -51 -8 NA [52,] 143 197 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/1bj041413144643.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/21y471413144643.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/39yk91413144643.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/4s0ln1413144643.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,] 411 397.0 772.0 1992.0 2789.0 2739.0 2708 2708.0 2853 2794.0 2750.0 [2,] 1599 1575.0 1661.0 2388.5 2802.5 2777.0 2871 2898.5 2943 2927.5 2850.5 [3,] 2787 2753.0 2550.0 2785.0 2816.0 2815.0 3034 3089.0 3033 3061.0 2951.0 [4,] 2895 2841.5 2661.5 2911.5 2913.5 2948.5 3113 3116.0 3034 3136.0 3060.5 [5,] 3003 2930.0 2773.0 3038.0 3011.0 3082.0 3192 3143.0 3035 3211.0 3170.0 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 2713 2762.0 2769.0 2660.0 2691.0 2705.0 2591 2608.0 2560.0 2527.0 2571.0 [2,] 2802 2789.5 2781.0 2732.5 2724.0 2745.5 2682 2608.5 2585.0 2532.0 2593.5 [3,] 2891 2817.0 2793.0 2805.0 2757.0 2786.0 2773 2609.0 2610.0 2537.0 2616.0 [4,] 3092 2928.0 2915.5 2936.0 2865.5 2922.5 2816 2668.0 2631.5 2594.5 2671.5 [5,] 3293 3039.0 3038.0 3067.0 2974.0 3059.0 2859 2727.0 2653.0 2652.0 2727.0 [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [1,] 2499.0 2555 2505.0 2492 2428.0 2439 2450.0 2422.0 2488.0 2372.0 2359.0 [2,] 2528.5 2570 2531.5 2495 2483.5 2466 2463.5 2441.5 2523.5 2548.0 2422.5 [3,] 2558.0 2585 2558.0 2498 2539.0 2493 2477.0 2461.0 2559.0 2724.0 2486.0 [4,] 2588.0 2593 2567.5 2536 2550.0 2566 2505.0 2555.5 2559.5 2763.5 2563.5 [5,] 2618.0 2601 2577.0 2574 2561.0 2639 2533.0 2650.0 2560.0 2803.0 2641.0 [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [1,] 2389.0 2442 2370 2436 2474.0 2311.0 2498 2369 2576.0 2604 2522.0 [2,] 2436.0 2481 2386 2445 2475.5 2311.0 2498 2369 2576.0 2604 2522.0 [3,] 2483.0 2520 2402 2454 2477.0 2350.5 2569 2446 2628.5 2635 2532.5 [4,] 2515.5 2527 2404 2497 2553.0 2390.0 2640 2523 2681.0 2666 2543.0 [5,] 2548.0 2534 2406 2540 2629.0 2390.0 2640 2523 2681.0 2666 2543.0 [,45] [,46] [,47] [,48] [,49] [,50] [,51] [,52] [1,] 2646.0 2469 2503 2571 2565 2743.0 2598.0 2590 [2,] 2646.0 2469 2503 2571 2565 2743.0 2598.0 2590 [3,] 2662.5 2580 2616 2649 2648 2757.5 2754.5 2725 [4,] 2679.0 2691 2729 2727 2731 2772.0 2911.0 2860 [5,] 2679.0 2691 2729 2727 2731 2772.0 2911.0 2860 $n [1] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 [39] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1604.771 1597.682 1637.33 2307.912 2714.744 2658.555 2813.244 2890.594 [2,] 3969.229 3908.318 3462.67 3262.088 2917.256 2971.445 3254.756 3287.406 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 2949.989 2870.804 2759.435 2626.458 2690.658 2670.307 2619.365 2627.922 [2,] 3116.011 3251.196 3142.565 3155.542 2943.342 2915.693 2990.635 2886.078 [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 2624.538 2650.763 2554.723 2567.582 2479.987 2544.847 2503.723 2564.019 [2,] 2947.462 2895.237 2663.277 2652.418 2594.013 2687.153 2612.277 2605.981 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] 2525.16 2460.599 2478.338 2401.779 2439.143 2357.008 2526.16 2527.418 [2,] 2590.84 2535.401 2599.662 2584.221 2514.857 2564.992 2591.84 2920.582 [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [1,] 2357.378 2410.479 2478.038 2385.58 2406.565 2406.303 2262.239 2410.354 [2,] 2614.622 2555.521 2561.962 2418.42 2501.435 2547.697 2438.761 2727.646 [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 2273.947 2511.191 2565.732 2509.038 2625.631 2331.975 2363.506 2474.712 [2,] 2618.053 2745.809 2704.268 2555.962 2699.369 2828.025 2868.494 2823.288 [,49] [,50] [,51] [,52] [1,] 2462.54 2725.1 2404.807 2423.348 [2,] 2833.46 2789.9 3104.193 3026.652 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" "49" "50" "51" "52" Warning message: In bxp(list(stats = c(411, 1599, 2787, 2895, 3003, 397, 1575, 2753, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gkhs1413144643.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,] -2606.0 -1981 12 -27.0 -77.0 -31.0 -49.0 -110.0 -59.0 -110.0 -60.0 [2,] -1320.0 -1069 250 -11.5 -25.5 39.5 -24.5 -82.0 -16.5 -77.0 -48.5 [3,] -34.0 -157 488 4.0 26.0 110.0 0.0 -54.0 26.0 -44.0 -37.0 [4,] 1242.5 998 854 414.0 48.5 164.5 27.5 45.5 102.0 -42.5 43.0 [5,] 2519.0 2153 1220 824.0 71.0 219.0 55.0 145.0 178.0 -41.0 123.0 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] -254.0 -24.0 -109.0 -93.0 14.0 -200.0 -164.0 -167.0 -116.0 -81.0 -169.0 [2,] -164.0 -12.5 -48.5 -70.5 21.5 -157.0 -148.0 -82.5 -99.5 4.0 -120.5 [3,] -74.0 -1.0 12.0 -48.0 29.0 -114.0 -132.0 2.0 -83.0 89.0 -72.0 [4,] -12.5 3.0 20.5 -8.5 57.0 -63.5 -57.5 23.0 4.5 139.5 -35.0 [5,] 49.0 7.0 29.0 31.0 85.0 -13.0 17.0 44.0 92.0 190.0 2.0 [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [1,] -63.0 -50.0 -79.0 -64.0 -46.0 -189.0 -72.0 -90.0 -187.0 -238.0 -158.0 [2,] -18.0 -38.5 -46.0 -38.5 -17.5 -75.5 -50.0 -31.5 24.5 -200.0 -127.5 [3,] 27.0 -27.0 -13.0 -13.0 11.0 38.0 -28.0 27.0 236.0 -162.0 -97.0 [4,] 64.5 -25.5 1.5 14.0 44.5 39.0 72.5 82.0 239.5 -87.5 46.0 [5,] 102.0 -24.0 16.0 41.0 78.0 40.0 173.0 137.0 243.0 -13.0 189.0 [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [1,] -14.0 -164 34 -66.0 -166 187.0 -129 158.0 -15.0 -144.0 124 -210.0 [2,] 11.5 -139 41 -12.5 -166 187.0 -129 158.0 -15.0 -144.0 124 -210.0 [3,] 37.0 -114 48 41.0 -125 218.5 -123 182.5 6.5 -102.5 130 -82.5 [4,] 45.0 -77 109 108.0 -84 250.0 -117 207.0 28.0 -61.0 136 45.0 [5,] 53.0 -40 170 175.0 -84 250.0 -117 207.0 28.0 -61.0 136 45.0 [,46] [,47] [,48] [,49] [,50] [,51] [,52] [1,] 34 -2 -6 41.0 -145 -51.0 143 [2,] 34 -2 -6 41.0 -145 -51.0 143 [3,] 36 33 -1 109.5 -3 -29.5 170 [4,] 38 68 4 178.0 139 -8.0 197 [5,] 38 68 4 178.0 139 -8.0 197 $n [1] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 [39] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2371.547 -2042.545 -62.97691 -384.1468 -41.50379 -4.026678 -47.4351 [2,] 2303.547 1728.545 1038.97691 392.1468 93.50379 224.026678 47.4351 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] -170.30721 -82.09729 -75.47136 -120.46753 -212.20033 -15.13931 -50.94273 [2,] 62.30721 134.09729 -12.52864 46.46753 64.20033 13.13931 74.94273 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] -104.557232 -3.383577 -199.29196 -214.55531 -94.23852 -177.8702 -34.60492 [2,] 8.557232 61.383577 -28.70804 -49.44469 98.23852 11.8702 212.60492 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] -149.994248 -48.25761 -38.85877 -56.33014 -60.8912 -45.55723 -66.44844 [2,] 5.994248 102.25761 -15.14123 30.33014 34.8912 67.55723 142.44844 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -139.74614 -76.53622 39.87411 -264.62401 -255.26903 6.44085 -170.55723 [2,] 83.74614 130.53622 432.12589 -59.37599 61.26903 67.55915 -57.44277 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] -14.03051 -68.92172 -216.61275 148.1146 -136.4067 127.7558 -41.54083 [2,] 110.03051 150.92172 -33.38725 288.8854 -109.5933 237.2442 54.54083 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] -195.229983 116.5933 -367.3933 31.53109 -45.20601 -12.17229 -43.56033 [2,] -9.770017 143.4067 202.3933 40.46891 111.20601 10.17229 262.56033 [,50] [,51] [,52] [1,] -320.293 -77.54083 109.6696 [2,] 314.293 18.54083 230.3304 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" "49" "50" "51" "52" Warning message: In bxp(list(stats = c(-2606, -1320, -34, 1242.5, 2519, -1981, -1069, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hrzr1413144643.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] [1,] 2359.0 2311.0 2406.0 [2,] 2544.0 2495.5 2505.0 [3,] 2673.5 2576.5 2623.5 [4,] 2791.0 3007.0 2739.0 [5,] 3089.0 3293.0 2853.0 $n [1] 52 52 38 $conf [,1] [,2] [,3] [1,] 2619.381 2464.427 2563.523 [2,] 2727.619 2688.573 2683.477 $out [1] 411 397 772 1992 $group [1] 1 2 3 3 $names [1] "1" "2" NA Warning message: In bxp(list(stats = c(2359, 2544, 2673.5, 2791, 3089, 2311, 2495.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7sw0a1413144643.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,] 2350.500 2350.50 2161.250 [2,] 2516.167 2534.75 2514.875 [3,] 2611.833 2622.25 2622.250 [4,] 2782.417 2785.50 2776.125 [5,] 3022.000 3089.00 3031.750 $n [1] 52 52 52 $conf [,1] [,2] [,3] [1,] 2553.496 2567.309 2565.008 [2,] 2670.170 2677.191 2679.492 $out [1] 2067.000 2026.667 2031.667 $group [1] 1 1 1 $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1bj041413144643.ps tmp/1bj041413144643.png",intern=TRUE)) character(0) > try(system("convert tmp/21y471413144643.ps tmp/21y471413144643.png",intern=TRUE)) character(0) > try(system("convert tmp/39yk91413144643.ps tmp/39yk91413144643.png",intern=TRUE)) character(0) > try(system("convert tmp/4s0ln1413144643.ps tmp/4s0ln1413144643.png",intern=TRUE)) character(0) > try(system("convert tmp/5gkhs1413144643.ps tmp/5gkhs1413144643.png",intern=TRUE)) character(0) > try(system("convert tmp/6hrzr1413144643.ps tmp/6hrzr1413144643.png",intern=TRUE)) character(0) > try(system("convert tmp/7sw0a1413144643.ps tmp/7sw0a1413144643.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.578 0.448 3.055