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(83.36,83.61,83.41,83.64,84.06,83.93,84.1,84.37,84.18,84.11,84.56,84.2,84.45,84.28,84.28,84.7,85.04,85.31,85.18,85.02,86.31,86.56,86.4,86.84,87.42,87.28,87.27,87.73,87.32,87.15,87.5,87.43,88.81,89.38,88.83,88.91,89.34,89.56,89.32,89.31,89.45,88.92,89.35,88.89,90.1,90.49,89.96,89.93,90.32,90.24,90.61,91.06,90.81,91.09,91.17,90.87,91.92,92.67,92.03,92.09,92.61,92.19,92.68,92.66,92.77,92.21,92.58,91.9,93.81,94.05,94.51,94.49,94.36,94.72,95.57,95.87,95.93,96.09,95.82,96.06,97.09,97.67,98.53,98.12,98.84,98.98,100.04,99.47,99.84,99.52,99.81,99.55,100.21,101.44,101,101.32,101.84,101.81,101.83,102.18,101.97,101.8,101.69,101.91,102.27,102.73,102.61,102.89) > 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,] 83.36 84.45 87.42 89.34 90.32 92.61 94.36 98.84 101.84 NA [2,] 83.61 84.28 87.28 89.56 90.24 92.19 94.72 98.98 101.81 NA [3,] 83.41 84.28 87.27 89.32 90.61 92.68 95.57 100.04 101.83 NA [4,] 83.64 84.70 87.73 89.31 91.06 92.66 95.87 99.47 102.18 NA [5,] 84.06 85.04 87.32 89.45 90.81 92.77 95.93 99.84 101.97 NA [6,] 83.93 85.31 87.15 88.92 91.09 92.21 96.09 99.52 101.80 NA [7,] 84.10 85.18 87.50 89.35 91.17 92.58 95.82 99.81 101.69 NA [8,] 84.37 85.02 87.43 88.89 90.87 91.90 96.06 99.55 101.91 NA [9,] 84.18 86.31 88.81 90.10 91.92 93.81 97.09 100.21 102.27 NA [10,] 84.11 86.56 89.38 90.49 92.67 94.05 97.67 101.44 102.73 NA [11,] 84.56 86.40 88.83 89.96 92.03 94.51 98.53 101.00 102.61 NA [12,] 84.20 86.84 88.91 89.93 92.09 94.49 98.12 101.32 102.89 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.25 -0.17 -0.14 0.22 -0.08 -0.42 0.36 0.14 -0.03 NA [2,] -0.20 0.00 -0.01 -0.24 0.37 0.49 0.85 1.06 0.02 NA [3,] 0.23 0.42 0.46 -0.01 0.45 -0.02 0.30 -0.57 0.35 NA [4,] 0.42 0.34 -0.41 0.14 -0.25 0.11 0.06 0.37 -0.21 NA [5,] -0.13 0.27 -0.17 -0.53 0.28 -0.56 0.16 -0.32 -0.17 NA [6,] 0.17 -0.13 0.35 0.43 0.08 0.37 -0.27 0.29 -0.11 NA [7,] 0.27 -0.16 -0.07 -0.46 -0.30 -0.68 0.24 -0.26 0.22 NA [8,] -0.19 1.29 1.38 1.21 1.05 1.91 1.03 0.66 0.36 NA [9,] -0.07 0.25 0.57 0.39 0.75 0.24 0.58 1.23 0.46 NA [10,] 0.45 -0.16 -0.55 -0.53 -0.64 0.46 0.86 -0.44 -0.12 NA [11,] -0.36 0.44 0.08 -0.03 0.06 -0.02 -0.41 0.32 0.28 NA [12,] 0.25 0.58 0.43 0.39 0.52 -0.13 0.72 0.52 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/13zg81445599793.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/2q16t1445599793.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/30jgx1445599793.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/4u2371445599793.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,] 83.36 83.61 83.41 83.64 84.06 83.93 84.10 84.37 84.18 84.11 [2,] 87.42 87.28 87.27 87.73 87.32 87.15 87.50 87.43 88.81 89.38 [3,] 90.32 90.24 90.61 91.06 90.81 91.09 91.17 90.87 91.92 92.67 [4,] 94.36 94.72 95.57 95.87 95.93 96.09 95.82 96.06 97.09 97.67 [5,] 101.84 101.81 101.83 102.18 101.97 101.80 101.69 101.91 102.27 102.73 [,11] [,12] [1,] 84.56 84.20 [2,] 88.83 88.91 [3,] 92.03 92.09 [4,] 98.53 98.12 [5,] 102.61 102.89 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.66493 86.3216 86.23867 86.77293 86.2754 86.3816 86.78813 86.32487 [2,] 93.97507 94.1584 94.98133 95.34707 95.3446 95.7984 95.55187 95.41513 [,9] [,10] [,11] [,12] [1,] 87.5592 88.30393 86.92133 87.2394 [2,] 96.2808 97.03607 97.13867 96.9406 $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(83.36, 87.42, 90.32, 94.36, 101.84, 83.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5dxxw1445599793.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.42 -0.24 -0.57 -0.41 -0.56 -0.27 -0.68 -0.19 -0.07 -0.64 -0.41 0.250 [2,] -0.14 -0.01 -0.01 -0.21 -0.32 -0.11 -0.30 0.66 0.25 -0.53 -0.03 0.320 [3,] -0.03 0.02 0.30 0.11 -0.17 0.17 -0.16 1.05 0.46 -0.16 0.06 0.475 [4,] 0.22 0.49 0.42 0.34 0.16 0.35 0.22 1.29 0.58 0.45 0.28 0.550 [5,] 0.36 1.06 0.46 0.42 0.28 0.43 0.27 1.91 0.75 0.86 0.44 0.720 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.2196 -0.2433333 0.07353333 -0.1796667 -0.4228 -0.07226667 -0.4338667 [2,] 0.1596 0.2833333 0.52646667 0.3996667 0.0828 0.41226667 0.1138667 [,8] [,9] [,10] [,11] [,12] [1,] 0.7182 0.2862 -0.6761333 -0.1032667 0.3465187 [2,] 1.3818 0.6338 0.3561333 0.2232667 0.6034813 $out [1] 1.23 -0.13 $group [1] 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.420000000000002, -0.140000000000001, -0.0300000000000011, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6srg31445599793.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,] 83.360 84.280 87.150 88.890 90.240 91.900 94.360 98.840 101.69 NA [2,] 83.625 84.575 87.300 89.315 90.710 92.395 95.695 99.495 101.82 NA [3,] 84.080 85.110 87.465 89.400 91.075 92.670 95.995 99.825 101.94 NA [4,] 84.190 86.355 88.820 89.945 91.975 93.930 97.380 100.605 102.44 NA [5,] 84.560 86.840 89.380 90.490 92.670 94.510 98.530 101.440 102.89 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 83.8223 84.29813 86.77172 89.11265 90.49803 91.96988 95.22646 99.31872 [2,] 84.3377 85.92187 88.15828 89.68735 91.65197 93.37012 96.76354 100.33128 [,9] [,10] [1,] 101.6572 NA [2,] 102.2228 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(83.36, 83.625, 84.08, 84.19, 84.56, 84.28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/728kn1445599793.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,] 91.39333 90.240 90.8900 [2,] 91.72278 90.710 91.5200 [3,] 91.87833 91.075 91.7025 [4,] 92.95167 91.975 93.2325 [5,] 93.23333 92.670 93.6800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 91.31783 90.49803 90.92142 [2,] 92.43884 91.65197 92.48358 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(91.3933333333333, 91.7227777777778, 91.8783333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13zg81445599793.ps tmp/13zg81445599793.png",intern=TRUE)) character(0) > try(system("convert tmp/2q16t1445599793.ps tmp/2q16t1445599793.png",intern=TRUE)) character(0) > try(system("convert tmp/30jgx1445599793.ps tmp/30jgx1445599793.png",intern=TRUE)) character(0) > try(system("convert tmp/4u2371445599793.ps tmp/4u2371445599793.png",intern=TRUE)) character(0) > try(system("convert tmp/5dxxw1445599793.ps tmp/5dxxw1445599793.png",intern=TRUE)) character(0) > try(system("convert tmp/6srg31445599793.ps tmp/6srg31445599793.png",intern=TRUE)) character(0) > try(system("convert tmp/728kn1445599793.ps tmp/728kn1445599793.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.449 0.435 2.926