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(3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.6,2070.83,2293.41,2443.27,2513.17,2466.92,2502.66,2539.91,2482.6,2626.15,2656.32,2446.66,2467.38,2462.32,2504.58,2579.39,2649.24,2636.87,2613.94,2634.01,2711.94,2646.43,2717.79,2701.54,2572.98,2488.92,2204.91,2123.99,2149.1,2036.71,2048.32,2159.56,2267.79,2313.55,2247.3,2134.43,2114,2236.94,2345.39,2422.4,2385.96,2378.17,2457.13,2527.67,2530.03,2604.92,2596.8,2713.2,2574.82,2611.98,2768.46,2785.61,2859.27,2880.53,2824.5) > 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,] 3844.49 1905.41 2539.91 2634.01 2159.56 2527.67 NA [2,] 3720.98 1810.99 2482.60 2711.94 2267.79 2530.03 NA [3,] 3674.40 1670.07 2626.15 2646.43 2313.55 2604.92 NA [4,] 3857.62 1864.44 2656.32 2717.79 2247.30 2596.80 NA [5,] 3801.06 2052.02 2446.66 2701.54 2134.43 2713.20 NA [6,] 3504.37 2029.60 2467.38 2572.98 2114.00 2574.82 NA [7,] 3032.60 2070.83 2462.32 2488.92 2236.94 2611.98 NA [8,] 3047.03 2293.41 2504.58 2204.91 2345.39 2768.46 NA [9,] 2962.34 2443.27 2579.39 2123.99 2422.40 2785.61 NA [10,] 2197.82 2513.17 2649.24 2149.10 2385.96 2859.27 NA [11,] 2014.45 2466.92 2636.87 2036.71 2378.17 2880.53 NA [12,] 1862.83 2502.66 2613.94 2048.32 2457.13 2824.50 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -123.51 -94.42 -57.31 77.93 108.23 2.36 NA [2,] -46.58 -140.92 143.55 -65.51 45.76 74.89 NA [3,] 183.22 194.37 30.17 71.36 -66.25 -8.12 NA [4,] -56.56 187.58 -209.66 -16.25 -112.87 116.40 NA [5,] -296.69 -22.42 20.72 -128.56 -20.43 -138.38 NA [6,] -471.77 41.23 -5.06 -84.06 122.94 37.16 NA [7,] 14.43 222.58 42.26 -284.01 108.45 156.48 NA [8,] -84.69 149.86 74.81 -80.92 77.01 17.15 NA [9,] -764.52 69.90 69.85 25.11 -36.44 73.66 NA [10,] -183.37 -46.25 -12.37 -112.39 -7.79 21.26 NA [11,] -151.62 35.74 -22.93 11.61 78.96 -56.03 NA [12,] 42.58 37.25 20.07 111.24 70.54 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/1ub9k1413815027.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/2d08j1413815027.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/3ao0b1413815027.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/4lblm1413815027.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,] 1905.41 1810.990 2313.550 1864.44 2052.02 2029.60 2070.83 2204.910 2123.99 [2,] 2159.56 2267.790 2313.550 2247.30 2134.43 2114.00 2236.94 2293.410 2422.40 [3,] 2533.79 2506.315 2615.535 2626.56 2574.10 2520.18 2475.62 2424.985 2511.33 [4,] 2634.01 2711.940 2646.430 2717.79 2713.20 2574.82 2611.98 2768.460 2785.61 [5,] 2634.01 2711.940 2646.430 2717.79 2713.20 2574.82 3032.60 3047.030 2962.34 [,10] [,11] [,12] [1,] 2149.100 2014.450 1862.830 [2,] 2197.820 2036.710 2048.320 [3,] 2449.565 2422.545 2479.895 [4,] 2649.240 2636.870 2613.940 [5,] 2859.270 2880.530 2824.500 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2227.754 2219.824 2400.817 2323.079 2200.775 2222.936 2233.707 2118.562 [2,] 2839.826 2792.806 2830.253 2930.041 2947.425 2817.424 2717.533 2731.408 [,9] [,10] [,11] [,12] [1,] 2277.048 2158.385 2035.422 2115.052 [2,] 2745.612 2740.745 2809.668 2844.738 $out [1] 3844.49 3720.98 3674.40 1670.07 3857.62 3801.06 3504.37 $group [1] 1 2 3 3 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1905.41, 2159.56, 2533.79, 2634.01, 2634.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55aev1413815027.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] [1,] -123.510 -140.92 -66.250 -209.660 -296.69 -84.06 14.430 -84.69 -36.44 [2,] -94.420 -65.51 -8.120 -112.870 -138.38 -84.06 14.430 -80.92 -36.44 [3,] -27.475 -0.41 50.765 -36.405 -75.49 16.05 75.355 45.98 47.48 [4,] 77.930 74.89 183.220 116.400 -20.43 41.23 156.480 77.01 69.90 [5,] 108.230 143.55 194.370 187.580 20.72 122.94 222.580 149.86 73.66 [,10] [,11] [,12] [1,] -183.37 -151.62 20.07 [2,] -112.39 -56.03 37.25 [3,] -29.31 -5.66 42.58 [4,] -7.79 35.74 70.54 [5,] 21.26 78.96 111.24 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -138.64632 -90.97253 -72.65548 -184.2916 -151.5715597 -64.7661 -16.27184 [2,] 83.69632 90.15253 174.18548 111.4816 0.5915597 96.8661 166.98184 [,8] [,9] [,10] [,11] [,12] [1,] -55.88995 -21.11273 -96.78038 -64.85461 19.05737 [2,] 147.84995 116.07273 38.16038 53.53461 66.10263 $out [1] -471.77 -284.01 -764.52 $group [1] 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-123.51, -94.4200000000001, -27.4749999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qlbr1413815027.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,] 1862.83 1670.070 2446.66 2036.710 2114.000 2527.670 NA [2,] 2580.08 1884.925 2474.99 2136.545 2198.250 2585.810 NA [3,] 3275.70 2061.425 2559.65 2530.950 2290.670 2662.590 NA [4,] 3761.02 2455.095 2631.51 2673.985 2382.065 2805.055 NA [5,] 3857.62 2513.170 2656.32 2717.790 2457.130 2880.530 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2737.065 1801.367 2488.26 2285.82 2206.831 2562.591 NA [2,] 3814.335 2321.483 2631.04 2776.08 2374.509 2762.589 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1862.83, 2580.08, 3275.7, 3761.02, 3857.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7nzxb1413815027.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,] 2384.897 2422.545 2358.229 [2,] 2471.512 2462.592 2409.196 [3,] 2548.346 2508.823 2449.318 [4,] 2595.548 2553.945 2509.162 [5,] 2656.712 2626.560 2580.836 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2491.773 2467.156 2403.723 [2,] 2604.919 2550.489 2494.913 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2384.89666666667, 2471.5125, 2548.34583333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ub9k1413815027.ps tmp/1ub9k1413815027.png",intern=TRUE)) character(0) > try(system("convert tmp/2d08j1413815027.ps tmp/2d08j1413815027.png",intern=TRUE)) character(0) > try(system("convert tmp/3ao0b1413815027.ps tmp/3ao0b1413815027.png",intern=TRUE)) character(0) > try(system("convert tmp/4lblm1413815027.ps tmp/4lblm1413815027.png",intern=TRUE)) character(0) > try(system("convert tmp/55aev1413815027.ps tmp/55aev1413815027.png",intern=TRUE)) character(0) > try(system("convert tmp/6qlbr1413815027.ps tmp/6qlbr1413815027.png",intern=TRUE)) character(0) > try(system("convert tmp/7nzxb1413815027.ps tmp/7nzxb1413815027.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.542 0.435 2.998