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(104.37,104.66,104.88,105.08,104.53,104.97,105.73,106.11,106.16,106.53,107.23,107.56,106.46,107.42,107.84,108.65,107.58,107.67,107.09,106.96,107.63,108.03,107.33,107.16,106.28,107.26,106.48,106.82,106.9,106.6,106.79,107.19,106.34,106.91,106.55,106.73,106.36,107.07,106.96,107.82,108.07,108.11,108.16,108.29,108.5,108.69,109.12,108.82,108.07,109.92,109.24,109.9,109.7,110.15,109.73,109.62,110.42,110.69,110.75,111.41,110.56,110.88,111.35,110.31,111.63,111.24,111.66,111.44,110.72,111.19,110.07,110.86,110.46,111,111.11,111.9,111.38,111.69,111.65,111.98,111.63,112.57,112.38,111.73) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.37 106.46 106.28 106.36 108.07 110.56 110.46 NA [2,] 104.66 107.42 107.26 107.07 109.92 110.88 111.00 NA [3,] 104.88 107.84 106.48 106.96 109.24 111.35 111.11 NA [4,] 105.08 108.65 106.82 107.82 109.90 110.31 111.90 NA [5,] 104.53 107.58 106.90 108.07 109.70 111.63 111.38 NA [6,] 104.97 107.67 106.60 108.11 110.15 111.24 111.69 NA [7,] 105.73 107.09 106.79 108.16 109.73 111.66 111.65 NA [8,] 106.11 106.96 107.19 108.29 109.62 111.44 111.98 NA [9,] 106.16 107.63 106.34 108.50 110.42 110.72 111.63 NA [10,] 106.53 108.03 106.91 108.69 110.69 111.19 112.57 NA [11,] 107.23 107.33 106.55 109.12 110.75 110.07 112.38 NA [12,] 107.56 107.16 106.73 108.82 111.41 110.86 111.73 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.29 0.96 0.98 0.71 1.85 0.32 0.54 NA [2,] 0.22 0.42 -0.78 -0.11 -0.68 0.47 0.11 NA [3,] 0.20 0.81 0.34 0.86 0.66 -1.04 0.79 NA [4,] -0.55 -1.07 0.08 0.25 -0.20 1.32 -0.52 NA [5,] 0.44 0.09 -0.30 0.04 0.45 -0.39 0.31 NA [6,] 0.76 -0.58 0.19 0.05 -0.42 0.42 -0.04 NA [7,] 0.38 -0.13 0.40 0.13 -0.11 -0.22 0.33 NA [8,] 0.05 0.67 -0.85 0.21 0.80 -0.72 -0.35 NA [9,] 0.37 0.40 0.57 0.19 0.27 0.47 0.94 NA [10,] 0.70 -0.70 -0.36 0.43 0.06 -1.12 -0.19 NA [11,] 0.33 -0.17 0.18 -0.30 0.66 0.79 -0.65 NA [12,] -1.10 -0.88 -0.37 -0.75 -0.85 -0.40 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/1sue31446230256.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/2690d1446230256.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/3jbo71446230256.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/47di31446230256.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] [1,] 104.370 104.660 104.880 105.080 104.53 104.970 105.73 106.110 106.160 [2,] 106.320 107.165 106.720 107.320 107.24 107.135 106.94 107.075 106.985 [3,] 106.460 107.420 107.840 108.650 108.07 108.110 108.16 108.290 108.500 [4,] 109.265 110.400 110.175 110.105 110.54 110.695 110.69 110.530 110.570 [5,] 110.560 111.000 111.350 111.900 111.63 111.690 111.66 111.980 111.630 [,10] [,11] [,12] [1,] 106.53 106.55 106.730 [2,] 107.47 107.28 107.360 [3,] 108.69 109.12 108.820 [4,] 110.94 110.41 111.135 [5,] 112.57 112.38 111.730 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.7013 105.4881 105.7767 106.9868 106.0993 105.984 105.9206 106.2267 [2,] 108.2187 109.3519 109.9033 110.3132 110.0407 110.236 110.3994 110.3533 [,9] [,10] [,11] [,12] [1,] 106.3591 106.6178 107.2508 106.5656 [2,] 110.6409 110.7622 110.9892 111.0744 $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(104.37, 106.32, 106.46, 109.265, 110.56, 104.66, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pkci1446230256.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] [1,] 0.29 -0.780 0.20 -1.070 -0.390 -0.580 -0.220 -0.850 0.19 -1.120 -0.650 [2,] 0.43 -0.395 0.27 -0.535 -0.130 -0.230 -0.120 -0.535 0.32 -0.530 -0.235 [3,] 0.71 0.110 0.66 -0.200 0.090 0.050 0.130 0.050 0.40 -0.190 0.180 [4,] 0.97 0.320 0.80 0.165 0.375 0.305 0.355 0.440 0.52 0.245 0.495 [5,] 0.98 0.470 0.86 0.250 0.450 0.760 0.400 0.800 0.57 0.700 0.790 [,12] [1,] -1.10 [2,] -0.88 [3,] -0.80 [4,] -0.40 [5,] -0.37 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3875207 -0.3169865 0.3434926 -0.6180287 -0.2115779 -0.2694934 -0.1536623 [2,] 1.0324793 0.5369865 0.9765074 0.2180287 0.3915779 0.3694934 0.4136623 [,8] [,9] [,10] [,11] [,12] [1,] -0.5322543 0.2805632 -0.6528175 -0.2559442 -1.1096155 [2,] 0.6322543 0.5194368 0.2728175 0.6159442 -0.4903845 $out [1] 1.85 -1.04 1.32 0.94 $group [1] 1 3 4 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.289999999999992, 0.43, 0.709999999999994, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68wi21446230256.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] [1,] 104.370 106.460 106.280 106.360 109.240 110.070 110.460 NA [2,] 104.770 107.125 106.515 107.445 109.660 110.640 111.245 NA [3,] 105.405 107.500 106.760 108.135 109.910 111.035 111.670 NA [4,] 106.345 107.755 106.905 108.595 110.555 111.395 111.940 NA [5,] 107.560 108.650 107.260 109.120 111.410 111.660 112.570 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.6866 107.2127 106.5821 107.6105 109.5018 110.6906 111.353 NA [2,] 106.1234 107.7873 106.9379 108.6595 110.3182 111.3794 111.987 NA $out [1] 108.07 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(104.37, 104.77, 105.405, 106.345, 107.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7z28j1446230256.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,] 108.2657 107.420 108.7125 [2,] 108.4286 107.955 108.7450 [3,] 108.6636 108.225 108.8088 [4,] 108.9300 108.670 108.9025 [5,] 109.2300 109.120 108.9150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 108.4349 107.8989 108.7369 [2,] 108.8923 108.5511 108.8806 $out [1] 107.5086 106.4600 107.7925 108.4475 109.2050 109.2475 $group [1] 1 2 3 3 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(108.265714285714, 108.428571428571, 108.663571428571, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1sue31446230256.ps tmp/1sue31446230256.png",intern=TRUE)) character(0) > try(system("convert tmp/2690d1446230256.ps tmp/2690d1446230256.png",intern=TRUE)) character(0) > try(system("convert tmp/3jbo71446230256.ps tmp/3jbo71446230256.png",intern=TRUE)) character(0) > try(system("convert tmp/47di31446230256.ps tmp/47di31446230256.png",intern=TRUE)) character(0) > try(system("convert tmp/5pkci1446230256.ps tmp/5pkci1446230256.png",intern=TRUE)) character(0) > try(system("convert tmp/68wi21446230256.ps tmp/68wi21446230256.png",intern=TRUE)) character(0) > try(system("convert tmp/7z28j1446230256.ps tmp/7z28j1446230256.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.672 0.488 3.182