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.16,91.17,91.17,91.38,92.68,92.72,92.79,92.81,92.81,92.81,92.81,92.81,92.81,92.82,92.82,92.88,93.38,93.89,94.1,94.18,94.3,94.31,94.36,94.38,94.38,94.5,94.57,94.89,96.71,97.57,97.88,97.97,98.4,98.51,98.46,98.46,98.48,98.6,98.6,98.71,99.13,99.2,99.3,100.18,101.37,101.77,102.28,102.38,102.35,103.23,105.37,106.62,107,107.24,107.31,107.35,107.42,107.58,107.64,107.64) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 91.16 92.81 94.38 98.48 102.35 NA [2,] 91.17 92.82 94.50 98.60 103.23 NA [3,] 91.17 92.82 94.57 98.60 105.37 NA [4,] 91.38 92.88 94.89 98.71 106.62 NA [5,] 92.68 93.38 96.71 99.13 107.00 NA [6,] 92.72 93.89 97.57 99.20 107.24 NA [7,] 92.79 94.10 97.88 99.30 107.31 NA [8,] 92.81 94.18 97.97 100.18 107.35 NA [9,] 92.81 94.30 98.40 101.37 107.42 NA [10,] 92.81 94.31 98.51 101.77 107.58 NA [11,] 92.81 94.36 98.46 102.28 107.64 NA [12,] 92.81 94.38 98.46 102.38 107.64 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.01 0.01 0.12 0.12 0.88 NA [2,] 0.00 0.00 0.07 0.00 2.14 NA [3,] 0.21 0.06 0.32 0.11 1.25 NA [4,] 1.30 0.50 1.82 0.42 0.38 NA [5,] 0.04 0.51 0.86 0.07 0.24 NA [6,] 0.07 0.21 0.31 0.10 0.07 NA [7,] 0.02 0.08 0.09 0.88 0.04 NA [8,] 0.00 0.12 0.43 1.19 0.07 NA [9,] 0.00 0.01 0.11 0.40 0.16 NA [10,] 0.00 0.05 -0.05 0.51 0.06 NA [11,] 0.00 0.02 0.00 0.10 0.00 NA [12,] 0.00 0.00 0.02 -0.03 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/1hgmi1445000653.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/2uch81445000653.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/3xg0k1445000653.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/48pev1445000653.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,] 91.16 91.17 91.17 91.38 92.68 92.72 92.79 92.81 92.81 92.81 92.81 [2,] 92.81 92.82 92.82 92.88 93.38 93.89 94.10 94.18 94.30 94.31 94.36 [3,] 94.38 94.50 94.57 94.89 96.71 97.57 97.88 97.97 98.40 98.51 98.46 [4,] 98.48 98.60 98.60 98.71 99.13 99.20 99.30 100.18 101.37 101.77 102.28 [5,] 102.35 103.23 105.37 106.62 107.00 99.20 99.30 107.35 107.42 107.58 107.64 [,12] [1,] 92.81 [2,] 94.38 [3,] 98.46 [4,] 102.38 [5,] 107.64 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.37359 90.41587 90.48587 90.77054 92.64706 93.81797 94.20569 [2,] 98.38641 98.58413 98.65413 99.00946 100.77294 101.32203 101.55431 [,8] [,9] [,10] [,11] [,12] [1,] 93.73042 93.40436 93.23878 92.86375 92.80722 [2,] 102.20958 103.39564 103.78122 104.05625 104.11278 $out [1] 107.24 107.31 $group [1] 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(91.16, 92.81, 94.38, 98.48, 102.35, 91.17, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5w5x81445000653.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.01 0.00 0.06 0.38 0.04 0.07 0.02 0.00 0.00 -0.05 0.00 -0.030 [2,] 0.01 0.00 0.11 0.42 0.07 0.07 0.04 0.07 0.01 0.00 0.00 -0.015 [3,] 0.12 0.00 0.21 0.50 0.24 0.10 0.08 0.12 0.11 0.05 0.00 0.000 [4,] 0.12 0.07 0.32 1.30 0.51 0.21 0.09 0.43 0.16 0.06 0.02 0.010 [5,] 0.12 0.07 0.32 1.82 0.86 0.31 0.09 0.43 0.16 0.06 0.02 0.020 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.04227428 -0.04946182 0.06161453 -0.1218058 -0.07090289 0.001076353 [2,] 0.19772572 0.04946182 0.35838547 1.1218058 0.55090289 0.198923647 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.04467013 -0.1343751 0.004010378 0.007604151 -0.01413195 -0.01975 [2,] 0.11532987 0.3743751 0.215989622 0.092395849 0.01413195 0.01975 $out [1] 0.88 2.14 1.25 0.88 1.19 0.40 0.51 0.10 $group [1] 1 2 3 7 8 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.00999999999999091, 0.0100000000000051, 0.11999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6e8dw1445000653.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] [1,] 91.160 92.810 94.380 98.480 105.370 NA [2,] 91.275 92.850 94.730 98.655 105.995 NA [3,] 92.755 93.995 97.725 99.250 107.275 NA [4,] 92.810 94.305 98.430 101.570 107.500 NA [5,] 92.810 94.380 98.510 102.380 107.640 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.05488 93.33136 96.03741 97.92045 106.5886 NA [2,] 93.45512 94.65864 99.41259 100.57955 107.9614 NA $out [1] 102.35 103.23 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(91.16, 91.275, 92.755, 92.81, 92.81, 92.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ejnv1445000653.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,] 95.836 94.380 95.6450 [2,] 96.701 94.730 95.7525 [3,] 98.200 97.725 96.6225 [4,] 98.928 98.430 97.9375 [5,] 99.134 98.510 98.3800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.18425 96.03741 95.62591 [2,] 99.21575 99.41259 97.61909 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(95.836, 96.701, 98.2, 98.928, 99.134, 94.38, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hgmi1445000653.ps tmp/1hgmi1445000653.png",intern=TRUE)) character(0) > try(system("convert tmp/2uch81445000653.ps tmp/2uch81445000653.png",intern=TRUE)) character(0) > try(system("convert tmp/3xg0k1445000653.ps tmp/3xg0k1445000653.png",intern=TRUE)) character(0) > try(system("convert tmp/48pev1445000653.ps tmp/48pev1445000653.png",intern=TRUE)) character(0) > try(system("convert tmp/5w5x81445000653.ps tmp/5w5x81445000653.png",intern=TRUE)) character(0) > try(system("convert tmp/6e8dw1445000653.ps tmp/6e8dw1445000653.png",intern=TRUE)) character(0) > try(system("convert tmp/7ejnv1445000653.ps tmp/7ejnv1445000653.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.512 0.498 3.032