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(91.99,92.17,92.19,92.24,92.19,92.21,92.22,92.14,92.43,92.93,93.01,93.07,93.08,93.11,93.21,93.49,93.48,93.51,93.52,93.49,93.76,94.25,94.42,94.45,94.45,94.53,94.78,95.05,95.21,95.23,95.23,95.34,95.93,96.75,97.15,97.21,97.21,97.35,97.44,97.34,97.44,97.43,97.43,97.47,97.69,98.54,98.64,98.72,98.72,98.73,98.68,98.75,98.73,98.74,98.75,98.85,99.14,99.83,99.93,100,100,100.08,100.25,100.4,100.33,100.29,100.29,100.32,100.82,101.42,101.46,101.55,101.56,101.56,101.6,101.66,101.82,101.94,101.95,101.93,102.26,102.65,102.9,102.94,99.14,99.18,99.23,99.32,99.46,99.5,99.95,100.13,100.43,101.09,101.27,101.29,101.04,101.14,101.11,101.01,101.08,101.06,101.26,101.32,101.4,101.85,102.12,102.15) > 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,] 91.99 93.08 94.45 97.21 98.72 100.00 101.56 99.14 101.04 NA [2,] 92.17 93.11 94.53 97.35 98.73 100.08 101.56 99.18 101.14 NA [3,] 92.19 93.21 94.78 97.44 98.68 100.25 101.60 99.23 101.11 NA [4,] 92.24 93.49 95.05 97.34 98.75 100.40 101.66 99.32 101.01 NA [5,] 92.19 93.48 95.21 97.44 98.73 100.33 101.82 99.46 101.08 NA [6,] 92.21 93.51 95.23 97.43 98.74 100.29 101.94 99.50 101.06 NA [7,] 92.22 93.52 95.23 97.43 98.75 100.29 101.95 99.95 101.26 NA [8,] 92.14 93.49 95.34 97.47 98.85 100.32 101.93 100.13 101.32 NA [9,] 92.43 93.76 95.93 97.69 99.14 100.82 102.26 100.43 101.40 NA [10,] 92.93 94.25 96.75 98.54 99.83 101.42 102.65 101.09 101.85 NA [11,] 93.01 94.42 97.15 98.64 99.93 101.46 102.90 101.27 102.12 NA [12,] 93.07 94.45 97.21 98.72 100.00 101.55 102.94 101.29 102.15 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.18 0.03 0.08 0.14 0.01 0.08 0.00 0.04 0.10 NA [2,] 0.02 0.10 0.25 0.09 -0.05 0.17 0.04 0.05 -0.03 NA [3,] 0.05 0.28 0.27 -0.10 0.07 0.15 0.06 0.09 -0.10 NA [4,] -0.05 -0.01 0.16 0.10 -0.02 -0.07 0.16 0.14 0.07 NA [5,] 0.02 0.03 0.02 -0.01 0.01 -0.04 0.12 0.04 -0.02 NA [6,] 0.01 0.01 0.00 0.00 0.01 0.00 0.01 0.45 0.20 NA [7,] -0.08 -0.03 0.11 0.04 0.10 0.03 -0.02 0.18 0.06 NA [8,] 0.29 0.27 0.59 0.22 0.29 0.50 0.33 0.30 0.08 NA [9,] 0.50 0.49 0.82 0.85 0.69 0.60 0.39 0.66 0.45 NA [10,] 0.08 0.17 0.40 0.10 0.10 0.04 0.25 0.18 0.27 NA [11,] 0.06 0.03 0.06 0.08 0.07 0.09 0.04 0.02 0.03 NA [12,] 0.01 0.00 0.00 0.00 0.00 0.01 -3.80 -0.25 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/1dr831444935421.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/2bpi41444935421.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/3ize91444935421.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/4n8hr1444935421.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,] 91.99 92.17 92.19 92.24 92.19 92.21 92.22 92.14 92.43 92.93 [2,] 94.45 94.53 94.78 95.05 95.21 95.23 95.23 95.34 95.93 96.75 [3,] 98.72 98.73 98.68 98.75 98.73 98.74 98.75 98.85 99.14 99.83 [4,] 100.00 100.08 100.25 100.40 100.33 100.29 100.29 100.32 100.82 101.42 [5,] 101.56 101.56 101.60 101.66 101.82 101.94 101.95 101.93 102.26 102.65 [,11] [,12] [1,] 93.01 93.07 [2,] 97.15 97.21 [3,] 99.93 100.00 [4,] 101.46 101.55 [5,] 102.90 102.94 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 95.797 95.807 95.79913 95.93233 96.03347 96.07507 96.08507 96.2272 [2,] 101.643 101.653 101.56087 101.56767 101.42653 101.40493 101.41493 101.4728 [,9] [,10] [,11] [,12] [1,] 96.5646 97.37047 97.66007 97.71427 [2,] 101.7154 102.28953 102.19993 102.28573 $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(91.99, 94.45, 98.72, 100, 101.56, 92.17, 94.53, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54y221444935421.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.00 -0.05 -0.10 -0.07 -0.04 0.00 -0.08 0.22 0.39 0.04 0.02 -0.250 [2,] 0.03 0.02 0.05 -0.02 -0.01 0.00 -0.02 0.27 0.49 0.10 0.03 -0.125 [3,] 0.08 0.05 0.07 0.07 0.02 0.01 0.04 0.29 0.60 0.17 0.06 0.000 [4,] 0.10 0.10 0.15 0.14 0.03 0.01 0.10 0.33 0.69 0.25 0.07 0.005 [5,] 0.18 0.17 0.28 0.16 0.04 0.01 0.18 0.33 0.85 0.40 0.09 0.010 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.04313333 0.007866667 0.01733333 -0.01426667 -0.001066667 0.004733333 [2,] 0.11686667 0.092133333 0.12266667 0.15426667 0.041066667 0.015266667 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.0232 0.2584 0.4946667 0.091 0.03893333 -0.07261987 [2,] 0.1032 0.3216 0.7053333 0.249 0.08106667 0.07261987 $out [1] 0.25 0.12 0.45 0.20 0.59 0.50 0.08 -3.80 $group [1] 2 5 6 6 8 8 8 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0.0300000000000011, 0.0799999999999983, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6pnhw1444935421.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,] 91.990 93.080 94.450 97.210 98.680 100.000 101.560 99.140 101.010 NA [2,] 92.180 93.345 94.915 97.390 98.730 100.270 101.630 99.275 101.070 NA [3,] 92.215 93.500 95.230 97.440 98.750 100.325 101.935 99.725 101.200 NA [4,] 92.680 94.005 96.340 98.115 99.485 101.120 102.455 100.760 101.625 NA [5,] 93.070 94.450 97.210 98.720 100.000 101.550 102.940 101.290 102.150 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 91.98695 93.19897 94.58005 97.10932 98.40564 99.93731 101.5587 99.04768 [2,] 92.44305 93.80103 95.87995 97.77068 99.09436 100.71269 102.3113 100.40232 [,9] [,10] [1,] 100.9469 NA [2,] 101.4531 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(91.99, 92.18, 92.215, 92.68, 93.07, 93.08, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/78tl11444935421.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,] 97.46556 98.680 97.225 [2,] 97.65278 98.730 97.620 [3,] 97.80611 98.750 97.765 [4,] 98.50944 99.485 98.730 [5,] 99.04222 100.000 99.380 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.41538 98.40564 97.25872 [2,] 98.19684 99.09436 98.27128 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.4655555555556, 97.6527777777778, 97.8061111111111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1dr831444935421.ps tmp/1dr831444935421.png",intern=TRUE)) character(0) > try(system("convert tmp/2bpi41444935421.ps tmp/2bpi41444935421.png",intern=TRUE)) character(0) > try(system("convert tmp/3ize91444935421.ps tmp/3ize91444935421.png",intern=TRUE)) character(0) > try(system("convert tmp/4n8hr1444935421.ps tmp/4n8hr1444935421.png",intern=TRUE)) character(0) > try(system("convert tmp/54y221444935421.ps tmp/54y221444935421.png",intern=TRUE)) character(0) > try(system("convert tmp/6pnhw1444935421.ps tmp/6pnhw1444935421.png",intern=TRUE)) character(0) > try(system("convert tmp/78tl11444935421.ps tmp/78tl11444935421.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.645 0.502 3.161