R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" 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(214320,212588,205816,202196,195722,198563,229139,229527,211868,203555,195770,199834,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] 72 > (np <- floor(n / par1)) [1] 6 > 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 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 214320 203089 203583 215191 239973 239567 NA [2,] 212588 198480 201920 215177 236168 237201 NA [3,] 205816 192684 195978 211701 230703 233164 NA [4,] 202196 187827 191395 210176 224790 227755 NA [5,] 195722 182414 188222 205491 217811 220189 NA [6,] 198563 182510 189422 206996 219576 221270 NA [7,] 229139 211524 214419 235980 245472 245413 NA [8,] 229527 211451 224325 241292 248511 247826 NA [9,] 211868 200140 216222 236675 242084 237736 NA [10,] 203555 191568 210506 229127 235572 230079 NA [11,] 195770 186424 207221 225436 229827 225939 NA [12,] 199834 191987 210027 229570 229697 228987 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1732 -4609 -1663 -14 -3805 -2366 NA [2,] -6772 -5796 -5942 -3476 -5465 -4037 NA [3,] -3620 -4857 -4583 -1525 -5913 -5409 NA [4,] -6474 -5413 -3173 -4685 -6979 -7566 NA [5,] 2841 96 1200 1505 1765 1081 NA [6,] 30576 29014 24997 28984 25896 24143 NA [7,] 388 -73 9906 5312 3039 2413 NA [8,] -17659 -11311 -8103 -4617 -6427 -10090 NA [9,] -8313 -8572 -5716 -7548 -6512 -7657 NA [10,] -7785 -5144 -3285 -3691 -5745 -4140 NA [11,] 4064 5563 2806 4134 -130 3048 NA [12,] 3255 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/113a61457100659.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/2vgx01457100659.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/3n9cw1457100659.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/45n551457100659.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] [1,] 203089.0 198480.0 192684.0 187827 182414.0 182510.0 211524.0 211451.0 [2,] 203583.0 201920.0 195978.0 191395 188222.0 189422.0 214419.0 224325.0 [3,] 214755.5 213882.5 208758.5 206186 200606.5 202779.5 232559.5 235409.5 [4,] 239567.0 236168.0 230703.0 224790 217811.0 219576.0 245413.0 247826.0 [5,] 239973.0 237201.0 233164.0 227755 220189.0 221270.0 245472.0 248511.0 [,9] [,10] [,11] [,12] [1,] 200140.0 191568.0 186424.0 191987 [2,] 211868.0 203555.0 195770.0 199834 [3,] 226448.5 219816.5 216328.5 219507 [4,] 237736.0 230079.0 225939.0 229570 [5,] 242084.0 235572.0 229827.0 229697 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 191544.7 191791.4 186359.8 184645.1 181520.6 183329.2 212567.4 220250.6 [2,] 237966.3 235973.6 231157.2 227726.9 219692.4 222229.8 252551.6 250568.4 [,9] [,10] [,11] [,12] [1,] 209762.8 202707.7 196868.5 200326.3 [2,] 243134.2 236925.3 235788.5 238687.7 $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, 214755.5, 239567, 239973, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57qtn1457100659.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] [1,] -4609 -6772.0 -5913 -7566.0 96.0 24143 -73 -17659.0 -8572.0 -7785 2806 [2,] -3805 -5942.0 -5409 -6979.0 1081.0 24997 388 -11311.0 -8313.0 -5745 2806 [3,] -2049 -5630.5 -4720 -5943.5 1352.5 27440 2726 -9096.5 -7602.5 -4642 3556 [4,] -1663 -4037.0 -3620 -4685.0 1765.0 29014 5312 -6427.0 -6512.0 -3691 4134 [5,] -14 -3476.0 -1525 -3173.0 1765.0 30576 9906 -4617.0 -5716.0 -3285 5563 [,12] [1,] 3255 [2,] 5164 [3,] 9870 [4,] 10403 [5,] 11596 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3430.6592 -6859.287 -5873.963 -7423.204 911.2979 24848.91 -450.139 [2,] -667.3408 -4401.713 -3566.037 -4463.796 1793.7021 30031.09 5902.139 [,8] [,9] [,10] [,11] [,12] [1,] -12246.838 -8764.203 -5966.896 2699.397 6168.136 [2,] -5946.162 -6440.797 -3317.104 4412.603 13571.864 $out [1] 2841 -130 $group [1] 5 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4609, -3805, -2049, -1663, -14, -6772, -5942, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6c4v21457100659.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] [1,] 195722.0 182414.0 188222.0 205491.0 217811.0 220189.0 NA [2,] 199198.5 187125.5 193686.5 210938.5 227243.5 226847.0 NA [3,] 204685.5 192335.5 205402.0 220313.5 233137.5 231621.5 NA [4,] 213454.0 201614.5 212462.5 232775.0 241028.5 238651.5 NA [5,] 229527.0 211524.0 224325.0 241292.0 248511.0 247826.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 198183.5 185727 196838.1 210353.7 226850.1 226237.4 NA [2,] 211187.5 198944 213965.9 230273.3 239424.9 237005.6 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(195722, 199198.5, 204685.5, 213454, 229527, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79luv1457100659.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,] 201641.5 200606.5 202414.0 [2,] 209515.4 207472.2 209905.4 [3,] 215875.8 215542.0 216735.1 [4,] 221704.0 223132.5 222541.9 [5,] 233822.0 235409.5 235909.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 210316.5 208399.3 210971.5 [2,] 221435.0 222684.7 222498.6 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/113a61457100659.ps tmp/113a61457100659.png",intern=TRUE)) character(0) > try(system("convert tmp/2vgx01457100659.ps tmp/2vgx01457100659.png",intern=TRUE)) character(0) > try(system("convert tmp/3n9cw1457100659.ps tmp/3n9cw1457100659.png",intern=TRUE)) character(0) > try(system("convert tmp/45n551457100659.ps tmp/45n551457100659.png",intern=TRUE)) character(0) > try(system("convert tmp/57qtn1457100659.ps tmp/57qtn1457100659.png",intern=TRUE)) character(0) > try(system("convert tmp/6c4v21457100659.ps tmp/6c4v21457100659.png",intern=TRUE)) character(0) > try(system("convert tmp/79luv1457100659.ps tmp/79luv1457100659.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.766 0.419 3.209