R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(8899,8899,9093,9093,9093,9116,9116,9116,10073,10073,10073,9223,9223,9223,9151,9151,9151,6727,6727,6727,7232,7232,7232,6370,6370,6370,6862,6862,6862,7029,7029,7029,7031,7031,7031,7223,7223,7223,8065,8065,8065,7657,7657,7657,7328,7328,7328,7115,7115,7115,7926,7926,7926,8681,8681,8681,8670,8670,8670,8028,8028) > 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] 61 > (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] 6 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 8899 9223 6370 7223 7115 8028 [2,] 8899 9223 6370 7223 7115 NA [3,] 9093 9151 6862 8065 7926 NA [4,] 9093 9151 6862 8065 7926 NA [5,] 9093 9151 6862 8065 7926 NA [6,] 9116 6727 7029 7657 8681 NA [7,] 9116 6727 7029 7657 8681 NA [8,] 9116 6727 7029 7657 8681 NA [9,] 10073 7232 7031 7328 8670 NA [10,] 10073 7232 7031 7328 8670 NA [11,] 10073 7232 7031 7328 8670 NA [12,] 9223 6370 7223 7115 8028 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0 0 0 0 0 NA [2,] 194 -72 492 842 811 NA [3,] 0 0 0 0 0 NA [4,] 0 0 0 0 0 NA [5,] 23 -2424 167 -408 755 NA [6,] 0 0 0 0 0 NA [7,] 0 0 0 0 0 NA [8,] 957 505 2 -329 -11 NA [9,] 0 0 0 0 0 NA [10,] 0 0 0 0 0 NA [11,] -850 -862 192 -213 -642 NA [12,] 0 0 0 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/11y6y1493724092.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/20p371493724092.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/3g6iv1493724092.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/4gvfb1493724092.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] [,12] [1,] 6370.0 6370 6862 6862 6862 6727 6727 6727 7031 7031 7031 6370 [2,] 7115.0 7115 7926 7926 7926 7029 7029 7029 7232 7232 7232 7115 [3,] 7625.5 7223 8065 8065 8065 7657 7657 7657 7328 7328 7328 7223 [4,] 8899.0 8899 9093 9093 9093 8681 8681 8681 8670 8670 8670 8028 [5,] 9223.0 9223 9151 9151 9151 9116 9116 9116 10073 10073 10073 9223 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6474.762 5962.43 7240.401 7240.401 7240.401 6489.701 6489.701 6489.701 [2,] 8776.238 8483.57 8889.599 8889.599 8889.599 8824.299 8824.299 8824.299 [,9] [,10] [,11] [,12] [1,] 6311.913 6311.913 6311.913 6577.876 [2,] 8344.087 8344.087 8344.087 7868.124 $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(6370, 7115, 7625.5, 8899, 9223, 6370, 7115, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5z4gc1493724092.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] [,12] [1,] 0 -72 0 0 -408 0 0 -329 0 0 -862 0 [2,] 0 194 0 0 -408 0 0 -11 0 0 -850 0 [3,] 0 492 0 0 23 0 0 2 0 0 -642 0 [4,] 0 811 0 0 167 0 0 505 0 0 -213 0 [5,] 0 842 0 0 755 0 0 957 0 0 192 0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0 56.02935 0 0 -383.2936 0 0 -362.6043 0 0 [2,] 0 927.97065 0 0 429.2936 0 0 366.6043 0 0 [,11] [,12] [1,] -1092.1026 0 [2,] -191.8974 0 $out [1] -2424 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 0, 0, -72, 194, 492, 811, 842, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hgw51493724092.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,] 8899 6370 6862 7115.0 7115.0 8028 [2,] 9093 6727 6862 7275.5 7926.0 8028 [3,] 9116 7232 7029 7492.5 8349.0 8028 [4,] 9648 9151 7031 7861.0 8675.5 8028 [5,] 10073 9223 7223 8065.0 8681.0 8028 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 8862.861 6126.397 6951.918 7225.45 8007.148 8028 [2,] 9369.139 8337.603 7106.082 7759.55 8690.852 8028 $out [1] 6370 6370 $group [1] 3 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(8899, 9093, 9116, 9648, 10073, 6370, 6727, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7avpe1493724092.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,] 7591.800 7223.00 7571.50 [2,] 7825.833 7328.00 7855.00 [3,] 7954.400 7641.25 7951.00 [4,] 8143.100 7861.00 8258.25 [5,] 8219.400 8065.00 8509.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7809.693 7398.145 7767.075 [2,] 8099.107 7884.355 8134.925 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(7591.8, 7825.83333333333, 7954.4, 8143.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11y6y1493724092.ps tmp/11y6y1493724092.png",intern=TRUE)) character(0) > try(system("convert tmp/20p371493724092.ps tmp/20p371493724092.png",intern=TRUE)) character(0) > try(system("convert tmp/3g6iv1493724092.ps tmp/3g6iv1493724092.png",intern=TRUE)) character(0) > try(system("convert tmp/4gvfb1493724092.ps tmp/4gvfb1493724092.png",intern=TRUE)) character(0) > try(system("convert tmp/5z4gc1493724092.ps tmp/5z4gc1493724092.png",intern=TRUE)) character(0) > try(system("convert tmp/6hgw51493724092.ps tmp/6hgw51493724092.png",intern=TRUE)) character(0) > try(system("convert tmp/7avpe1493724092.ps tmp/7avpe1493724092.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.332 0.379 3.874