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.04,91.37,91.36,91.4,91.54,91.57,91.57,91.47,91.55,91.71,91.71,92.12,93.28,94.02,94.26,94.19,94.34,94.62,94.9,96.08,96.85,96.61,96.47,96.68,96.43,96.35,96.14,95.39,95.08,94.86,94.8,95.62,96.35,96.77,96.97,96.78,97.71,98.04,98.41,100.05,100.9,100.61,100.71,100.06,100.57,101.03,100.93,100.98,100.46,101.52,101.29,101.84,102.03,101.72,102.23,102.38,102.5,101.5,101.96,101.61) > 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.04 93.28 96.43 97.71 100.46 NA [2,] 91.37 94.02 96.35 98.04 101.52 NA [3,] 91.36 94.26 96.14 98.41 101.29 NA [4,] 91.40 94.19 95.39 100.05 101.84 NA [5,] 91.54 94.34 95.08 100.90 102.03 NA [6,] 91.57 94.62 94.86 100.61 101.72 NA [7,] 91.57 94.90 94.80 100.71 102.23 NA [8,] 91.47 96.08 95.62 100.06 102.38 NA [9,] 91.55 96.85 96.35 100.57 102.50 NA [10,] 91.71 96.61 96.77 101.03 101.50 NA [11,] 91.71 96.47 96.97 100.93 101.96 NA [12,] 92.12 96.68 96.78 100.98 101.61 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.33 0.74 -0.08 0.33 1.06 NA [2,] -0.01 0.24 -0.21 0.37 -0.23 NA [3,] 0.04 -0.07 -0.75 1.64 0.55 NA [4,] 0.14 0.15 -0.31 0.85 0.19 NA [5,] 0.03 0.28 -0.22 -0.29 -0.31 NA [6,] 0.00 0.28 -0.06 0.10 0.51 NA [7,] -0.10 1.18 0.82 -0.65 0.15 NA [8,] 0.08 0.77 0.73 0.51 0.12 NA [9,] 0.16 -0.24 0.42 0.46 -1.00 NA [10,] 0.00 -0.14 0.20 -0.10 0.46 NA [11,] 0.41 0.21 -0.19 0.05 -0.35 NA [12,] 1.16 -0.25 0.93 -0.52 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/1fbk91445008749.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/23rgr1445008749.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/3mwal1445008749.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/4tlim1445008749.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.04 91.37 91.36 91.40 91.54 91.57 91.57 91.47 91.55 91.71 [2,] 93.28 94.02 94.26 94.19 94.34 94.62 94.80 95.62 96.35 96.61 [3,] 96.43 96.35 96.14 95.39 95.08 94.86 94.90 96.08 96.85 96.77 [4,] 97.71 98.04 98.41 100.05 100.90 100.61 100.71 100.06 100.57 101.03 [5,] 100.46 101.52 101.29 101.84 102.03 101.72 102.23 102.38 102.50 101.50 [,11] [,12] [1,] 91.71 92.12 [2,] 96.47 96.68 [3,] 96.97 96.78 [4,] 100.93 100.98 [5,] 101.96 101.61 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 93.29977 93.50948 93.20762 91.24934 90.44472 90.62748 90.72401 92.94271 [2,] 99.56023 99.19052 99.07238 99.53066 99.71528 99.09252 99.07599 99.21729 [,9] [,10] [,11] [,12] [1,] 93.86816 93.64684 93.81858 93.74163 [2,] 99.83184 99.89316 100.12142 99.81837 $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.04, 93.28, 96.43, 97.71, 100.46, 91.37, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50iwd1445008749.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.08 -0.23 -0.75 0.14 -0.31 -0.06 -0.65 0.08 -1.00 -0.14 -0.35 -0.520 [2,] 0.33 -0.21 -0.07 0.14 -0.29 0.00 -0.10 0.12 -0.24 -0.10 -0.19 -0.385 [3,] 0.33 -0.01 0.04 0.15 -0.22 0.10 0.15 0.51 0.16 0.00 0.05 0.340 [4,] 0.74 0.24 0.55 0.19 0.03 0.28 0.82 0.73 0.42 0.20 0.21 1.045 [5,] 1.06 0.37 0.55 0.19 0.28 0.51 1.18 0.77 0.46 0.46 0.41 1.160 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.04029503 -0.3279689 -0.3980904 0.1146701 -0.446111194 -0.09784729 [2,] 0.61970497 0.3079689 0.4780904 0.1853299 0.006111194 0.29784729 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.5000697 0.07897554 -0.3063543 -0.2119792 -0.232639 -0.7897 [2,] 0.8000697 0.94102446 0.6263543 0.2119792 0.332639 1.4697 $out [1] 1.64 -0.31 0.85 $group [1] 3 4 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0800000000000125, 0.329999999999998, 0.330000000000013, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6felv1445008749.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.040 93.280 94.800 97.710 101.29 NA [2,] 91.385 94.225 95.235 99.230 101.51 NA [3,] 91.545 94.760 96.245 100.590 101.78 NA [4,] 91.640 96.540 96.600 100.915 102.13 NA [5,] 91.710 96.850 96.970 101.030 102.50 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 91.42869 93.70411 95.62241 99.82146 101.4972 NA [2,] 91.66131 95.81589 96.86759 101.35854 102.0628 NA $out [1] 92.12 100.46 $group [1] 1 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(91.04, 91.385, 91.545, 91.64, 91.71, 93.28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7jq7k1445008749.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.784 94.860 95.4950 [2,] 96.433 95.235 96.7275 [3,] 96.810 96.245 97.6875 [4,] 97.544 96.775 98.5800 [5,] 97.634 96.970 98.8300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 96.30327 95.5426 96.84256 [2,] 97.31673 96.9474 98.53244 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(95.784, 96.433, 96.81, 97.544, 97.634, 94.86, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fbk91445008749.ps tmp/1fbk91445008749.png",intern=TRUE)) character(0) > try(system("convert tmp/23rgr1445008749.ps tmp/23rgr1445008749.png",intern=TRUE)) character(0) > try(system("convert tmp/3mwal1445008749.ps tmp/3mwal1445008749.png",intern=TRUE)) character(0) > try(system("convert tmp/4tlim1445008749.ps tmp/4tlim1445008749.png",intern=TRUE)) character(0) > try(system("convert tmp/50iwd1445008749.ps tmp/50iwd1445008749.png",intern=TRUE)) character(0) > try(system("convert tmp/6felv1445008749.ps tmp/6felv1445008749.png",intern=TRUE)) character(0) > try(system("convert tmp/7jq7k1445008749.ps tmp/7jq7k1445008749.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.595 0.479 3.098