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(86.48,86.48,86.7,87.86,88.24,88.23,88.73,88.82,87.16,86.29,86.37,86.59,85.46,85.85,86.93,87.66,87.84,88.09,88.58,88.06,88.26,89,90.78,90,89.84,89.82,91.12,91.5,93.03,94.23,94.76,92.83,92.49,90.85,88.19,86.31,85.74,86.62,86.66,87.39,87.59,88.8,88.64,89.55,89.04,88.49,89.5,89.46,90.33,90.27,91.5,92.53,93.14,93.01,92.84,92.88,93.05,93.17,93.67,94.9,95.72,96.08,97.52,98.26,98.48,98.09,98.03,98.14,98.71,98.69,98.72,98.47,99.49,99.84,100.9,101.31,100.09,99.28,99.57,101.04,101.87,101.39,100.3,99.95,99.87,100.51,100.27,100.04,99.23,99.32,99.95,100.23,101.02,99.83,99.61,100.12,99.83,100.03,100.07,100.46,100.43,100.68,101.8,101.21,100.63,100.55,99.76,98.8) > 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] 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,] 86.48 85.46 89.84 85.74 90.33 95.72 99.49 99.87 99.83 NA [2,] 86.48 85.85 89.82 86.62 90.27 96.08 99.84 100.51 100.03 NA [3,] 86.70 86.93 91.12 86.66 91.50 97.52 100.90 100.27 100.07 NA [4,] 87.86 87.66 91.50 87.39 92.53 98.26 101.31 100.04 100.46 NA [5,] 88.24 87.84 93.03 87.59 93.14 98.48 100.09 99.23 100.43 NA [6,] 88.23 88.09 94.23 88.80 93.01 98.09 99.28 99.32 100.68 NA [7,] 88.73 88.58 94.76 88.64 92.84 98.03 99.57 99.95 101.80 NA [8,] 88.82 88.06 92.83 89.55 92.88 98.14 101.04 100.23 101.21 NA [9,] 87.16 88.26 92.49 89.04 93.05 98.71 101.87 101.02 100.63 NA [10,] 86.29 89.00 90.85 88.49 93.17 98.69 101.39 99.83 100.55 NA [11,] 86.37 90.78 88.19 89.50 93.67 98.72 100.30 99.61 99.76 NA [12,] 86.59 90.00 86.31 89.46 94.90 98.47 99.95 100.12 98.80 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.00 0.39 -0.02 0.88 -0.06 0.36 0.35 0.64 0.20 NA [2,] 0.22 1.08 1.30 0.04 1.23 1.44 1.06 -0.24 0.04 NA [3,] 1.16 0.73 0.38 0.73 1.03 0.74 0.41 -0.23 0.39 NA [4,] 0.38 0.18 1.53 0.20 0.61 0.22 -1.22 -0.81 -0.03 NA [5,] -0.01 0.25 1.20 1.21 -0.13 -0.39 -0.81 0.09 0.25 NA [6,] 0.50 0.49 0.53 -0.16 -0.17 -0.06 0.29 0.63 1.12 NA [7,] 0.09 -0.52 -1.93 0.91 0.04 0.11 1.47 0.28 -0.59 NA [8,] -1.66 0.20 -0.34 -0.51 0.17 0.57 0.83 0.79 -0.58 NA [9,] -0.87 0.74 -1.64 -0.55 0.12 -0.02 -0.48 -1.19 -0.08 NA [10,] 0.08 1.78 -2.66 1.01 0.50 0.03 -1.09 -0.22 -0.79 NA [11,] 0.22 -0.78 -1.88 -0.04 1.23 -0.25 -0.35 0.51 -0.96 NA [12,] -1.13 -0.16 -0.57 0.87 0.82 1.02 -0.08 -0.29 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/17yp61444826846.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/20csy1444826846.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/3p1ux1444826846.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/4gjvp1444826846.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,] 85.46 85.85 86.66 87.39 87.59 88.09 88.58 88.06 87.16 86.29 [2,] 86.48 86.62 86.93 87.86 88.24 88.80 88.73 89.55 89.04 89.00 [3,] 90.33 90.27 91.50 92.53 93.14 94.23 94.76 92.88 93.05 93.17 [4,] 99.49 99.84 100.07 100.04 99.23 99.28 99.57 100.23 100.63 99.83 [5,] 99.87 100.51 100.90 101.31 100.43 100.68 101.80 101.21 101.87 101.39 [,11] [,12] [1,] 86.37 86.31 [2,] 89.50 89.46 [3,] 93.67 94.90 [4,] 99.61 98.80 [5,] 100.30 100.12 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 83.47807 83.30747 84.5796 86.1152 87.35193 88.71053 89.05093 87.2552 [2,] 97.18193 97.23253 98.4204 98.9448 98.92807 99.74947 100.46907 98.5048 [,9] [,10] [,11] [,12] [1,] 86.94593 87.4662 88.3454 89.98093 [2,] 99.15407 98.8738 98.9946 99.81907 $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(85.46, 86.48, 90.33, 99.49, 99.87, 85.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5iyib1444826846.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.06 -0.24 0.38 -0.03 -0.39 -0.17 -0.59 -1.66 -1.64 -2.66 -1.88 -1.130 [2,] 0.00 0.04 0.39 -0.03 -0.13 -0.06 -0.52 -0.51 -0.87 -0.79 -0.78 -0.430 [3,] 0.35 1.06 0.73 0.20 0.09 0.49 0.09 0.17 -0.48 0.03 -0.25 -0.120 [4,] 0.39 1.23 0.74 0.38 0.25 0.53 0.28 0.57 -0.02 0.50 0.22 0.845 [5,] 0.88 1.44 1.16 0.61 0.25 1.12 1.47 0.83 0.74 1.78 1.23 1.020 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.1446 0.4332667 0.5456667 -0.01593333 -0.1101333 0.1792667 -0.3313333 [2,] 0.5554 1.6867333 0.9143333 0.41593333 0.2901333 0.8007333 0.5113333 [,8] [,9] [,10] [,11] [,12] [1,] -0.3988 -0.92766667 -0.6494 -0.7766667 -0.8322333 [2,] 0.7388 -0.03233333 0.7094 0.2766667 0.5922333 $out [1] -0.23 1.53 -1.22 -0.81 1.20 1.21 -0.81 -1.93 $group [1] 3 4 4 4 5 5 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0600000000000023, 0, 0.350000000000009, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rhvo1444826846.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,] 86.290 85.460 86.31 85.740 90.330 97.520 99.280 99.230 99.760 NA [2,] 86.480 87.295 89.83 87.025 92.015 97.775 99.705 99.720 99.930 NA [3,] 86.930 88.075 91.31 88.565 92.945 98.200 100.195 99.995 100.445 NA [4,] 88.235 88.790 92.93 89.250 93.155 98.585 101.175 100.250 100.655 NA [5,] 88.820 90.780 94.76 89.550 93.670 98.720 101.870 101.020 101.210 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.12953 87.39312 89.89607 87.55016 92.42504 97.83055 99.52452 99.75326 [2,] 87.73047 88.75688 92.72393 89.57984 93.46496 98.56945 100.86548 100.23674 [,9] [,10] [1,] 100.1143 NA [2,] 100.7757 NA $out [1] 90.27 94.90 95.72 96.08 101.80 98.80 $group [1] 5 5 6 6 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(86.29, 86.48, 86.93, 88.235, 88.82, 85.46, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7tmqy1444826846.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,] 92.52889 90.270 92.9850 [2,] 93.68167 92.015 93.6175 [3,] 94.17111 93.095 94.0850 [4,] 94.55333 93.950 94.4850 [5,] 94.76667 94.900 94.8900 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 93.77354 92.21243 93.68933 [2,] 94.56868 93.97757 94.48067 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(92.5288888888889, 93.6816666666667, 94.1711111111111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17yp61444826846.ps tmp/17yp61444826846.png",intern=TRUE)) character(0) > try(system("convert tmp/20csy1444826846.ps tmp/20csy1444826846.png",intern=TRUE)) character(0) > try(system("convert tmp/3p1ux1444826846.ps tmp/3p1ux1444826846.png",intern=TRUE)) character(0) > try(system("convert tmp/4gjvp1444826846.ps tmp/4gjvp1444826846.png",intern=TRUE)) character(0) > try(system("convert tmp/5iyib1444826846.ps tmp/5iyib1444826846.png",intern=TRUE)) character(0) > try(system("convert tmp/6rhvo1444826846.ps tmp/6rhvo1444826846.png",intern=TRUE)) character(0) > try(system("convert tmp/7tmqy1444826846.ps tmp/7tmqy1444826846.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.505 0.419 2.946