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(98.85,98.86,98.86,98.89,98.85,98.85,98.85,98.96,98.99,99.21,99.29,99.32,99.32,99.17,99.13,99.12,99.23,99.25,99.25,99.36,99.43,99.57,99.64,99.68,99.68,99.52,99.69,99.7,99.85,99.94,99.94,99.93,100.19,100.57,100.76,100.86,100.86,100.39,100.61,100.67,100.81,100.86,100.86,100.98,101.03,101.37,101.64,101.68,101.68,101.25,101.24,101.11,101.08,101.09,101.09,101.62,101.66,101.96,102.04,102.02,102.02,101.51,101.62,101.83,102.06,102.14,102.14,102.59,102.92,103.31,103.54,103.58,103.58,102.83,102.86,103.03,103.2,103.28,103.28,103.79,103.92,104.26,104.41,104.45,99.92,99.18,99.18,99.35,99.62,99.67,99.72,100.08,100.39,100.77,101.03,101.07,101.29,101.1,101.2,101.15,101.24,101.16,100.81,101.02,101.15,101.06,101.17,101.22) > par1 = '4' > par1 <- '4' > #'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] 108 > (np <- floor(n / par1)) [1] 27 > 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] 27 27 27 27 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 98.85 98.85 98.99 99.32 99.23 99.43 99.68 99.85 100.19 100.86 100.81 [2,] 98.86 98.85 99.21 99.17 99.25 99.57 99.52 99.94 100.57 100.39 100.86 [3,] 98.86 98.85 99.29 99.13 99.25 99.64 99.69 99.94 100.76 100.61 100.86 [4,] 98.89 98.96 99.32 99.12 99.36 99.68 99.70 99.93 100.86 100.67 100.98 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 101.03 101.68 101.08 101.66 102.02 102.06 102.92 103.58 103.20 103.92 [2,] 101.37 101.25 101.09 101.96 101.51 102.14 103.31 102.83 103.28 104.26 [3,] 101.64 101.24 101.09 102.04 101.62 102.14 103.54 102.86 103.28 104.41 [4,] 101.68 101.11 101.62 102.02 101.83 102.59 103.58 103.03 103.79 104.45 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] 99.92 99.62 100.39 101.29 101.24 101.15 NA [2,] 99.18 99.67 100.77 101.10 101.16 101.06 NA [3,] 99.18 99.72 101.03 101.20 100.81 101.17 NA [4,] 99.35 100.08 101.07 101.15 101.02 101.22 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.01 0.00 0.22 -0.15 0.02 0.14 -0.16 0.09 0.38 -0.47 0.05 0.34 -0.43 [2,] 0.00 0.00 0.08 -0.04 0.00 0.07 0.17 0.00 0.19 0.22 0.00 0.27 -0.01 [3,] 0.03 0.11 0.03 -0.01 0.11 0.04 0.01 -0.01 0.10 0.06 0.12 0.04 -0.13 [4,] -0.04 0.03 0.00 0.11 0.07 0.00 0.15 0.26 0.00 0.14 0.05 0.00 -0.03 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 0.01 0.30 -0.51 0.08 0.39 -0.75 0.08 0.34 -0.74 0.05 0.38 -0.19 [2,] 0.00 0.08 0.11 0.00 0.23 0.03 0.00 0.15 0.00 0.05 0.26 0.10 [3,] 0.53 -0.02 0.21 0.45 0.04 0.17 0.51 0.04 0.17 0.36 0.04 -0.05 [4,] 0.04 0.00 0.23 0.33 0.00 0.17 0.13 -4.53 0.27 0.31 0.22 0.09 [,26] [,27] [,28] [1,] -0.08 -0.09 NA [2,] -0.35 0.11 NA [3,] 0.21 0.05 NA [4,] 0.13 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/1a0dq1445176038.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/2jgt51445176038.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/3cld61445176038.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/4jgfj1445176038.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] [1,] 98.85 98.850 98.850 98.890 [2,] 99.65 99.545 99.665 99.690 [3,] 100.86 100.860 100.860 101.020 [4,] 101.67 101.440 101.630 101.755 [5,] 103.92 104.260 104.410 104.450 $n [1] 27 27 27 27 $conf [,1] [,2] [,3] [,4] [1,] 100.2458 100.2838 100.2625 100.3921 [2,] 101.4742 101.4362 101.4575 101.6479 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tqdk1445176038.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] [1,] -0.510 -0.04 -0.13 -0.04 [2,] -0.155 0.00 0.03 0.00 [3,] 0.020 0.05 0.05 0.08 [4,] 0.180 0.13 0.17 0.17 [5,] 0.390 0.27 0.36 0.33 $n [1] 27 27 27 26 $conf [,1] [,2] [,3] [,4] [1,] -0.08186383 0.01047075 0.00743004 0.02732321 [2,] 0.12186383 0.08952925 0.09256996 0.13267679 $out [1] -0.75 -0.74 -0.35 0.53 0.45 0.51 -4.53 $group [1] 1 1 2 3 3 3 4 $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(-0.509999999999991, -0.155000000000001, 0.019999999999996, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6d4yu1445176038.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,] 98.850 98.850 98.990 99.120 99.230 99.430 99.520 99.850 100.190 100.390 [2,] 98.855 98.850 99.100 99.125 99.240 99.500 99.600 99.890 100.380 100.500 [3,] 98.860 98.850 99.250 99.150 99.250 99.605 99.685 99.935 100.665 100.640 [4,] 98.875 98.905 99.305 99.245 99.305 99.660 99.695 99.940 100.810 100.765 [5,] 98.890 98.960 99.320 99.320 99.360 99.680 99.700 99.940 100.860 100.860 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 100.810 101.030 101.110 101.080 101.66 101.510 102.060 102.920 102.830 [2,] 100.835 101.200 101.175 101.085 101.81 101.565 102.100 103.115 102.845 [3,] 100.860 101.505 101.245 101.090 101.99 101.725 102.140 103.425 102.945 [4,] 100.920 101.660 101.465 101.355 102.03 101.925 102.365 103.560 103.305 [5,] 100.980 101.680 101.680 101.620 102.04 102.020 102.590 103.580 103.580 [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] 103.200 103.920 99.180 99.620 100.39 101.100 100.810 101.060 NA [2,] 103.240 104.090 99.180 99.645 100.58 101.125 100.915 101.105 NA [3,] 103.280 104.335 99.265 99.695 100.90 101.175 101.090 101.160 NA [4,] 103.535 104.430 99.635 99.900 101.05 101.245 101.200 101.195 NA [5,] 103.790 104.450 99.920 100.080 101.07 101.290 101.240 101.220 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.8442 98.80655 99.08805 99.0552 99.19865 99.4786 99.60995 99.8955 [2,] 98.8758 98.89345 99.41195 99.2448 99.30135 99.7314 99.76005 99.9745 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 100.3253 100.4306 100.7929 101.1416 101.0159 100.8767 101.8162 101.4406 [2,] 101.0047 100.8494 100.9271 101.8684 101.4741 101.3033 102.1638 102.0094 [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 101.9306 103.0735 102.5816 103.047 104.0664 98.90555 99.49355 100.5287 [2,] 102.3494 103.7766 103.3084 103.513 104.6036 99.62445 99.89645 101.2713 [,25] [,26] [,27] [,28] [1,] 101.0802 100.8649 101.0889 NA [2,] 101.2698 101.3152 101.2311 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" NA Warning message: In bxp(list(stats = c(98.85, 98.855, 98.86, 98.875, 98.89, 98.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7vkd41445176038.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,] 100.8196 100.86 100.4925 [2,] 100.8324 100.86 100.5700 [3,] 100.8643 100.86 100.6538 [4,] 100.9428 100.94 100.6912 [5,] 101.0022 101.02 100.7225 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 100.7771 100.7968 100.5580 [2,] 100.9515 100.9232 100.7495 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(100.81962962963, 100.832407407407, 100.864259259259, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1a0dq1445176038.ps tmp/1a0dq1445176038.png",intern=TRUE)) character(0) > try(system("convert tmp/2jgt51445176038.ps tmp/2jgt51445176038.png",intern=TRUE)) character(0) > try(system("convert tmp/3cld61445176038.ps tmp/3cld61445176038.png",intern=TRUE)) character(0) > try(system("convert tmp/4jgfj1445176038.ps tmp/4jgfj1445176038.png",intern=TRUE)) character(0) > try(system("convert tmp/5tqdk1445176038.ps tmp/5tqdk1445176038.png",intern=TRUE)) character(0) > try(system("convert tmp/6d4yu1445176038.ps tmp/6d4yu1445176038.png",intern=TRUE)) character(0) > try(system("convert tmp/7vkd41445176038.ps tmp/7vkd41445176038.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.492 0.469 2.984