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(97.41,97.32,97.33,97.38,97.47,97.5,97.5,97.58,97.7,97.9,97.98,98.03,98.03,97.94,98.12,98.19,98.34,98.42,98.43,98.45,98.77,99.24,99.46,99.54,99.55,99.24,99.43,99.47,99.57,99.62,99.64,99.75,99.85,100.28,100.52,100.57,100.57,100.27,100.27,100.18,100.16,100.18,100.18,100.59,100.69,101.06,101.15,101.16,101.16,100.81,100.94,101.13,101.29,101.34,101.35,101.7,102.05,102.48,102.66,102.72,102.73,102.18,102.22,102.37,102.53,102.61,102.62,103,103.17,103.52,103.69,103.73,99.57,99.09,99.14,99.36,99.6,99.65,99.8,100.15,100.45,100.89,101.13,101.17,101.21,101.1,101.17,101.11,101.2,101.15,100.92,101.1,101.22,101.25,101.39,101.43) > par1 = '12' > par1 <- '12' > #'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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 97.41 98.03 99.55 100.57 101.16 102.73 99.57 101.21 NA [2,] 97.32 97.94 99.24 100.27 100.81 102.18 99.09 101.10 NA [3,] 97.33 98.12 99.43 100.27 100.94 102.22 99.14 101.17 NA [4,] 97.38 98.19 99.47 100.18 101.13 102.37 99.36 101.11 NA [5,] 97.47 98.34 99.57 100.16 101.29 102.53 99.60 101.20 NA [6,] 97.50 98.42 99.62 100.18 101.34 102.61 99.65 101.15 NA [7,] 97.50 98.43 99.64 100.18 101.35 102.62 99.80 100.92 NA [8,] 97.58 98.45 99.75 100.59 101.70 103.00 100.15 101.10 NA [9,] 97.70 98.77 99.85 100.69 102.05 103.17 100.45 101.22 NA [10,] 97.90 99.24 100.28 101.06 102.48 103.52 100.89 101.25 NA [11,] 97.98 99.46 100.52 101.15 102.66 103.69 101.13 101.39 NA [12,] 98.03 99.54 100.57 101.16 102.72 103.73 101.17 101.43 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -0.09 -0.09 -0.31 -0.30 -0.35 -0.55 -0.48 -0.11 NA [2,] 0.01 0.18 0.19 0.00 0.13 0.04 0.05 0.07 NA [3,] 0.05 0.07 0.04 -0.09 0.19 0.15 0.22 -0.06 NA [4,] 0.09 0.15 0.10 -0.02 0.16 0.16 0.24 0.09 NA [5,] 0.03 0.08 0.05 0.02 0.05 0.08 0.05 -0.05 NA [6,] 0.00 0.01 0.02 0.00 0.01 0.01 0.15 -0.23 NA [7,] 0.08 0.02 0.11 0.41 0.35 0.38 0.35 0.18 NA [8,] 0.12 0.32 0.10 0.10 0.35 0.17 0.30 0.12 NA [9,] 0.20 0.47 0.43 0.37 0.43 0.35 0.44 0.03 NA [10,] 0.08 0.22 0.24 0.09 0.18 0.17 0.24 0.14 NA [11,] 0.05 0.08 0.05 0.01 0.06 0.04 0.04 0.04 NA [12,] 0.00 0.01 0.00 0.00 0.01 -4.16 0.04 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/1knvx1444837248.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/2h12x1444837248.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/3v8rn1444837248.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/4dv461444837248.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] [1,] 97.410 97.320 97.330 97.380 97.470 97.500 97.500 97.58 97.700 [2,] 98.790 98.515 98.630 98.775 98.955 99.020 99.035 99.10 99.310 [3,] 100.070 99.755 99.850 99.825 99.880 99.915 99.990 100.37 100.570 [4,] 101.185 100.955 101.055 101.120 101.245 101.245 101.135 101.40 101.635 [5,] 102.730 102.180 102.220 102.370 102.530 102.610 102.620 103.00 103.170 [,10] [,11] [,12] [1,] 97.900 97.980 98.030 [2,] 99.760 99.990 100.055 [3,] 100.975 101.140 101.165 [4,] 101.865 102.025 102.075 [5,] 103.520 103.690 103.730 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.73212 98.39198 98.49536 98.51505 98.60077 98.67208 98.81691 [2,] 101.40788 101.11802 101.20464 101.13495 101.15923 101.15792 101.16309 [,8] [,9] [,10] [,11] [,12] [1,] 99.08519 99.27122 99.79912 100.0032 100.0366 [2,] 101.65481 101.86878 102.15088 102.2768 102.2934 $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(97.41, 98.79, 100.07, 101.185, 102.73, 97.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5i92p1444837248.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,] -0.550 0.000 -0.09 0.090 0.020 0.000 0.020 0.100 0.200 0.080 0.040 0.00 [2,] -0.415 0.025 -0.01 0.090 0.025 0.000 0.095 0.110 0.275 0.115 0.040 0.00 [3,] -0.305 0.060 0.06 0.125 0.050 0.010 0.265 0.145 0.400 0.175 0.045 0.00 [4,] -0.100 0.155 0.17 0.160 0.065 0.015 0.365 0.310 0.435 0.230 0.055 0.01 [5,] -0.090 0.190 0.22 0.240 0.080 0.020 0.410 0.350 0.470 0.240 0.060 0.01 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.4809635 -0.01261987 -0.04055058 0.085897 0.02765543 0.001620785 [2,] -0.1290365 0.13261987 0.16055058 0.164103 0.07234457 0.018379215 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.1141741 0.03327713 0.3106217 0.1107593 0.03662078 -0.005971839 [2,] 0.4158259 0.25672287 0.4893783 0.2392407 0.05337922 0.005971839 $out [1] -0.02 -0.05 0.15 -0.23 0.03 0.08 0.01 -4.16 0.04 $group [1] 4 5 6 6 9 11 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.549999999999997, -0.414999999999992, -0.305, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60ecg1444837248.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] [1,] 97.320 97.940 99.240 100.160 100.810 102.180 99.090 100.920 NA [2,] 97.395 98.155 99.510 100.180 101.145 102.450 99.465 101.105 NA [3,] 97.500 98.425 99.630 100.420 101.345 102.675 99.725 101.185 NA [4,] 97.800 99.005 100.065 100.875 102.265 103.345 100.670 101.235 NA [5,] 98.030 99.540 100.570 101.160 102.720 103.730 101.170 101.430 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 97.31528 98.03731 99.37686 100.103 100.8342 102.2668 99.17539 101.1257 [2,] 97.68472 98.81269 99.88314 100.737 101.8558 103.0832 100.27461 101.2443 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(97.32, 97.395, 97.5, 97.8, 98.03, 97.94, 98.155, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/71cfs1444837248.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,] 99.74375 99.7550 99.8425 [2,] 99.95937 99.8650 100.1312 [3,] 100.05688 100.0300 100.2506 [4,] 100.65750 100.7725 100.6463 [5,] 101.04375 101.1650 101.0325 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.73846 99.61608 100.0157 [2,] 100.37529 100.44392 100.4855 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(99.74375, 99.959375, 100.056875, 100.6575, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1knvx1444837248.ps tmp/1knvx1444837248.png",intern=TRUE)) character(0) > try(system("convert tmp/2h12x1444837248.ps tmp/2h12x1444837248.png",intern=TRUE)) character(0) > try(system("convert tmp/3v8rn1444837248.ps tmp/3v8rn1444837248.png",intern=TRUE)) character(0) > try(system("convert tmp/4dv461444837248.ps tmp/4dv461444837248.png",intern=TRUE)) character(0) > try(system("convert tmp/5i92p1444837248.ps tmp/5i92p1444837248.png",intern=TRUE)) character(0) > try(system("convert tmp/60ecg1444837248.ps tmp/60ecg1444837248.png",intern=TRUE)) character(0) > try(system("convert tmp/71cfs1444837248.ps tmp/71cfs1444837248.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.602 0.449 3.089