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.83,89.01,88.21,87.78,87.93,88.11,88.2,88.12,88.38,87.65,88.24,87.83,87.75,87.88,87.61,88.05,87.77,87.79,88.34,88.48,88.75,87.95,89.09,88.73,89.24,89.77,89.84,90.97,91.53,92.2,92.27,92.42,92.07,91.73,92.1,91.68,92.63,93.02,92.66,93.23,93.79,93.92,94.04,94.23,94.37,94.29,94.38,94,94.11,93.98,93.42,93.3,93.32,93.75,93.82,94.06,94.09,93.64,93.9,93.18,93.54,93.55,93.8,93.39,93.27,93.58,93.47,93.75,93.3,92.65,92.96,92.84,93.29,93.57,93.54,94.38,93.98,94.48,94.63,95.45,95.59,94.76,95.66,95.03,96.45,97.15,97.5,98.54,99.54,100.33,100.28,101.81,101.91,101.92,102.68,101.9,102.14,102.3,102.06,102.4,102.99,102.99,102.83,103.01,102.6,102.18,102.6,101.44) > 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.83 87.75 89.24 92.63 94.11 93.54 93.29 96.45 102.14 NA [2,] 89.01 87.88 89.77 93.02 93.98 93.55 93.57 97.15 102.30 NA [3,] 88.21 87.61 89.84 92.66 93.42 93.80 93.54 97.50 102.06 NA [4,] 87.78 88.05 90.97 93.23 93.30 93.39 94.38 98.54 102.40 NA [5,] 87.93 87.77 91.53 93.79 93.32 93.27 93.98 99.54 102.99 NA [6,] 88.11 87.79 92.20 93.92 93.75 93.58 94.48 100.33 102.99 NA [7,] 88.20 88.34 92.27 94.04 93.82 93.47 94.63 100.28 102.83 NA [8,] 88.12 88.48 92.42 94.23 94.06 93.75 95.45 101.81 103.01 NA [9,] 88.38 88.75 92.07 94.37 94.09 93.30 95.59 101.91 102.60 NA [10,] 87.65 87.95 91.73 94.29 93.64 92.65 94.76 101.92 102.18 NA [11,] 88.24 89.09 92.10 94.38 93.90 92.96 95.66 102.68 102.60 NA [12,] 87.83 88.73 91.68 94.00 93.18 92.84 95.03 101.90 101.44 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.18 0.13 0.53 0.39 -0.13 0.01 0.28 0.70 0.16 NA [2,] -0.80 -0.27 0.07 -0.36 -0.56 0.25 -0.03 0.35 -0.24 NA [3,] -0.43 0.44 1.13 0.57 -0.12 -0.41 0.84 1.04 0.34 NA [4,] 0.15 -0.28 0.56 0.56 0.02 -0.12 -0.40 1.00 0.59 NA [5,] 0.18 0.02 0.67 0.13 0.43 0.31 0.50 0.79 0.00 NA [6,] 0.09 0.55 0.07 0.12 0.07 -0.11 0.15 -0.05 -0.16 NA [7,] -0.08 0.14 0.15 0.19 0.24 0.28 0.82 1.53 0.18 NA [8,] 0.26 0.27 -0.35 0.14 0.03 -0.45 0.14 0.10 -0.41 NA [9,] -0.73 -0.80 -0.34 -0.08 -0.45 -0.65 -0.83 0.01 -0.42 NA [10,] 0.59 1.14 0.37 0.09 0.26 0.31 0.90 0.76 0.42 NA [11,] -0.41 -0.36 -0.42 -0.38 -0.72 -0.12 -0.63 -0.78 -1.16 NA [12,] -0.08 0.51 0.95 0.11 0.36 0.45 1.42 0.24 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/14w981444928426.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/29jta1444928426.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/36nhr1444928426.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/4z7ks1444928426.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] [,11] [,12] [1,] 87.75 87.88 87.61 87.78 87.93 92.20 92.27 88.12 88.38 87.65 88.24 87.83 [2,] 89.24 89.77 89.84 90.97 91.53 92.20 92.27 92.42 92.07 91.73 92.10 91.68 [3,] 93.29 93.55 93.42 93.30 93.32 93.75 93.82 94.06 94.09 93.64 93.90 93.18 [4,] 94.11 93.98 93.80 94.38 93.98 94.48 94.63 95.45 95.59 94.76 95.66 95.03 [5,] 96.45 97.15 97.50 98.54 93.98 94.48 94.63 95.45 95.59 94.76 95.66 95.03 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 90.72513 91.33273 91.3344 91.50407 92.02967 92.5492 92.57707 92.4642 [2,] 95.85487 95.76727 95.5056 95.09593 94.61033 94.9508 95.06293 95.6558 [,9] [,10] [,11] [,12] [1,] 92.23613 92.0442 92.02507 91.41567 [2,] 95.94387 95.2358 95.77493 94.94433 $out [1] 102.14 102.30 102.06 102.40 87.77 99.54 102.99 88.11 87.79 100.33 [11] 102.99 88.20 88.34 100.28 102.83 101.81 103.01 101.91 102.60 101.92 [21] 102.18 102.68 102.60 101.90 101.44 $group [1] 1 2 3 4 5 5 5 6 6 6 6 7 7 7 7 8 8 9 9 10 10 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(87.75, 89.24, 93.29, 94.11, 96.45, 87.88, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qd041444928426.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.13 -0.80 -0.43 -0.40 0.00 -0.16 0.14 -0.45 -0.83 0.09 -1.16 -0.080 [2,] 0.13 -0.36 -0.12 -0.12 0.13 -0.05 0.15 -0.35 -0.73 0.31 -0.72 0.175 [3,] 0.18 -0.24 0.44 0.15 0.31 0.07 0.19 0.10 -0.45 0.42 -0.42 0.405 [4,] 0.39 0.07 0.84 0.56 0.50 0.12 0.28 0.14 -0.34 0.76 -0.38 0.730 [5,] 0.70 0.35 1.13 1.00 0.79 0.15 0.28 0.27 0.01 1.14 -0.12 1.420 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.04306667 -0.46646667 -0.0656 -0.2081333 0.1151333 -0.01953333 0.1215333 [2,] 0.31693333 -0.01353333 0.9456 0.5081333 0.5048667 0.15953333 0.2584667 [,8] [,9] [,10] [,11] [,12] [1,] -0.1580667 -0.6554 0.183 -0.5990667 0.09496903 [2,] 0.3580667 -0.2446 0.657 -0.2409333 0.71503097 $out [1] 0.55 -0.08 0.82 1.53 $group [1] 6 7 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.129999999999995, 0.129999999999995, 0.180000000000007, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6uwg11444928426.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,] 87.65 87.610 89.240 92.630 93.180 92.650 93.290 96.450 101.44 NA [2,] 87.88 87.780 90.405 93.125 93.370 93.115 93.775 98.020 102.16 NA [3,] 88.16 88.000 91.705 93.960 93.785 93.430 94.555 100.305 102.50 NA [4,] 88.31 88.605 92.150 94.260 94.020 93.565 95.240 101.905 102.91 NA [5,] 88.83 89.090 92.420 94.380 94.110 93.800 95.660 102.680 103.01 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 87.96387 87.62371 90.90909 93.44232 93.48853 93.22475 93.8868 98.53303 [2,] 88.35613 88.37629 92.50091 94.47768 94.08147 93.63525 95.2232 102.07697 [,9] [,10] [1,] 102.1579 NA [2,] 102.8421 NA $out [1] 89.01 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(87.65, 87.88, 88.16, 88.31, 88.83, 87.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7uemy1444928426.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,] 93.10889 93.180 91.6750 [2,] 93.45944 93.310 92.2750 [3,] 94.07778 93.595 93.2925 [4,] 94.38556 93.860 93.6400 [5,] 94.62333 94.090 93.9350 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 93.65537 93.34414 92.66991 [2,] 94.50018 93.84586 93.91509 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.1088888888889, 93.4594444444444, 94.0777777777778, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14w981444928426.ps tmp/14w981444928426.png",intern=TRUE)) character(0) > try(system("convert tmp/29jta1444928426.ps tmp/29jta1444928426.png",intern=TRUE)) character(0) > try(system("convert tmp/36nhr1444928426.ps tmp/36nhr1444928426.png",intern=TRUE)) character(0) > try(system("convert tmp/4z7ks1444928426.ps tmp/4z7ks1444928426.png",intern=TRUE)) character(0) > try(system("convert tmp/5qd041444928426.ps tmp/5qd041444928426.png",intern=TRUE)) character(0) > try(system("convert tmp/6uwg11444928426.ps tmp/6uwg11444928426.png",intern=TRUE)) character(0) > try(system("convert tmp/7uemy1444928426.ps tmp/7uemy1444928426.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.612 0.412 3.053