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(82.75,83.4,84.12,83.88,83.61,83.58,83.58,83.27,83.59,83.64,83.72,83.88,83.61,85.36,87.2,88.28,88.64,88.67,88.34,89.21,89.55,89.65,88.43,91.15,94.11,96.78,97.94,97.57,96.48,96.18,95,93.84,95.54,94.06,93.92,92.55,93.88,92.19,91.42,91.39,89.12,90.27,91.76,95.68,97.54,98.47,100.11,99.9,101.11,98.86,102.71,102.02,100.61,100.62,99.51,98.63,97.44,96.5,94.3,92.92,96.07,95,93.27,91.94,91.62,91.01,90.62,97.72,99.09,99.72,100.22,99.15,101.16,101.8,103.31,101.19,99.09,95.91,94.56,95.76,100.36,102.67,103.58,100.89,103.46,104.86,104.88,104.46,103.83,101,99.36,96.71,95.23,95.62,95.8,94.79,95.39,94.9,94.84,94.68,94.17,94.1,93.84,94.2,97.76,98.26,99.63,98.75) > 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,] 82.75 83.61 94.11 93.88 101.11 96.07 101.16 103.46 95.39 NA [2,] 83.40 85.36 96.78 92.19 98.86 95.00 101.80 104.86 94.90 NA [3,] 84.12 87.20 97.94 91.42 102.71 93.27 103.31 104.88 94.84 NA [4,] 83.88 88.28 97.57 91.39 102.02 91.94 101.19 104.46 94.68 NA [5,] 83.61 88.64 96.48 89.12 100.61 91.62 99.09 103.83 94.17 NA [6,] 83.58 88.67 96.18 90.27 100.62 91.01 95.91 101.00 94.10 NA [7,] 83.58 88.34 95.00 91.76 99.51 90.62 94.56 99.36 93.84 NA [8,] 83.27 89.21 93.84 95.68 98.63 97.72 95.76 96.71 94.20 NA [9,] 83.59 89.55 95.54 97.54 97.44 99.09 100.36 95.23 97.76 NA [10,] 83.64 89.65 94.06 98.47 96.50 99.72 102.67 95.62 98.26 NA [11,] 83.72 88.43 93.92 100.11 94.30 100.22 103.58 95.80 99.63 NA [12,] 83.88 91.15 92.55 99.90 92.92 99.15 100.89 94.79 98.75 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.65 1.75 2.67 -1.69 -2.25 -1.07 0.64 1.40 -0.49 NA [2,] 0.72 1.84 1.16 -0.77 3.85 -1.73 1.51 0.02 -0.06 NA [3,] -0.24 1.08 -0.37 -0.03 -0.69 -1.33 -2.12 -0.42 -0.16 NA [4,] -0.27 0.36 -1.09 -2.27 -1.41 -0.32 -2.10 -0.63 -0.51 NA [5,] -0.03 0.03 -0.30 1.15 0.01 -0.61 -3.18 -2.83 -0.07 NA [6,] 0.00 -0.33 -1.18 1.49 -1.11 -0.39 -1.35 -1.64 -0.26 NA [7,] -0.31 0.87 -1.16 3.92 -0.88 7.10 1.20 -2.65 0.36 NA [8,] 0.32 0.34 1.70 1.86 -1.19 1.37 4.60 -1.48 3.56 NA [9,] 0.05 0.10 -1.48 0.93 -0.94 0.63 2.31 0.39 0.50 NA [10,] 0.08 -1.22 -0.14 1.64 -2.20 0.50 0.91 0.18 1.37 NA [11,] 0.16 2.72 -1.37 -0.21 -1.38 -1.07 -2.69 -1.01 -0.88 NA [12,] -0.27 2.96 1.33 1.21 3.15 2.01 2.57 0.60 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/1s1to1444932014.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/2edl31444932014.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/3owkq1444932014.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/4slo71444932014.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] [1,] 83.61 83.40 84.12 83.88 83.61 83.58 88.34 93.84 95.23 89.65 88.43 [2,] 93.88 92.19 91.42 91.39 89.12 90.27 90.62 93.84 95.23 94.06 93.92 [3,] 95.39 95.00 94.84 94.68 94.17 94.10 93.84 95.68 97.44 96.50 95.80 [4,] 101.11 98.86 102.71 101.19 99.09 96.18 95.00 96.71 97.76 98.47 100.11 [5,] 103.46 104.86 104.88 104.46 103.83 101.00 99.51 98.63 100.36 102.67 103.58 [,12] [1,] 83.88 [2,] 92.55 [3,] 94.79 [4,] 99.15 [5,] 100.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,] 91.5822 91.48713 88.89393 89.51867 88.91913 90.9874 91.5332 94.16847 [2,] 99.1978 98.51287 100.78607 99.84133 99.42087 97.2126 96.1468 97.19153 [,9] [,10] [,11] [,12] [1,] 96.10753 94.1774 92.53993 91.314 [2,] 98.77247 98.8226 99.06007 98.266 $out [1] 82.75 83.58 83.27 89.21 83.59 89.55 83.64 83.72 $group [1] 1 7 8 8 9 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(83.61, 93.88, 95.39, 101.11, 103.46, 83.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mg8r1444932014.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,] -2.25 -1.73 -1.33 -2.27 -0.61 -1.64 -2.65 -1.48 0.05 -1.22 -2.69 -0.270 [2,] -1.07 -0.06 -0.69 -1.41 -0.61 -1.18 -0.88 0.32 0.05 -0.14 -1.37 0.905 [3,] 0.64 0.72 -0.37 -0.63 -0.07 -0.39 0.36 1.37 0.39 0.18 -1.01 1.670 [4,] 1.40 1.51 -0.16 -0.32 0.01 -0.26 1.20 1.86 0.63 0.91 -0.21 2.765 [5,] 2.67 3.85 -0.03 0.36 0.03 0.00 3.92 3.56 0.93 1.64 0.16 3.150 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.6608667 -0.1068667 -0.64913333 -1.20406667 -0.3965333 -0.87453333 [2,] 1.9408667 1.5468667 -0.09086667 -0.05593333 0.2565333 0.09453333 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.7354667 0.5589333 0.08453333 -0.373 -1.6209333 0.6309773 [2,] 1.4554667 2.1810667 0.69546667 0.733 -0.3990667 2.7090227 $out [1] 1.08 -2.12 1.15 -3.18 -2.83 1.49 7.10 4.60 -1.48 -0.94 2.31 -2.20 [13] 2.72 $group [1] 3 3 5 5 5 6 7 8 9 9 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.25, -1.06999999999999, 0.640000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6taw21444932014.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.27 85.360 92.55 89.120 92.920 90.620 94.560 94.790 93.840 NA [2,] 83.49 87.740 93.99 91.405 96.970 91.780 97.500 95.710 94.185 NA [3,] 83.60 88.535 95.27 93.035 99.185 95.535 101.025 100.180 94.870 NA [4,] 83.80 89.380 96.63 98.005 100.865 99.120 102.235 104.145 98.010 NA [5,] 84.12 91.150 97.94 100.110 102.710 100.220 103.580 104.880 99.630 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 83.45861 87.78698 94.06588 90.0247 97.40846 92.18718 98.86533 96.33274 [2,] 83.74139 89.28302 96.47412 96.0453 100.96154 98.88282 103.18467 104.02726 [,9] [,10] [1,] 93.12539 NA [2,] 96.61461 NA $out [1] 82.75 83.61 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(83.27, 83.49, 83.6, 83.8, 84.12, 85.36, 87.74, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7q09c1444932014.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.95222 93.840 92.8100 [2,] 94.01056 94.425 94.6900 [3,] 94.84056 94.920 96.0575 [4,] 95.26056 95.740 96.7550 [5,] 95.52333 97.440 97.4950 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 94.27042 94.32022 95.11564 [2,] 95.41069 95.51978 96.99936 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(92.9522222222222, 94.0105555555556, 94.8405555555556, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1s1to1444932014.ps tmp/1s1to1444932014.png",intern=TRUE)) character(0) > try(system("convert tmp/2edl31444932014.ps tmp/2edl31444932014.png",intern=TRUE)) character(0) > try(system("convert tmp/3owkq1444932014.ps tmp/3owkq1444932014.png",intern=TRUE)) character(0) > try(system("convert tmp/4slo71444932014.ps tmp/4slo71444932014.png",intern=TRUE)) character(0) > try(system("convert tmp/5mg8r1444932014.ps tmp/5mg8r1444932014.png",intern=TRUE)) character(0) > try(system("convert tmp/6taw21444932014.ps tmp/6taw21444932014.png",intern=TRUE)) character(0) > try(system("convert tmp/7q09c1444932014.ps tmp/7q09c1444932014.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.722 0.492 3.237