R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(2443.6,2460.2,2448.2,2470.4,2484.7,2466.8,2487.9,2508.4,2510.5,2497.4,2532.5,2556.8,2561,2547.3,2541.5,2558.5,2587.9,2580.5,2579.6,2589.3,2595,2595.6,2588.8,2591.7,2601.7,2585.4,2573.3,2597.4,2600.6,2570.6,2569.4,2584.9,2608.8,2617.2,2621,2540.5,2554.5,2601.9,2623,2640.7,2640.7,2619.8,2624.2,2638.2,2645.7,2679.6,2669,2664.6,2663.3,2667.4,2653.2,2630.8,2626.6,2641.9,2625.8,2606,2594.4,2583.6,2588.7,2600.3,2579.5,2576.6,2597.8,2595.6,2599,2621.7,2645.6,2644.2,2625.6,2624.6,2596.2,2599.5,2584.1,2570.8,2555,2574.5,2576.7,2579,2588.7,2601.1,2575.7,2559.5,2561.1,2528.3,2514.7,2558.5,2553.3,2577.1,2566,2549.5,2527.8,2540.9,2534.2,2538,2559,2554.9,2575.5,2546.5,2561.6,2546.6,2502.9,2463.1,2472.6,2463.5,2446.3,2456.2,2471.5,2447.5,2428.6,2420.2,2414.9,2420.2,2423.8,2407,2388.7,2409.6,2392,2380.2,2423.3,2451.6,2440.8,2432.9,2413.6,2391.6,2358.1,2345.4,2384.4,2384.4,2384.4,2418.7,2420,2493.1,2493.1,2492.8) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (n <- length(x)) [1] 134 > (np <- floor(n / par1)) [1] 11 > 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] 12 12 11 11 11 11 11 11 11 11 11 11 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 2443.6 2561.0 2601.7 2554.5 2663.3 2579.5 2584.1 2514.7 2575.5 2428.6 [2,] 2460.2 2547.3 2585.4 2601.9 2667.4 2576.6 2570.8 2558.5 2546.5 2420.2 [3,] 2448.2 2541.5 2573.3 2623.0 2653.2 2597.8 2555.0 2553.3 2561.6 2414.9 [4,] 2470.4 2558.5 2597.4 2640.7 2630.8 2595.6 2574.5 2577.1 2546.6 2420.2 [5,] 2484.7 2587.9 2600.6 2640.7 2626.6 2599.0 2576.7 2566.0 2502.9 2423.8 [6,] 2466.8 2580.5 2570.6 2619.8 2641.9 2621.7 2579.0 2549.5 2463.1 2407.0 [7,] 2487.9 2579.6 2569.4 2624.2 2625.8 2645.6 2588.7 2527.8 2472.6 2388.7 [8,] 2508.4 2589.3 2584.9 2638.2 2606.0 2644.2 2601.1 2540.9 2463.5 2409.6 [9,] 2510.5 2595.0 2608.8 2645.7 2594.4 2625.6 2575.7 2534.2 2446.3 2392.0 [10,] 2497.4 2595.6 2617.2 2679.6 2583.6 2624.6 2559.5 2538.0 2456.2 2380.2 [11,] 2532.5 2588.8 2621.0 2669.0 2588.7 2596.2 2561.1 2559.0 2471.5 2423.3 [12,] 2556.8 2591.7 2540.5 2664.6 2600.3 2599.5 2528.3 2554.9 2447.5 2451.6 [,11] [,12] [1,] 2440.8 2493.1 [2,] 2432.9 2492.8 [3,] 2413.6 NA [4,] 2391.6 NA [5,] 2358.1 NA [6,] 2345.4 NA [7,] 2384.4 NA [8,] 2384.4 NA [9,] 2384.4 NA [10,] 2418.7 NA [11,] 2420.0 NA [12,] 2493.1 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 16.6 -13.7 -16.3 47.4 4.1 -2.9 -13.3 43.8 -29.0 -8.4 -7.9 -0.3 [2,] -12.0 -5.8 -12.1 21.1 -14.2 21.2 -15.8 -5.2 15.1 -5.3 -19.3 NA [3,] 22.2 17.0 24.1 17.7 -22.4 -2.2 19.5 23.8 -15.0 5.3 -22.0 NA [4,] 14.3 29.4 3.2 0.0 -4.2 3.4 2.2 -11.1 -43.7 3.6 -33.5 NA [5,] -17.9 -7.4 -30.0 -20.9 15.3 22.7 2.3 -16.5 -39.8 -16.8 -12.7 NA [6,] 21.1 -0.9 -1.2 4.4 -16.1 23.9 9.7 -21.7 9.5 -18.3 39.0 NA [7,] 20.5 9.7 15.5 14.0 -19.8 -1.4 12.4 13.1 -9.1 20.9 0.0 NA [8,] 2.1 5.7 23.9 7.5 -11.6 -18.6 -25.4 -6.7 -17.2 -17.6 0.0 NA [9,] -13.1 0.6 8.4 33.9 -10.8 -1.0 -16.2 3.8 9.9 -11.8 34.3 NA [10,] 35.1 -6.8 3.8 -10.6 5.1 -28.4 1.6 21.0 15.3 43.1 1.3 NA [11,] 24.3 2.9 -80.5 -4.4 11.6 3.3 -32.8 -4.1 -24.0 28.3 73.1 NA [12,] 4.2 10.0 14.0 -1.3 -20.8 -15.4 -13.6 20.6 -18.9 -10.8 0.0 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/1i7mh1470695579.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/2hrn11470695579.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/3a6vy1470695579.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/4po0v1470695579.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] [1,] 2428.60 2420.2 2413.60 2391.6 2358.1 2345.40 2384.40 2384.40 2384.4 2380.2 [2,] 2468.35 2476.5 2494.85 2508.5 2493.8 2464.95 2480.25 2485.95 2478.4 2476.8 [3,] 2557.75 2552.9 2555.00 2574.5 2576.7 2570.60 2569.40 2584.90 2575.7 2559.5 [4,] 2581.80 2581.0 2585.55 2596.5 2599.8 2600.15 2606.45 2603.55 2601.9 2606.4 [5,] 2663.30 2667.4 2653.20 2640.7 2640.7 2641.90 2645.60 2644.20 2645.7 2679.6 [,11] [,12] [1,] 2420.0 2447.5 [2,] 2502.0 2510.7 [3,] 2561.1 2554.9 [4,] 2592.5 2595.6 [5,] 2669.0 2664.6 $n [1] 12 12 11 11 11 11 11 11 11 11 11 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2506.005 2505.237 2511.792 2532.578 2526.203 2506.192 2509.28 2528.877 [2,] 2609.495 2600.563 2598.208 2616.422 2627.197 2635.008 2629.52 2640.923 [,9] [,10] [,11] [,12] [1,] 2516.866 2497.76 2517.987 2514.455 [2,] 2634.534 2621.24 2604.213 2595.345 $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(2428.6, 2468.35, 2557.75, 2581.8, 2663.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5jil31470695579.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] [1,] -29.00 -19.30 -22.40 -11.10 -39.80 -21.70 -19.80 -25.4 -16.20 -28.40 [2,] -13.50 -13.15 -8.60 -7.65 -19.40 -8.65 -0.70 -17.4 -11.30 -2.75 [3,] -5.40 -5.80 17.00 2.20 -16.50 4.40 12.40 -6.7 0.60 3.80 [4,] 10.35 4.95 20.85 3.50 -2.55 15.40 14.75 3.9 9.15 18.15 [5,] 43.80 21.20 24.10 14.30 22.70 39.00 20.90 23.9 34.30 43.10 [,11] [,12] [1,] -32.80 -20.8 [2,] -14.20 -14.5 [3,] 2.90 -1.3 [4,] 17.95 7.1 [5,] 28.30 20.6 $n [1] 12 11 11 11 11 11 11 11 11 11 11 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -16.278145 -14.422621 2.970376 -3.111725 -24.527137 -7.05713 5.039807 [2,] 5.478145 2.822621 31.029624 7.511725 -8.472863 15.85713 19.760193 [,8] [,9] [,10] [,11] [,12] [1,] -16.847063 -9.142133 -6.156508 -12.41587 -11.589979 [2,] 3.447063 10.342133 13.756508 18.21587 8.989979 $out [1] 47.4 29.4 -43.7 -33.5 -80.5 73.1 $group [1] 1 4 4 4 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-29, -13.4999999999998, -5.40000000000009, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6lfp31470695579.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,] 2443.60 2541.50 2540.50 2601.90 2583.60 2576.60 2555.00 2514.70 2446.30 [2,] 2463.50 2559.75 2571.95 2621.40 2597.35 2595.90 2560.30 2536.10 2459.65 [3,] 2486.30 2584.20 2591.40 2639.45 2626.20 2599.25 2575.10 2551.40 2472.05 [4,] 2509.45 2590.50 2605.25 2655.15 2647.55 2625.10 2581.55 2558.75 2546.55 [5,] 2556.80 2595.60 2621.00 2679.60 2667.40 2645.60 2601.10 2577.10 2575.50 [,10] [,11] [,12] [1,] 2380.20 2345.40 2492.80 [2,] 2399.50 2384.40 2492.80 [3,] 2417.55 2402.60 2492.95 [4,] 2423.55 2426.45 2493.10 [5,] 2451.60 2440.80 2493.10 $n [1] 12 12 12 12 12 12 12 12 12 12 12 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2465.342 2570.175 2576.212 2624.056 2603.303 2585.932 2565.408 2541.069 [2,] 2507.258 2598.225 2606.588 2654.844 2649.097 2612.568 2584.792 2561.731 [,9] [,10] [,11] [,12] [1,] 2432.414 2406.581 2383.421 2492.615 [2,] 2511.686 2428.519 2421.779 2493.285 $out [1] 2554.5 2528.3 2493.1 $group [1] 4 7 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" NA Warning message: In bxp(list(stats = c(2443.6, 2463.5, 2486.3, 2509.45, 2556.8, 2541.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/76imx1470695579.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,] 2531.391 2552.900 2530.688 [2,] 2537.105 2556.375 2536.350 [3,] 2540.273 2565.250 2542.475 [4,] 2544.268 2575.100 2547.025 [5,] 2548.282 2584.900 2553.150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2537.005 2556.709 2537.606 [2,] 2543.540 2573.791 2547.344 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2531.39090909091, 2537.10454545455, 2540.27272727273, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1i7mh1470695579.ps tmp/1i7mh1470695579.png",intern=TRUE)) character(0) > try(system("convert tmp/2hrn11470695579.ps tmp/2hrn11470695579.png",intern=TRUE)) character(0) > try(system("convert tmp/3a6vy1470695579.ps tmp/3a6vy1470695579.png",intern=TRUE)) character(0) > try(system("convert tmp/4po0v1470695579.ps tmp/4po0v1470695579.png",intern=TRUE)) character(0) > try(system("convert tmp/5jil31470695579.ps tmp/5jil31470695579.png",intern=TRUE)) character(0) > try(system("convert tmp/6lfp31470695579.ps tmp/6lfp31470695579.png",intern=TRUE)) character(0) > try(system("convert tmp/76imx1470695579.ps tmp/76imx1470695579.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.519 0.238 2.799