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(154,170,170,156,178,174,160,166,175,171,161,188,158,170,165,163,180,170,166,178,189,160,164,183,160,171,174,174,183,176,154,158,199,156,175,181,153,161,175,175,183,181,159,158,194,154,173,186,148,149,175,173,189,175,161,150,200,153,173,181,158,141,174,173,196,165,151,149,198,144,166,178,158,130,181,170,188,155,158,153,210,151,169,185,159,130,181,164,189,145,161,154,210,149,164,185,165,131,173,165,185,144,156,158,210,144,164,184) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 154 158 160 153 148 158 158 159 165 NA [2,] 170 170 171 161 149 141 130 130 131 NA [3,] 170 165 174 175 175 174 181 181 173 NA [4,] 156 163 174 175 173 173 170 164 165 NA [5,] 178 180 183 183 189 196 188 189 185 NA [6,] 174 170 176 181 175 165 155 145 144 NA [7,] 160 166 154 159 161 151 158 161 156 NA [8,] 166 178 158 158 150 149 153 154 158 NA [9,] 175 189 199 194 200 198 210 210 210 NA [10,] 171 160 156 154 153 144 151 149 144 NA [11,] 161 164 175 173 173 166 169 164 164 NA [12,] 188 183 181 186 181 178 185 185 184 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 16 12 11 8 1 -17 -28 -29 -34 NA [2,] 0 -5 3 14 26 33 51 51 42 NA [3,] -14 -2 0 0 -2 -1 -11 -17 -8 NA [4,] 22 17 9 8 16 23 18 25 20 NA [5,] -4 -10 -7 -2 -14 -31 -33 -44 -41 NA [6,] -14 -4 -22 -22 -14 -14 3 16 12 NA [7,] 6 12 4 -1 -11 -2 -5 -7 2 NA [8,] 9 11 41 36 50 49 57 56 52 NA [9,] -4 -29 -43 -40 -47 -54 -59 -61 -66 NA [10,] -10 4 19 19 20 22 18 15 20 NA [11,] 27 19 6 13 8 12 16 21 20 NA [12,] -30 -23 -28 -38 -23 -20 -26 -20 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/1wvds1470839695.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/2zutk1470839695.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/37ey11470839695.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/48etl1470839695.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,] 148 130 170 156 178 144 151 149 175 144 161 178 [2,] 154 131 173 164 183 155 156 153 194 149 164 181 [3,] 158 149 174 170 185 170 159 158 199 153 166 184 [4,] 159 170 175 173 189 175 161 158 210 156 173 185 [5,] 165 171 175 175 196 181 166 158 210 160 175 188 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 155.3667 128.46 172.9467 165.26 181.84 159.4667 156.3667 155.3667 190.5733 [2,] 160.6333 169.54 175.0533 174.74 188.16 180.5333 161.6333 160.6333 207.4267 [,10] [,11] [,12] [1,] 149.3133 161.26 181.8933 [2,] 156.6867 170.74 186.1067 $out [1] 165 181 181 166 178 171 $group [1] 3 3 3 8 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(148, 154, 158, 159, 165, 130, 131, 149, 170, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ygws1470839695.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,] -34 -5 -17 8 -44 -22 -11 36 -66 15 6 -38.0 [2,] -28 3 -11 16 -33 -14 -5 36 -59 15 12 -29.0 [3,] 1 26 -2 18 -14 -14 -1 49 -47 19 16 -24.5 [4,] 11 42 -1 22 -7 3 4 52 -40 20 20 -21.5 [5,] 16 51 0 25 -2 16 12 57 -29 22 27 -20.0 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -19.54 5.46 -7.266667 14.84 -27.6933333 -22.953333 -5.74 40.57333 [2,] 21.54 46.54 3.266667 21.16 -0.3066667 -5.046667 3.74 57.42667 [,9] [,10] [,11] [,12] [1,] -57.00667 16.36667 11.78667 -28.68961 [2,] -36.99333 21.63333 20.21333 -20.31039 $out [1] 9 11 -4 -10 4 $group [1] 8 8 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-34, -28, 1, 11, 16, -5, 3, 26, 42, 51, -17, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65fk81470839695.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] [,8] [,9] [,10] [1,] 154.0 158.0 154.0 153.0 148.0 141.0 130.0 130.0 131.0 NA [2,] 160.5 163.5 159.0 158.5 151.5 150.0 154.0 151.5 150.0 NA [3,] 170.0 168.0 174.0 174.0 173.0 165.5 163.5 162.5 164.5 NA [4,] 174.5 179.0 178.5 182.0 178.0 176.0 183.0 183.0 178.5 NA [5,] 188.0 189.0 199.0 194.0 200.0 198.0 210.0 210.0 210.0 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 163.6145 160.9303 165.1059 163.2815 160.9132 153.6412 150.2729 148.1326 [2,] 176.3855 175.0697 182.8941 184.7185 185.0868 177.3588 176.7271 176.8674 [,9] [,10] [1,] 151.501 NA [2,] 177.499 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(154, 160.5, 170, 174.5, 188, 158, 163.5, 168, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79ujx1470839695.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,] 150.3333 149 150.50 [2,] 157.6111 158 156.00 [3,] 166.3333 168 166.75 [4,] 178.8333 179 178.50 [5,] 198.3333 199 202.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 156.6537 158.4218 156.4876 [2,] 176.0129 177.5782 177.0124 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(150.333333333333, 157.611111111111, 166.333333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wvds1470839695.ps tmp/1wvds1470839695.png",intern=TRUE)) character(0) > try(system("convert tmp/2zutk1470839695.ps tmp/2zutk1470839695.png",intern=TRUE)) character(0) > try(system("convert tmp/37ey11470839695.ps tmp/37ey11470839695.png",intern=TRUE)) character(0) > try(system("convert tmp/48etl1470839695.ps tmp/48etl1470839695.png",intern=TRUE)) character(0) > try(system("convert tmp/5ygws1470839695.ps tmp/5ygws1470839695.png",intern=TRUE)) character(0) > try(system("convert tmp/65fk81470839695.ps tmp/65fk81470839695.png",intern=TRUE)) character(0) > try(system("convert tmp/79ujx1470839695.ps tmp/79ujx1470839695.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.429 0.218 2.702