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(203089,198480,192684,187827,182414,182510,211524,211451,200140,191568,186424,191987,203583,201920,195978,191395,188222,189422,214419,224325,216222,210506,207221,210027,215191,215177,211701,210176,205491,206996,235980,241292,236675,229127,225436,229570,239973,236168,230703,224790,217811,219576,245472,248511,242084,235572,229827,229697,239567,237201,233164,227755,220189,221270,245413,247826,237736,230079,225939,228987) > 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,] 203089 203583 215191 239973 239567 NA [2,] 198480 201920 215177 236168 237201 NA [3,] 192684 195978 211701 230703 233164 NA [4,] 187827 191395 210176 224790 227755 NA [5,] 182414 188222 205491 217811 220189 NA [6,] 182510 189422 206996 219576 221270 NA [7,] 211524 214419 235980 245472 245413 NA [8,] 211451 224325 241292 248511 247826 NA [9,] 200140 216222 236675 242084 237736 NA [10,] 191568 210506 229127 235572 230079 NA [11,] 186424 207221 225436 229827 225939 NA [12,] 191987 210027 229570 229697 228987 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -4609 -1663 -14 -3805 -2366 NA [2,] -5796 -5942 -3476 -5465 -4037 NA [3,] -4857 -4583 -1525 -5913 -5409 NA [4,] -5413 -3173 -4685 -6979 -7566 NA [5,] 96 1200 1505 1765 1081 NA [6,] 29014 24997 28984 25896 24143 NA [7,] -73 9906 5312 3039 2413 NA [8,] -11311 -8103 -4617 -6427 -10090 NA [9,] -8572 -5716 -7548 -6512 -7657 NA [10,] -5144 -3285 -3691 -5745 -4140 NA [11,] 5563 2806 4134 -130 3048 NA [12,] 11596 5164 10403 9870 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/1hbha1476274867.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/275dq1476274867.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/37p4l1476274867.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/4e0431476274867.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] [1,] 203089 198480 192684 187827 182414 182510 211524 211451 200140 191568 [2,] 203583 201920 195978 191395 188222 189422 214419 224325 216222 210506 [3,] 215191 215177 211701 210176 205491 206996 235980 241292 236675 229127 [4,] 239567 236168 230703 224790 217811 219576 245413 247826 237736 230079 [5,] 239973 237201 233164 227755 220189 221270 245472 248511 242084 235572 [,11] [,12] [1,] 186424 191987 [2,] 207221 210027 [3,] 225436 228987 [4,] 225939 229570 [5,] 229827 229697 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 189764.8 190977.4 187164.4 186579.2 184583.5 185689.3 214079.7 224686.3 [2,] 240617.2 239376.6 236237.6 233772.8 226398.5 228302.7 257880.3 257897.7 [,9] [,10] [,11] [,12] [1,] 221473.3 215296.8 212209.9 215178 [2,] 251876.7 242957.2 238662.1 242796 $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(203089, 203583, 215191, 239567, 239973, 198480, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/581u51476274867.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,] -4609 -5942 -5913 -7566 1081 24143 -73 -11311 -8572 -5745 2806 5164.0 [2,] -3805 -5796 -5409 -6979 1081 24997 2413 -10090 -7657 -5144 2806 7517.0 [3,] -2366 -5465 -4857 -5413 1200 25896 3039 -8103 -7548 -4140 3048 10136.5 [4,] -1663 -4037 -4583 -4685 1505 28984 5312 -6427 -6512 -3691 4134 10999.5 [5,] -14 -3476 -4583 -3173 1765 29014 5312 -4617 -5716 -3285 5563 11596.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3879.5318 -6707.905 -5440.65 -7033.935 900.4027 23078.8 990.5739 [2,] -852.4682 -4222.095 -4273.35 -3792.065 1499.5973 28713.2 5087.4261 [,8] [,9] [,10] [,11] [,12] [1,] -10691.267 -8357.054 -5166.686 2109.639 7385.325 [2,] -5514.733 -6738.946 -3113.314 3986.361 12887.675 $out [1] -1525 96 9906 -130 $group [1] 3 5 7 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4609, -3805, -2366, -1663, -14, -5942, -5796, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fksq1476274867.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,] 182414.0 188222.0 205491.0 217811.0 220189.0 NA [2,] 187125.5 193686.5 210938.5 227243.5 226847.0 NA [3,] 192335.5 205402.0 220313.5 233137.5 231621.5 NA [4,] 201614.5 212462.5 232775.0 241028.5 238651.5 NA [5,] 211524.0 224325.0 241292.0 248511.0 247826.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 185727 196838.1 210353.7 226850.1 226237.4 NA [2,] 198944 213965.9 230273.3 239424.9 237005.6 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(182414, 187125.5, 192335.5, 201614.5, 211524, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7hgvz1476274867.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,] 202825.4 205491.0 203016.5 [2,] 210617.3 210938.5 210716.5 [3,] 217921.4 220313.5 219421.2 [4,] 223426.0 232553.5 224277.0 [5,] 234681.0 241292.0 236075.5 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 212079.3 210454.8 213236.2 [2,] 223763.5 230172.2 225606.3 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(202825.4, 210617.3, 217921.4, 223426, 234681, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hbha1476274867.ps tmp/1hbha1476274867.png",intern=TRUE)) character(0) > try(system("convert tmp/275dq1476274867.ps tmp/275dq1476274867.png",intern=TRUE)) character(0) > try(system("convert tmp/37p4l1476274867.ps tmp/37p4l1476274867.png",intern=TRUE)) character(0) > try(system("convert tmp/4e0431476274867.ps tmp/4e0431476274867.png",intern=TRUE)) character(0) > try(system("convert tmp/581u51476274867.ps tmp/581u51476274867.png",intern=TRUE)) character(0) > try(system("convert tmp/6fksq1476274867.ps tmp/6fksq1476274867.png",intern=TRUE)) character(0) > try(system("convert tmp/7hgvz1476274867.ps tmp/7hgvz1476274867.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.456 0.189 2.695