R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" 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(13566.7,13941.5,14964.1,14086,13505.1,15300.4,14725.2,12484.9,16082.6,15915.8,15916.1,15713,14746,15253.2,18384.3,16848.5,16485.5,19257.1,17093.4,15700.1,19124.3,18640.8,18439.2,17106.3,18347.7,19372.7,22263.8,19422.9,21268.6,20310,19256,17535.9,19857.4,19628.4,19727.5,18112.2,18889.3,20516.1,22317,19768.8,20015.8,20260.5,19434.3,17910,19134.4,20880.1,19680,17493.4,19087.8,19064.6,21191,20503.9,20364.1,19860.4,20924.1,17018.8,20607.4,21500.2,19868.3,18801.9,19787.5,19936.2,21047.6,21034.4,20132.8,20725.3,20827.8,16992.3,21818.2,21841.4,19252.2,17933.7) > 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] 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,] 13566.7 14746.0 18347.7 18889.3 19087.8 19787.5 NA [2,] 13941.5 15253.2 19372.7 20516.1 19064.6 19936.2 NA [3,] 14964.1 18384.3 22263.8 22317.0 21191.0 21047.6 NA [4,] 14086.0 16848.5 19422.9 19768.8 20503.9 21034.4 NA [5,] 13505.1 16485.5 21268.6 20015.8 20364.1 20132.8 NA [6,] 15300.4 19257.1 20310.0 20260.5 19860.4 20725.3 NA [7,] 14725.2 17093.4 19256.0 19434.3 20924.1 20827.8 NA [8,] 12484.9 15700.1 17535.9 17910.0 17018.8 16992.3 NA [9,] 16082.6 19124.3 19857.4 19134.4 20607.4 21818.2 NA [10,] 15915.8 18640.8 19628.4 20880.1 21500.2 21841.4 NA [11,] 15916.1 18439.2 19727.5 19680.0 19868.3 19252.2 NA [12,] 15713.0 17106.3 18112.2 17493.4 18801.9 17933.7 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 374.8 507.2 1025.0 1626.8 -23.2 148.7 NA [2,] 1022.6 3131.1 2891.1 1800.9 2126.4 1111.4 NA [3,] -878.1 -1535.8 -2840.9 -2548.2 -687.1 -13.2 NA [4,] -580.9 -363.0 1845.7 247.0 -139.8 -901.6 NA [5,] 1795.3 2771.6 -958.6 244.7 -503.7 592.5 NA [6,] -575.2 -2163.7 -1054.0 -826.2 1063.7 102.5 NA [7,] -2240.3 -1393.3 -1720.1 -1524.3 -3905.3 -3835.5 NA [8,] 3597.7 3424.2 2321.5 1224.4 3588.6 4825.9 NA [9,] -166.8 -483.5 -229.0 1745.7 892.8 23.2 NA [10,] 0.3 -201.6 99.1 -1200.1 -1631.9 -2589.2 NA [11,] -203.1 -1332.9 -1615.3 -2186.6 -1066.4 -1318.5 NA [12,] -967.0 1241.4 777.1 1594.4 985.6 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/1tukx1457363590.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/243wy1457363590.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/393fe1457363590.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/4tuvu1457363590.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] [1,] 13566.7 13941.50 14964.1 14086.00 13505.1 19257.10 14725.20 15700.10 [2,] 14746.0 15253.20 18384.3 16848.50 16485.5 19257.10 17093.40 15700.10 [3,] 18618.5 19218.65 21119.3 19595.85 20074.3 20060.45 19345.15 17005.55 [4,] 19087.8 19936.20 22263.8 20503.90 20364.1 20310.00 20827.80 17535.90 [5,] 19787.5 20516.10 22317.0 21034.40 21268.6 20725.30 20924.10 17910.00 [,9] [,10] [,11] [,12] [1,] 19124.3 15915.80 18439.2 15713.00 [2,] 19124.3 18640.80 18439.2 17106.30 [3,] 19495.9 20254.25 19466.1 17713.55 [4,] 20607.4 21500.20 19727.5 18112.20 [5,] 21818.2 21841.40 19868.3 18801.90 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15817.9 16197.96 18616.9 17238.0 17572.48 19381.3 16936.34 15821.4 [2,] 21419.1 22239.34 23621.7 21953.7 22576.12 20739.6 21753.96 18189.7 [,9] [,10] [,11] [,12] [1,] 18539.25 18409.84 18635.1 17064.71 [2,] 20452.55 22098.66 20297.1 18362.39 $out [1] 15300.4 12484.9 16082.6 15916.1 $group [1] 6 8 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(13566.7, 14746, 18618.5, 19087.8, 19787.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50i801457363590.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,] -23.2 1022.60 -2840.90 -901.6 -958.6 -2163.7 -3905.3 1224.4 -483.5 [2,] 148.7 1111.40 -2548.20 -580.9 -503.7 -1054.0 -3835.5 2321.5 -229.0 [3,] 441.0 1963.65 -1206.95 -251.4 418.6 -700.7 -1980.2 3506.4 -71.8 [4,] 1025.0 2891.10 -687.10 247.0 1795.3 102.5 -1524.3 3597.7 892.8 [5,] 1626.8 3131.10 -13.20 247.0 2771.6 1063.7 -1393.3 4825.9 1745.7 [,10] [,11] [,12] [1,] -2589.20 -2186.6 777.1 [2,] -1631.90 -1615.3 777.1 [3,] -700.85 -1325.7 985.6 [4,] 0.30 -1066.4 1241.4 [5,] 99.10 -1066.4 1594.4 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -124.2418 815.686 -2407.419612 -785.4222 -1064.329 -1446.67985 -3470.9986 [2,] 1006.2418 3111.614 -6.480388 282.6222 1901.529 45.27985 -489.4014 [,8] [,9] [,10] [,11] [,12] [1,] 2683.21 -795.3972 -1753.6717 -1679.7582 657.5268 [2,] 4329.59 651.7972 351.9717 -971.6418 1313.6732 $out [1] 1845.7 -203.1 -967.0 $group [1] 4 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-23.2000000000007, 148.700000000001, 441, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/680t41457363590.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,] 12484.90 14746.00 17535.90 17493.40 17018.80 17933.70 NA [2,] 13754.10 16092.80 18801.85 19011.85 19076.20 19519.85 NA [3,] 14844.65 17099.85 19525.65 19724.40 20116.20 20429.05 NA [4,] 15814.40 18540.00 20083.70 20388.30 20765.75 21041.00 NA [5,] 16082.60 19257.10 21268.60 22317.00 21500.20 21841.40 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 13904.93 15983.67 18940.99 19096.59 19345.58 19735.24 NA [2,] 15784.37 18216.03 20110.31 20352.21 20886.82 21122.86 NA $out [1] 22263.8 16992.3 $group [1] 3 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(12484.9, 13754.1, 14844.65, 15814.4, 16082.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7vm521457363590.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,] 16273.67 17713.55 16714.89 [2,] 17770.40 18918.58 17818.01 [3,] 18669.39 19481.00 18981.43 [4,] 19361.50 20067.38 19813.07 [5,] 20027.97 21119.30 20522.86 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 17943.68 18957.02 18071.46 [2,] 19395.10 20004.98 19891.39 $out [1] 17005.55 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16273.6666666667, 17770.4, 18669.3916666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tukx1457363590.ps tmp/1tukx1457363590.png",intern=TRUE)) character(0) > try(system("convert tmp/243wy1457363590.ps tmp/243wy1457363590.png",intern=TRUE)) character(0) > try(system("convert tmp/393fe1457363590.ps tmp/393fe1457363590.png",intern=TRUE)) character(0) > try(system("convert tmp/4tuvu1457363590.ps tmp/4tuvu1457363590.png",intern=TRUE)) character(0) > try(system("convert tmp/50i801457363590.ps tmp/50i801457363590.png",intern=TRUE)) character(0) > try(system("convert tmp/680t41457363590.ps tmp/680t41457363590.png",intern=TRUE)) character(0) > try(system("convert tmp/7vm521457363590.ps tmp/7vm521457363590.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.459 0.449 2.931