R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(94.3,94.6,94.9,95.6,95.4,97.4,98.4,100.5,106.6,106.7,106.8,109,109.3,110.5,113.4,113,113.6,121.2,120.5,120.9,125.8,125.4,125.7,127.7,128.1,130,130.5,130.1,129.6,128.8,128.4,128.3,127.6,127.3,127.7,126.9,125.1,119,118.7,118.9,116.9,117,117,115.5,115.6,117.5,117.6,117.8,119.3,120,120.2,109.4,109,108.8,96.3,96.9,97,111.4,111.8,111.7) > 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] 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,] 94.3 109.3 128.1 125.1 119.3 NA [2,] 94.6 110.5 130.0 119.0 120.0 NA [3,] 94.9 113.4 130.5 118.7 120.2 NA [4,] 95.6 113.0 130.1 118.9 109.4 NA [5,] 95.4 113.6 129.6 116.9 109.0 NA [6,] 97.4 121.2 128.8 117.0 108.8 NA [7,] 98.4 120.5 128.4 117.0 96.3 NA [8,] 100.5 120.9 128.3 115.5 96.9 NA [9,] 106.6 125.8 127.6 115.6 97.0 NA [10,] 106.7 125.4 127.3 117.5 111.4 NA [11,] 106.8 125.7 127.7 117.6 111.8 NA [12,] 109.0 127.7 126.9 117.8 111.7 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.3 1.2 1.9 -6.1 0.7 NA [2,] 0.3 2.9 0.5 -0.3 0.2 NA [3,] 0.7 -0.4 -0.4 0.2 -10.8 NA [4,] -0.2 0.6 -0.5 -2.0 -0.4 NA [5,] 2.0 7.6 -0.8 0.1 -0.2 NA [6,] 1.0 -0.7 -0.4 0.0 -12.5 NA [7,] 2.1 0.4 -0.1 -1.5 0.6 NA [8,] 6.1 4.9 -0.7 0.1 0.1 NA [9,] 0.1 -0.4 -0.3 1.9 14.4 NA [10,] 0.1 0.3 0.4 0.1 0.4 NA [11,] 2.2 2.0 -0.8 0.2 -0.1 NA [12,] 0.3 0.4 -1.8 1.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/1o6mr1445590162.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/2h8p91445590162.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/3fbbb1445590162.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/4tzf11445590162.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,] 94.3 110.5 113.4 95.6 109.0 97.4 96.3 96.9 97.0 106.7 106.8 109.0 [2,] 109.3 110.5 113.4 109.4 109.0 108.8 98.4 100.5 106.6 111.4 111.8 111.7 [3,] 119.3 119.0 118.7 113.0 113.6 117.0 117.0 115.5 115.6 117.5 117.6 117.8 [4,] 125.1 120.0 120.2 118.9 116.9 121.2 120.5 120.9 125.8 125.4 125.7 126.9 [5,] 128.1 130.0 120.2 130.1 116.9 128.8 128.4 128.3 127.6 127.3 127.7 127.7 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 108.1358 112.2873 113.8951 106.2873 108.0179 108.2382 101.3842 101.0854 [2,] 130.4642 125.7127 123.5049 119.7127 119.1821 125.7618 132.6158 129.9146 [,9] [,10] [,11] [,12] [1,] 102.0333 107.6076 107.7783 107.0597 [2,] 129.1667 127.3924 127.4217 128.5403 $out [1] 94.6 94.9 130.5 95.4 129.6 $group [1] 2 3 3 5 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.3, 109.3, 119.3, 125.1, 128.1, 110.5, 110.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57e7v1445590162.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.3 0.2 -0.4 -0.5 -0.8 -0.7 -0.1 -0.7 -0.4 0.1 -0.8 -1.80 [2,] 0.3 0.2 -0.4 -0.5 -0.2 -0.7 -0.1 0.1 -0.3 0.1 -0.1 -0.75 [3,] 0.7 0.3 -0.4 -0.4 0.1 -0.4 0.4 0.1 0.1 0.3 0.2 0.35 [4,] 1.2 0.5 0.2 -0.2 2.0 0.0 0.6 4.9 1.9 0.4 2.0 0.95 [5,] 1.9 0.5 0.7 -0.2 2.0 1.0 0.6 6.1 1.9 0.4 2.2 1.50 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.06406227 0.08802076 -0.82395849 -0.6119792 -1.454514 -0.89461824 [2,] 1.33593773 0.51197924 0.02395849 -0.1880208 1.654514 0.09461824 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.09461824 -3.291668 -1.454514 0.08802076 -1.283855 -0.993 [2,] 0.89461824 3.491668 1.654514 0.51197924 1.683855 1.693 $out [1] -6.1 2.9 -0.3 -10.8 0.6 -2.0 7.6 -12.5 2.1 -1.5 14.4 $group [1] 1 2 2 3 4 4 5 6 7 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.299999999999997, 0.299999999999997, 0.700000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hv7n1445590162.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,] 94.30 109.30 126.90 115.50 96.30 NA [2,] 95.15 113.20 127.65 116.95 102.90 NA [3,] 97.90 120.70 128.35 117.55 110.40 NA [4,] 106.65 125.55 129.80 118.80 115.55 NA [5,] 109.00 127.70 130.50 119.00 120.20 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.65477 115.0671 127.3694 116.7062 104.6303 NA [2,] 103.14523 126.3329 129.3306 118.3938 116.1697 NA $out [1] 125.1 $group [1] 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(94.3, 95.15, 97.9, 106.65, 109, 109.3, 113.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ahr41445590162.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,] 112.12 113.00 109.450 [2,] 113.15 115.55 113.550 [3,] 114.73 117.25 115.725 [4,] 116.60 118.25 117.800 [5,] 118.62 119.30 119.300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 113.1564 116.0185 113.7865 [2,] 116.3036 118.4815 117.6635 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(112.12, 113.15, 114.73, 116.6, 118.62, 113, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o6mr1445590162.ps tmp/1o6mr1445590162.png",intern=TRUE)) character(0) > try(system("convert tmp/2h8p91445590162.ps tmp/2h8p91445590162.png",intern=TRUE)) character(0) > try(system("convert tmp/3fbbb1445590162.ps tmp/3fbbb1445590162.png",intern=TRUE)) character(0) > try(system("convert tmp/4tzf11445590162.ps tmp/4tzf11445590162.png",intern=TRUE)) character(0) > try(system("convert tmp/57e7v1445590162.ps tmp/57e7v1445590162.png",intern=TRUE)) character(0) > try(system("convert tmp/6hv7n1445590162.ps tmp/6hv7n1445590162.png",intern=TRUE)) character(0) > try(system("convert tmp/7ahr41445590162.ps tmp/7ahr41445590162.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.409 0.395 2.834