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(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,19155.9,19151,21318.2,20601.3,20496.8,19834.4,20997.6,17111.1,20752.3,21600.7,19939.5,18854.1,19697.4,19865,20930.3,20873.8,20007.5,20584.9,20604.1,16956.2,21731.2,21784.8,19280.6,17912.3,17904.8,19507.1,21188.7,20405.9,19214.4,21839.1,20030.6,16596.6,19996.3,20776.6,19003.1,18620.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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 18347.7 18889.3 19155.9 19697.4 17904.8 NA [2,] 19372.7 20516.1 19151.0 19865.0 19507.1 NA [3,] 22263.8 22317.0 21318.2 20930.3 21188.7 NA [4,] 19422.9 19768.8 20601.3 20873.8 20405.9 NA [5,] 21268.6 20015.8 20496.8 20007.5 19214.4 NA [6,] 20310.0 20260.5 19834.4 20584.9 21839.1 NA [7,] 19256.0 19434.3 20997.6 20604.1 20030.6 NA [8,] 17535.9 17910.0 17111.1 16956.2 16596.6 NA [9,] 19857.4 19134.4 20752.3 21731.2 19996.3 NA [10,] 19628.4 20880.1 21600.7 21784.8 20776.6 NA [11,] 19727.5 19680.0 19939.5 19280.6 19003.1 NA [12,] 18112.2 17493.4 18854.1 17912.3 18620.8 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1025.0 1626.8 -4.9 167.6 1602.3 NA [2,] 2891.1 1800.9 2167.2 1065.3 1681.6 NA [3,] -2840.9 -2548.2 -716.9 -56.5 -782.8 NA [4,] 1845.7 247.0 -104.5 -866.3 -1191.5 NA [5,] -958.6 244.7 -662.4 577.4 2624.7 NA [6,] -1054.0 -826.2 1163.2 19.2 -1808.5 NA [7,] -1720.1 -1524.3 -3886.5 -3647.9 -3434.0 NA [8,] 2321.5 1224.4 3641.2 4775.0 3399.7 NA [9,] -229.0 1745.7 848.4 53.6 780.3 NA [10,] 99.1 -1200.1 -1661.2 -2504.2 -1773.5 NA [11,] -1615.3 -2186.6 -1085.4 -1368.3 -382.3 NA [12,] 777.1 1662.5 843.3 -7.5 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/1u7x71476995947.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/2vrwb1476995947.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/3pmfp1476995947.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/4or951476995947.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,] 17904.8 19151.0 20930.3 19422.9 20007.5 19834.4 19256.0 16596.6 19134.4 [2,] 18347.7 19372.7 21188.7 19768.8 20007.5 20260.5 19434.3 16956.2 19857.4 [3,] 18889.3 19507.1 21318.2 20405.9 20015.8 20310.0 20030.6 17111.1 19996.3 [4,] 19155.9 19865.0 22263.8 20601.3 20496.8 20584.9 20604.1 17535.9 20752.3 [5,] 19697.4 20516.1 22317.0 20873.8 20496.8 20584.9 20997.6 17910.0 21731.2 [,10] [,11] [,12] [1,] 19628.4 19003.1 17493.4 [2,] 20776.6 19280.6 17912.3 [3,] 20880.1 19680.0 18112.2 [4,] 21600.7 19727.5 18620.8 [5,] 21784.8 19939.5 18854.1 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 18318.23 19159.24 20558.54 19817.66 19670.06 20080.78 19204.02 16701.49 [2,] 19460.37 19854.96 22077.86 20994.14 20361.54 20539.22 20857.18 17520.71 [,9] [,10] [,11] [,12] [1,] 19363.97 20297.79 19364.22 17611.58 [2,] 20628.63 21462.41 19995.78 18612.82 $out [1] 21268.6 19214.4 21839.1 $group [1] 5 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(17904.8, 18347.7, 18889.3, 19155.9, 19697.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mh251476995947.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,] -4.9 1065.3 -2840.9 -1191.5 -958.6 -1808.5 -3886.5 1224.4 -229.0 -2504.2 [2,] 167.6 1681.6 -2548.2 -866.3 -662.4 -1054.0 -3647.9 2321.5 53.6 -1773.5 [3,] 1025.0 1800.9 -782.8 -104.5 244.7 -826.2 -3434.0 3399.7 780.3 -1661.2 [4,] 1602.3 2167.2 -716.9 247.0 577.4 19.2 -1720.1 3641.2 848.4 -1200.1 [5,] 1626.8 2891.1 -56.5 1845.7 577.4 1163.2 -1524.3 4775.0 1745.7 -1200.1 [,11] [,12] [1,] -2186.6 -7.5 [2,] -1615.3 384.8 [3,] -1368.3 810.2 [4,] -1085.4 1252.9 [5,] -382.3 1662.5 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 11.24459 1457.776 -2076.792 -891.155 -631.3396 -1584.52042 -4796.179 [2,] 2038.75541 2144.024 511.192 682.155 1120.7396 -67.87958 -2071.821 [,8] [,9] [,10] [,11] [,12] [1,] 2467.203 218.6963 -2066.363 -1742.726 124.401 [2,] 4332.197 1341.9037 -1256.037 -993.874 1495.999 $out [1] 2624.7 99.1 $group [1] 5 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4.90000000000146, 167.599999999999, 1025, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6yl1u1476995947.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] [1,] 17535.90 17493.40 17111.10 17912.30 16596.60 NA [2,] 18801.85 19011.85 19153.45 19489.00 18811.95 NA [3,] 19525.65 19724.40 20218.15 20296.20 19751.70 NA [4,] 20083.70 20388.30 20874.95 20902.05 20591.25 NA [5,] 21268.60 22317.00 21600.70 21784.80 21839.10 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 18940.99 19096.59 19432.96 19651.7 18940.15 NA [2,] 20110.31 20352.21 21003.34 20940.7 20563.25 NA $out [1] 22263.8 16956.2 $group [1] 1 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(17535.9, 18801.85, 19525.65, 20083.7, 21268.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7zaun1476995947.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,] 18198.56 18112.20 18266.55 [2,] 19162.58 19198.20 19127.93 [3,] 20132.57 20006.05 20102.12 [4,] 20430.05 20357.95 20363.78 [5,] 21603.60 21318.20 21726.25 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 19554.47 19477.08 19538.45 [2,] 20710.67 20535.02 20665.80 $out [1] 17221.96 17111.10 17246.05 $group [1] 1 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(18198.56, 19162.58, 20132.57, 20430.05, 21603.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1u7x71476995947.ps tmp/1u7x71476995947.png",intern=TRUE)) character(0) > try(system("convert tmp/2vrwb1476995947.ps tmp/2vrwb1476995947.png",intern=TRUE)) character(0) > try(system("convert tmp/3pmfp1476995947.ps tmp/3pmfp1476995947.png",intern=TRUE)) character(0) > try(system("convert tmp/4or951476995947.ps tmp/4or951476995947.png",intern=TRUE)) character(0) > try(system("convert tmp/5mh251476995947.ps tmp/5mh251476995947.png",intern=TRUE)) character(0) > try(system("convert tmp/6yl1u1476995947.ps tmp/6yl1u1476995947.png",intern=TRUE)) character(0) > try(system("convert tmp/7zaun1476995947.ps tmp/7zaun1476995947.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.548 0.179 2.768