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(149,143,135,126,119,133,134,123,147,144,150,140,165,173,167,161,151,163,158,152,176,170,168,164,185,186,184,179,171,187,191,176,204,196,193,179,195,201,192,181,171,177,176,155,173,167,164,152,173,162,158,154,151,160,160,143,170,166,153,144) > 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,] 149 165 185 195 173 NA [2,] 143 173 186 201 162 NA [3,] 135 167 184 192 158 NA [4,] 126 161 179 181 154 NA [5,] 119 151 171 171 151 NA [6,] 133 163 187 177 160 NA [7,] 134 158 191 176 160 NA [8,] 123 152 176 155 143 NA [9,] 147 176 204 173 170 NA [10,] 144 170 196 167 166 NA [11,] 150 168 193 164 153 NA [12,] 140 164 179 152 144 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -6 8 1 6 -11 NA [2,] -8 -6 -2 -9 -4 NA [3,] -9 -6 -5 -11 -4 NA [4,] -7 -10 -8 -10 -3 NA [5,] 14 12 16 6 9 NA [6,] 1 -5 4 -1 0 NA [7,] -11 -6 -15 -21 -17 NA [8,] 24 24 28 18 27 NA [9,] -3 -6 -8 -6 -4 NA [10,] 6 -2 -3 -3 -13 NA [11,] -10 -4 -14 -12 -9 NA [12,] 25 21 16 21 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/193m81476201109.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/2xkpi1476201109.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/3re921476201109.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/4arjn1476201109.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,] 149 143 135 126 151 160 134 143 170 166 150 140 [2,] 165 162 158 154 151 160 158 143 170 166 153 144 [3,] 173 173 167 161 151 163 160 152 173 167 164 152 [4,] 185 186 184 179 171 177 176 155 176 170 168 164 [5,] 195 201 192 181 171 187 191 155 176 170 168 179 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 158.8681 156.0417 148.6285 143.3351 136.8681 150.9878 147.2812 143.5208 [2,] 187.1319 189.9583 185.3715 178.6649 165.1319 175.0122 172.7188 160.4792 [,9] [,10] [,11] [,12] [1,] 168.7604 164.1736 153.401 137.8681 [2,] 177.2396 169.8264 174.599 166.1319 $out [1] 119 133 123 176 147 204 144 196 193 $group [1] 5 6 8 8 9 9 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(149, 165, 173, 185, 195, 143, 162, 173, 186, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ny0b1476201109.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,] -11 -9 -11 -10 6 -1 -21 24 -8 -3 -14 16.0 [2,] -6 -8 -9 -10 9 -1 -17 24 -6 -3 -12 18.5 [3,] 1 -6 -6 -8 12 0 -15 24 -6 -3 -10 21.0 [4,] 6 -4 -5 -7 14 1 -11 27 -4 -2 -9 23.0 [5,] 8 -2 -4 -3 16 4 -6 28 -3 -2 -9 25.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -7.47917 -8.82639 -8.82639 -10.119792 8.467013 -1.413195 -19.23958 [2,] 9.47917 -3.17361 -3.17361 -5.880208 15.532987 1.413195 -10.76042 [,8] [,9] [,10] [,11] [,12] [1,] 21.88021 -7.413195 -3.706597 -12.119792 17.445 [2,] 26.11979 -4.586805 -2.293403 -7.880208 24.555 $out [1] -5 18 6 -13 -4 $group [1] 6 8 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-11, -6, 1, 6, 8, -9, -8, -6, -4, -2, -11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6cksn1476201109.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,] 119.0 151.0 171.0 152.0 143 NA [2,] 129.5 159.5 179.0 165.5 152 NA [3,] 137.5 164.5 185.5 174.5 159 NA [4,] 145.5 169.0 192.0 186.5 164 NA [5,] 150.0 176.0 204.0 201.0 173 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 130.2023 160.167 179.5706 164.9218 153.5267 NA [2,] 144.7977 168.833 191.4294 184.0782 164.4733 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(119, 129.5, 137.5, 145.5, 150, 151, 159.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7yev31476201109.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,] 149.8 151.0 149.00 [2,] 158.0 156.0 160.75 [3,] 164.8 163.5 167.50 [4,] 170.8 170.0 172.00 [5,] 174.0 173.0 175.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 158.9618 157.1145 162.3688 [2,] 170.6382 169.8855 172.6312 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(149.8, 158, 164.8, 170.8, 174, 151, 156, 163.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/193m81476201109.ps tmp/193m81476201109.png",intern=TRUE)) character(0) > try(system("convert tmp/2xkpi1476201109.ps tmp/2xkpi1476201109.png",intern=TRUE)) character(0) > try(system("convert tmp/3re921476201109.ps tmp/3re921476201109.png",intern=TRUE)) character(0) > try(system("convert tmp/4arjn1476201109.ps tmp/4arjn1476201109.png",intern=TRUE)) character(0) > try(system("convert tmp/5ny0b1476201109.ps tmp/5ny0b1476201109.png",intern=TRUE)) character(0) > try(system("convert tmp/6cksn1476201109.ps tmp/6cksn1476201109.png",intern=TRUE)) character(0) > try(system("convert tmp/7yev31476201109.ps tmp/7yev31476201109.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.859 0.185 3.116