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(93.58,95.79,94.77,94.2,96.23,92.3,88.86,86.44,86.21,88.57,90.69,89,86.88,90.65,90.68,89.64,102.62,101.84,92.51,94.29,94.68,96.94,94.03,89.65,84.9,89.07,89.8,93.22,92.23,98.41,96.63,89.8,90,92.13,93.27,90.81,85.42,88.28,88.73,90.18,92.74,96.13,94.85,94.25,96.94,101.22,98.71,95.51,93.91,98.17,97.59,99.64,107.88,108.49,100.25,99.27,101.73,101.25,97.09,94.74,94.53,93.48,96.05,106.22,98.33,99.86,93.78,88.96,83.77,89.46,86.78,88.4) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 93.58 86.88 84.90 85.42 93.91 94.53 NA [2,] 95.79 90.65 89.07 88.28 98.17 93.48 NA [3,] 94.77 90.68 89.80 88.73 97.59 96.05 NA [4,] 94.20 89.64 93.22 90.18 99.64 106.22 NA [5,] 96.23 102.62 92.23 92.74 107.88 98.33 NA [6,] 92.30 101.84 98.41 96.13 108.49 99.86 NA [7,] 88.86 92.51 96.63 94.85 100.25 93.78 NA [8,] 86.44 94.29 89.80 94.25 99.27 88.96 NA [9,] 86.21 94.68 90.00 96.94 101.73 83.77 NA [10,] 88.57 96.94 92.13 101.22 101.25 89.46 NA [11,] 90.69 94.03 93.27 98.71 97.09 86.78 NA [12,] 89.00 89.65 90.81 95.51 94.74 88.40 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.21 3.77 4.17 2.86 4.26 -1.05 NA [2,] -1.02 0.03 0.73 0.45 -0.58 2.57 NA [3,] -0.57 -1.04 3.42 1.45 2.05 10.17 NA [4,] 2.03 12.98 -0.99 2.56 8.24 -7.89 NA [5,] -3.93 -0.78 6.18 3.39 0.61 1.53 NA [6,] -3.44 -9.33 -1.78 -1.28 -8.24 -6.08 NA [7,] -2.42 1.78 -6.83 -0.60 -0.98 -4.82 NA [8,] -0.23 0.39 0.20 2.69 2.46 -5.19 NA [9,] 2.36 2.26 2.13 4.28 -0.48 5.69 NA [10,] 2.12 -2.91 1.14 -2.51 -4.16 -2.68 NA [11,] -1.69 -4.38 -2.46 -3.20 -2.35 1.62 NA [12,] -2.12 -4.75 -5.39 -1.60 -0.21 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/1yaww1444987235.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/2qn7g1444987235.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/3kkjr1444987235.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/4khph1444987235.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,] 84.90 88.280 88.730 89.64 92.23 92.300 88.860 86.440 83.77 88.570 [2,] 85.42 89.070 89.800 90.18 92.74 96.130 92.510 88.960 86.21 89.460 [3,] 90.23 92.065 92.725 93.71 97.28 99.135 94.315 92.025 92.34 94.535 [4,] 93.91 95.790 96.050 99.64 102.62 101.840 96.630 94.290 96.94 101.220 [5,] 94.53 98.170 97.590 106.22 107.88 108.490 100.250 99.270 101.73 101.250 [,11] [,12] [1,] 86.78 88.40 [2,] 90.69 89.00 [3,] 93.65 90.23 [4,] 97.09 94.74 [5,] 98.71 95.51 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 84.75368 87.73038 88.69355 87.60799 90.90708 95.45187 91.65747 88.58698 [2,] 95.70632 96.39962 96.75645 99.81201 103.65292 102.81813 96.97253 95.46302 [,9] [,10] [,11] [,12] [1,] 85.4188 86.94942 89.52179 86.52751 [2,] 99.2612 102.12058 97.77821 93.93249 $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(84.9, 85.42, 90.23, 93.91, 94.53, 88.28, 89.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58bq71444987235.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] [1,] 2.210 -1.02 -1.04 -7.890 -3.93 -9.33 -6.83 -0.230 -0.48 -4.160 -4.380 [2,] 2.210 -0.58 -0.57 -0.990 -0.78 -8.24 -4.82 -0.230 2.13 -2.910 -3.200 [3,] 3.315 0.24 1.75 2.295 1.07 -4.76 -1.70 0.295 2.31 -2.595 -2.405 [4,] 4.170 0.73 3.42 8.240 3.39 -1.78 -0.60 2.460 4.28 1.140 -1.690 [5,] 4.260 2.57 3.42 12.980 6.18 -1.28 1.78 2.690 5.69 2.120 -1.690 [,12] [1,] -5.39 [2,] -4.75 [3,] -2.12 [4,] -1.60 [5,] -0.21 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.050737 -0.6049923 -0.8236789 -3.658648 -1.619785 -8.9269087 -4.422036 [2,] 4.579263 1.0849923 4.3236789 8.248648 3.759785 -0.5930913 1.022036 [,8] [,9] [,10] [,11] [,12] [1,] -1.440137 0.9231806 -5.20738081 -3.378999 -4.3457821 [2,] 2.030137 3.6968194 0.01738081 -1.431001 0.1057821 $out [1] -1.05 10.17 -5.19 1.62 $group [1] 1 3 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2.21000000000001, 2.21000000000001, 3.315, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zesa1444987235.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] [1,] 86.210 86.88 84.900 85.420 93.910 83.77 NA [2,] 88.715 90.15 89.800 89.455 97.340 88.68 NA [3,] 91.495 93.27 91.470 94.550 99.455 93.63 NA [4,] 94.485 95.81 93.245 96.535 101.490 97.19 NA [5,] 96.230 102.62 98.410 101.220 101.730 106.22 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 88.86326 90.68844 89.89871 91.32076 97.56216 89.74853 NA [2,] 94.12674 95.85156 93.04129 97.77924 101.34784 97.51147 NA $out [1] 107.88 108.49 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(86.21, 88.715, 91.495, 94.485, 96.23, 86.88, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73b6q1444987235.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,] 89.8700 90.2300 89.80625 [2,] 92.1950 92.0450 91.74562 [3,] 93.1825 93.1875 93.35250 [4,] 95.2225 94.4250 94.87437 [5,] 99.5050 97.2800 99.02250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 91.80164 92.10197 91.92546 [2,] 94.56336 94.27303 94.77954 $out [1] 99.135 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(89.87, 92.195, 93.1825, 95.2225, 99.505, 90.23, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yaww1444987235.ps tmp/1yaww1444987235.png",intern=TRUE)) character(0) > try(system("convert tmp/2qn7g1444987235.ps tmp/2qn7g1444987235.png",intern=TRUE)) character(0) > try(system("convert tmp/3kkjr1444987235.ps tmp/3kkjr1444987235.png",intern=TRUE)) character(0) > try(system("convert tmp/4khph1444987235.ps tmp/4khph1444987235.png",intern=TRUE)) character(0) > try(system("convert tmp/58bq71444987235.ps tmp/58bq71444987235.png",intern=TRUE)) character(0) > try(system("convert tmp/6zesa1444987235.ps tmp/6zesa1444987235.png",intern=TRUE)) character(0) > try(system("convert tmp/73b6q1444987235.ps tmp/73b6q1444987235.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.435 0.409 2.869