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(88.52,90.15,88.63,88.32,88.51,88.53,88.35,88.4,88.41,88.47,88.46,89.28,89.11,90.74,89.49,88.62,89.09,89.14,89.45,89.33,89.44,89.54,89.52,90.48,90.04,91.93,91.25,89.27,90.57,90.79,90.83,90.76,91.29,91.48,91.63,92.63,91.7,93.86,92.45,92.03,92.71,93.15,92.98,92.73,93.29,93.2,93.34,93.95,93.43,95.67,94.02,93.51,94.6,94.27,94.05,94.1,94.51,94.53,94.2,93.58,94.94,96.24,95.77,94.41,95.09,95.37,95.17,95.05,95.33,95.42,95.95,96.12,96.94,98.73,98.03,97.42,98.39,98.77,98.46,98.3,98.25,98.33,98.61,98.99,98.8,100.26,100.85,98.87,99.81,100.44,100.07,99.8,99.77,99.9,100.58,100.86,101.05,101.3,101.45,101.13,101.38,101.03,100.79,100.84,101.17,101.36,101.14,101.24) > 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,] 88.52 89.11 90.04 91.70 93.43 94.94 96.94 98.80 101.05 NA [2,] 90.15 90.74 91.93 93.86 95.67 96.24 98.73 100.26 101.30 NA [3,] 88.63 89.49 91.25 92.45 94.02 95.77 98.03 100.85 101.45 NA [4,] 88.32 88.62 89.27 92.03 93.51 94.41 97.42 98.87 101.13 NA [5,] 88.51 89.09 90.57 92.71 94.60 95.09 98.39 99.81 101.38 NA [6,] 88.53 89.14 90.79 93.15 94.27 95.37 98.77 100.44 101.03 NA [7,] 88.35 89.45 90.83 92.98 94.05 95.17 98.46 100.07 100.79 NA [8,] 88.40 89.33 90.76 92.73 94.10 95.05 98.30 99.80 100.84 NA [9,] 88.41 89.44 91.29 93.29 94.51 95.33 98.25 99.77 101.17 NA [10,] 88.47 89.54 91.48 93.20 94.53 95.42 98.33 99.90 101.36 NA [11,] 88.46 89.52 91.63 93.34 94.20 95.95 98.61 100.58 101.14 NA [12,] 89.28 90.48 92.63 93.95 93.58 96.12 98.99 100.86 101.24 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1.63 1.63 1.89 2.16 2.24 1.30 1.79 1.46 0.25 NA [2,] -1.52 -1.25 -0.68 -1.41 -1.65 -0.47 -0.70 0.59 0.15 NA [3,] -0.31 -0.87 -1.98 -0.42 -0.51 -1.36 -0.61 -1.98 -0.32 NA [4,] 0.19 0.47 1.30 0.68 1.09 0.68 0.97 0.94 0.25 NA [5,] 0.02 0.05 0.22 0.44 -0.33 0.28 0.38 0.63 -0.35 NA [6,] -0.18 0.31 0.04 -0.17 -0.22 -0.20 -0.31 -0.37 -0.24 NA [7,] 0.05 -0.12 -0.07 -0.25 0.05 -0.12 -0.16 -0.27 0.05 NA [8,] 0.01 0.11 0.53 0.56 0.41 0.28 -0.05 -0.03 0.33 NA [9,] 0.06 0.10 0.19 -0.09 0.02 0.09 0.08 0.13 0.19 NA [10,] -0.01 -0.02 0.15 0.14 -0.33 0.53 0.28 0.68 -0.22 NA [11,] 0.82 0.96 1.00 0.61 -0.62 0.17 0.38 0.28 0.10 NA [12,] -0.17 -0.44 -0.93 -0.52 1.36 0.82 -0.19 0.19 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/1ntdk1445102085.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/2gye31445102085.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/3cwpo1445102085.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/4093h1445102085.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,] 88.52 90.15 88.63 88.32 88.51 88.53 88.35 88.40 88.41 88.47 [2,] 90.04 91.93 91.25 89.27 90.57 90.79 90.83 90.76 91.29 91.48 [3,] 93.43 95.67 94.02 93.51 94.60 94.27 94.05 94.10 94.51 94.53 [4,] 96.94 98.73 98.03 97.42 98.39 98.77 98.46 98.30 98.25 98.33 [5,] 101.05 101.30 101.45 101.13 101.38 101.03 100.79 100.84 101.17 101.36 [,11] [,12] [1,] 88.46 89.28 [2,] 91.63 92.63 [3,] 94.20 93.95 [4,] 98.61 98.99 [5,] 101.14 101.24 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 89.796 92.08867 90.4492 89.21767 90.48147 90.0672 90.03153 90.12893 [2,] 97.064 99.25133 97.5908 97.80233 98.71853 98.4728 98.06847 98.07107 [,9] [,10] [,11] [,12] [1,] 90.8444 90.92233 90.52387 90.6004 [2,] 98.1756 98.13767 97.87613 97.2996 $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(88.52, 90.04, 93.43, 96.94, 101.05, 90.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b9m51445102085.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,] 1.30 -1.65 -1.98 0.19 -0.35 -0.31 -0.27 -0.05 0.02 -0.33 -0.62 -0.930 [2,] 1.46 -1.41 -1.36 0.47 0.02 -0.24 -0.16 0.01 0.06 -0.02 0.17 -0.480 [3,] 1.63 -0.70 -0.61 0.68 0.22 -0.20 -0.12 0.28 0.09 0.14 0.38 -0.180 [4,] 1.89 -0.47 -0.42 0.97 0.38 -0.17 0.05 0.41 0.13 0.28 0.82 0.505 [5,] 2.24 0.59 -0.31 1.30 0.63 -0.17 0.05 0.56 0.19 0.68 1.00 1.360 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.403533 -1.1950667 -1.1050667 0.4166667 0.0304 -0.2368667 -0.2306 [2,] 1.856467 -0.2049333 -0.1149333 0.9433333 0.4096 -0.1631333 -0.0094 [,8] [,9] [,10] [,11] [,12] [1,] 0.06933333 0.05313333 -0.018 0.03766667 -0.7302351 [2,] 0.49066667 0.12686667 0.298 0.72233333 0.3702351 $out [1] 0.25 0.31 0.04 -0.37 -0.09 $group [1] 1 6 6 6 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.3, 1.46000000000001, 1.63000000000001, 1.89, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6a4m81445102085.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,] 88.320 88.620 90.040 91.700 93.43 94.41 97.42 98.800 100.790 NA [2,] 88.405 89.125 90.665 92.580 93.80 95.07 98.14 99.785 101.040 NA [3,] 88.490 89.445 91.040 93.065 94.15 95.35 98.36 99.985 101.155 NA [4,] 88.580 89.530 91.555 93.315 94.52 95.86 98.67 100.510 101.330 NA [5,] 88.630 89.540 92.630 93.950 94.60 96.24 98.99 100.860 101.450 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 88.41018 89.26028 90.63407 92.72976 93.8216 94.98968 98.11826 99.65432 [2,] 88.56982 89.62972 91.44593 93.40024 94.4784 95.71032 98.60174 100.31568 [,9] [,10] [1,] 101.0227 NA [2,] 101.2873 NA $out [1] 90.15 89.28 90.74 90.48 89.27 95.67 96.94 $group [1] 1 1 2 2 3 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(88.32, 88.405, 88.49, 88.58, 88.63, 88.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7d0dj1445102085.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,] 94.36778 93.430 94.4800 [2,] 94.41444 93.985 94.5050 [3,] 94.60833 94.150 94.7075 [4,] 94.75889 94.520 95.0125 [5,] 95.23667 94.600 95.3300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 94.45123 93.90598 94.47603 [2,] 94.76544 94.39402 94.93897 $out [1] 93.83667 95.43111 93.73111 95.67000 93.49000 93.34500 95.81000 $group [1] 1 1 1 2 3 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(94.3677777777778, 94.4144444444444, 94.6083333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ntdk1445102085.ps tmp/1ntdk1445102085.png",intern=TRUE)) character(0) > try(system("convert tmp/2gye31445102085.ps tmp/2gye31445102085.png",intern=TRUE)) character(0) > try(system("convert tmp/3cwpo1445102085.ps tmp/3cwpo1445102085.png",intern=TRUE)) character(0) > try(system("convert tmp/4093h1445102085.ps tmp/4093h1445102085.png",intern=TRUE)) character(0) > try(system("convert tmp/5b9m51445102085.ps tmp/5b9m51445102085.png",intern=TRUE)) character(0) > try(system("convert tmp/6a4m81445102085.ps tmp/6a4m81445102085.png",intern=TRUE)) character(0) > try(system("convert tmp/7d0dj1445102085.ps tmp/7d0dj1445102085.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.445 0.435 2.905