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(79.21,79.08,79.88,80.57,80.9,80.89,80.61,80.98,81.68,83.28,83.94,89.25,95.3,97.68,98.53,98.32,97.02,90.13,88.49,88.07,87.17,86.1,86.59,85.89,85.82,86.68,86.3,86.32,85.61,85.52,85.97,86.6,86.78,84.98,85.21,86.39,88.39,88.83,95.76,100.98,102.56,102.92,104.35,105.07,105.41,105.06,104.33,104.61,104.78,104.38,104.08,103.4,101.72,100.1,100.37,96.27,95.28,95.85,96.76,97,96.71,96.97,96.97,98.01,99.18,99.51,99.16,99.4,97.59,96.71,96.56,96.42) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 79.21 95.30 85.82 88.39 104.78 96.71 NA [2,] 79.08 97.68 86.68 88.83 104.38 96.97 NA [3,] 79.88 98.53 86.30 95.76 104.08 96.97 NA [4,] 80.57 98.32 86.32 100.98 103.40 98.01 NA [5,] 80.90 97.02 85.61 102.56 101.72 99.18 NA [6,] 80.89 90.13 85.52 102.92 100.10 99.51 NA [7,] 80.61 88.49 85.97 104.35 100.37 99.16 NA [8,] 80.98 88.07 86.60 105.07 96.27 99.40 NA [9,] 81.68 87.17 86.78 105.41 95.28 97.59 NA [10,] 83.28 86.10 84.98 105.06 95.85 96.71 NA [11,] 83.94 86.59 85.21 104.33 96.76 96.56 NA [12,] 89.25 85.89 86.39 104.61 97.00 96.42 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.13 2.38 0.86 0.44 -0.40 0.26 NA [2,] 0.80 0.85 -0.38 6.93 -0.30 0.00 NA [3,] 0.69 -0.21 0.02 5.22 -0.68 1.04 NA [4,] 0.33 -1.30 -0.71 1.58 -1.68 1.17 NA [5,] -0.01 -6.89 -0.09 0.36 -1.62 0.33 NA [6,] -0.28 -1.64 0.45 1.43 0.27 -0.35 NA [7,] 0.37 -0.42 0.63 0.72 -4.10 0.24 NA [8,] 0.70 -0.90 0.18 0.34 -0.99 -1.81 NA [9,] 1.60 -1.07 -1.80 -0.35 0.57 -0.88 NA [10,] 0.66 0.49 0.23 -0.73 0.91 -0.15 NA [11,] 5.31 -0.70 1.18 0.28 0.24 -0.14 NA [12,] 6.05 -0.07 2.00 0.17 -0.29 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/1fhxq1444930174.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/28mz11444930174.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/3her31444930174.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/44bij1444930174.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,] 79.210 79.08 79.880 80.570 80.90 80.89 80.610 80.98 81.680 [2,] 85.820 86.68 86.300 86.320 85.61 85.52 85.970 86.60 86.780 [3,] 91.845 92.90 96.365 98.165 98.10 94.82 93.825 92.17 91.225 [4,] 96.710 97.68 98.530 100.980 101.72 100.10 100.370 99.40 97.590 [5,] 104.780 104.38 104.080 103.400 102.56 102.92 104.350 105.07 105.410 [,10] [,11] [,12] [1,] 83.280 83.940 85.890 [2,] 84.980 85.210 86.390 [3,] 90.975 91.575 92.835 [4,] 96.710 96.760 97.000 [5,] 105.060 104.330 104.610 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 84.8206 85.80464 88.47625 88.70883 87.70853 85.41543 84.53653 [2,] 98.8694 99.99536 104.25375 107.62117 108.49147 104.22457 103.11347 [,8] [,9] [,10] [,11] [,12] [1,] 83.91359 84.2522 83.40877 84.12488 85.99121 [2,] 100.42641 98.1978 98.54123 99.02512 99.67879 $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(79.21, 85.82, 91.845, 96.71, 104.78, 79.08, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ldwn1444930174.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.40 -0.38 -0.680 -1.68 -1.62 -0.350 -0.420 -1.81 -1.800 -0.73 -0.70 [2,] -0.13 -0.30 -0.210 -1.30 -1.62 -0.350 -0.420 -0.99 -1.070 -0.15 -0.14 [3,] 0.35 0.40 0.355 -0.19 -0.05 -0.005 0.305 -0.36 -0.615 0.36 0.26 [4,] 0.86 0.85 1.040 1.17 0.33 0.450 0.630 0.34 0.570 0.66 1.18 [5,] 0.86 0.85 1.040 1.58 0.36 1.430 0.720 0.70 1.600 0.91 1.18 [,12] [1,] -0.29 [2,] -0.07 [3,] 0.17 [4,] 2.00 [5,] 2.00 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.288582 -0.3417871 -0.4512904 -1.78323 -1.307813 -0.5210258 -0.3722839 [2,] 0.988582 1.1417871 1.1612904 1.40323 1.207813 0.5110258 0.9822839 [,8] [,9] [,10] [,11] [,12] [1,] -1.217893 -1.672853 -0.1624762 -0.5914426 -1.292657 [2,] 0.497893 0.442853 0.8824762 1.1114426 1.632657 $out [1] 2.38 6.93 5.22 -6.89 -1.64 -4.10 5.31 6.05 $group [1] 1 2 3 5 6 7 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.400000000000006, -0.129999999999995, 0.350000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gvu61444930174.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] [1,] 79.080 85.89 84.980 88.830 95.280 96.42 NA [2,] 80.225 86.88 85.565 98.370 96.515 96.71 NA [3,] 80.895 89.31 86.135 103.625 100.235 97.28 NA [4,] 82.480 97.35 86.495 104.835 103.740 99.17 NA [5,] 83.940 98.53 86.780 105.410 104.780 99.51 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 79.86648 84.53456 85.71082 100.6763 96.93963 96.15798 NA [2,] 81.92352 94.08544 86.55918 106.5737 103.53037 98.40202 NA $out [1] 89.25 88.39 $group [1] 1 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(79.08, 80.225, 80.895, 82.48, 83.94, 85.89, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7gr0m1444930174.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,] 91.70167 90.9750 90.87750 [2,] 92.25083 91.7100 91.67750 [3,] 92.94500 92.8675 92.57625 [4,] 93.42333 95.5925 93.36812 [5,] 94.60000 98.1650 94.77875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 92.41021 91.09667 91.80514 [2,] 93.47979 94.63833 93.34736 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(91.7016666666667, 92.2508333333333, 92.945, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fhxq1444930174.ps tmp/1fhxq1444930174.png",intern=TRUE)) character(0) > try(system("convert tmp/28mz11444930174.ps tmp/28mz11444930174.png",intern=TRUE)) character(0) > try(system("convert tmp/3her31444930174.ps tmp/3her31444930174.png",intern=TRUE)) character(0) > try(system("convert tmp/44bij1444930174.ps tmp/44bij1444930174.png",intern=TRUE)) character(0) > try(system("convert tmp/5ldwn1444930174.ps tmp/5ldwn1444930174.png",intern=TRUE)) character(0) > try(system("convert tmp/6gvu61444930174.ps tmp/6gvu61444930174.png",intern=TRUE)) character(0) > try(system("convert tmp/7gr0m1444930174.ps tmp/7gr0m1444930174.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.802 0.455 3.282