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.58,80.08,80.41,80.34,80.32,80.39,81.01,81.54,82.48,84.68,88.26,90.6,92.46,93.31,93.58,93.92,93.92,93.67,93.76,93.95,93.89,94.07,93.93,93.35,93.58,93.55,93.44,93.38,93.17,92.95,93.37,94.13,94.07,94,94.47,94.81,94.18,94.14,93.96,93.23,93.13,92.51,92.49,92.73,92.75,92.83,92.85,93.27,93.98,94.34,94.57,94.62,94.82,95.07,95.72,96.06,96.54,96.38,96.8,97.02,97.29,97.45,97.95,97.69,97.63,97.35,97.38,98.06,98.34,98.53,98.79,98.77,99.2,99.76,99.84,99.83,99.88,99.48,99.66,99.58,99.89,100.7,101.19,100.99,101.52,101.75,101.56,102.57,102.66,102.62,102.76,102.73,102.26,101.72,101.48,100.93) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 79.58 92.46 93.58 94.18 93.98 97.29 99.20 101.52 NA [2,] 80.08 93.31 93.55 94.14 94.34 97.45 99.76 101.75 NA [3,] 80.41 93.58 93.44 93.96 94.57 97.95 99.84 101.56 NA [4,] 80.34 93.92 93.38 93.23 94.62 97.69 99.83 102.57 NA [5,] 80.32 93.92 93.17 93.13 94.82 97.63 99.88 102.66 NA [6,] 80.39 93.67 92.95 92.51 95.07 97.35 99.48 102.62 NA [7,] 81.01 93.76 93.37 92.49 95.72 97.38 99.66 102.76 NA [8,] 81.54 93.95 94.13 92.73 96.06 98.06 99.58 102.73 NA [9,] 82.48 93.89 94.07 92.75 96.54 98.34 99.89 102.26 NA [10,] 84.68 94.07 94.00 92.83 96.38 98.53 100.70 101.72 NA [11,] 88.26 93.93 94.47 92.85 96.80 98.79 101.19 101.48 NA [12,] 90.60 93.35 94.81 93.27 97.02 98.77 100.99 100.93 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.50 0.85 -0.03 -0.04 0.36 0.16 0.56 0.23 NA [2,] 0.33 0.27 -0.11 -0.18 0.23 0.50 0.08 -0.19 NA [3,] -0.07 0.34 -0.06 -0.73 0.05 -0.26 -0.01 1.01 NA [4,] -0.02 0.00 -0.21 -0.10 0.20 -0.06 0.05 0.09 NA [5,] 0.07 -0.25 -0.22 -0.62 0.25 -0.28 -0.40 -0.04 NA [6,] 0.62 0.09 0.42 -0.02 0.65 0.03 0.18 0.14 NA [7,] 0.53 0.19 0.76 0.24 0.34 0.68 -0.08 -0.03 NA [8,] 0.94 -0.06 -0.06 0.02 0.48 0.28 0.31 -0.47 NA [9,] 2.20 0.18 -0.07 0.08 -0.16 0.19 0.81 -0.54 NA [10,] 3.58 -0.14 0.47 0.02 0.42 0.26 0.49 -0.24 NA [11,] 2.34 -0.58 0.34 0.42 0.22 -0.02 -0.20 -0.55 NA [12,] 1.86 0.23 -0.63 0.71 0.27 0.43 0.53 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/1a7k71444938210.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/2pyp41444938210.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/3t2ys1444938210.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/4xjqf1444938210.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,] 92.460 93.310 93.440 93.230 93.130 92.510 92.49 92.730 92.750 [2,] 93.020 93.430 93.510 93.305 93.150 92.730 92.93 93.340 93.320 [3,] 94.080 94.240 94.265 94.270 94.370 94.370 94.74 95.095 95.305 [4,] 98.245 98.605 98.895 98.760 98.755 98.415 98.52 98.820 99.115 [5,] 101.520 101.750 101.560 102.570 102.660 102.620 102.76 102.730 102.260 [,10] [,11] [,12] [1,] 84.680 88.260 90.600 [2,] 93.415 93.390 93.310 [3,] 95.225 95.635 95.915 [4,] 99.615 99.990 99.850 [5,] 101.720 101.480 100.990 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 91.16124 91.34917 91.25686 91.22276 91.23897 91.19428 91.61735 92.03379 [2,] 96.99876 97.13083 97.27314 97.31724 97.50103 97.54572 97.86265 98.15621 [,9] [,10] [,11] [,12] [1,] 92.06783 91.76159 91.94815 92.26166 [2,] 98.54217 98.68841 99.32185 99.56834 $out [1] 79.58 80.08 80.41 80.34 80.32 80.39 81.01 81.54 82.48 $group [1] 1 2 3 4 5 6 7 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(92.46, 93.02, 94.08, 98.245, 101.52, 93.31, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5l0o01444938210.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.040 -0.190 -0.260 -0.21 -0.620 -0.02 -0.080 -0.470 -0.540 -0.24 -0.580 [2,] 0.065 -0.145 -0.165 -0.08 -0.340 0.06 0.080 -0.060 -0.115 -0.06 -0.375 [3,] 0.295 0.155 -0.035 -0.01 -0.235 0.16 0.290 0.150 0.130 0.34 0.100 [4,] 0.530 0.300 0.195 0.07 0.015 0.52 0.605 0.395 0.500 0.48 0.380 [5,] 0.850 0.500 0.340 0.20 0.250 0.65 0.760 0.940 0.810 0.49 0.420 [,12] [1,] 0.23 [2,] 0.25 [3,] 0.43 [4,] 0.62 [5,] 0.71 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.03524432 -0.09358339 -0.2361012 -0.09379215 -0.4333081 -0.0969626 [2,] 0.55475568 0.40358339 0.1661012 0.07379215 -0.0366919 0.4169626 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.003272537 -0.1041695 -0.2135478 0.03834825 -0.3217538 0.209042 [2,] 0.583272537 0.4041695 0.4735478 0.64165175 0.5217538 0.650958 $out [1] -0.73 1.01 2.20 3.58 2.34 1.86 -0.63 $group [1] 3 3 9 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0400000000000063, 0.0649999999999977, 0.295000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hopg1444938210.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] [1,] 79.58 93.310 92.950 92.490 93.980 97.290 99.200 100.930 NA [2,] 80.33 93.465 93.375 92.740 94.595 97.415 99.620 101.540 NA [3,] 80.71 93.825 93.565 92.990 95.395 97.820 99.835 102.005 NA [4,] 83.58 93.925 94.100 93.615 96.460 98.435 100.295 102.640 NA [5,] 88.26 94.070 94.810 94.180 97.020 98.790 101.190 102.760 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 79.22765 93.61519 93.23432 92.59091 94.54436 97.35477 99.52713 101.5033 [2,] 82.19235 94.03481 93.89568 93.38909 96.24564 98.28523 100.14287 102.5067 [,9] [1,] NA [2,] NA $out [1] 90.60 92.46 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(79.58, 80.33, 80.71, 83.58, 88.26, 93.31, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7vyuh1444938210.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,] 93.97375 94.0800 95.36125 [2,] 94.35563 94.2675 95.61312 [3,] 94.48313 94.5550 95.88375 [4,] 95.19563 95.2650 96.24312 [5,] 96.21750 95.9150 96.52500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 94.10000 94.10003 95.5964 [2,] 94.86625 95.00997 96.1711 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.97375, 94.355625, 94.483125, 95.195625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1a7k71444938210.ps tmp/1a7k71444938210.png",intern=TRUE)) character(0) > try(system("convert tmp/2pyp41444938210.ps tmp/2pyp41444938210.png",intern=TRUE)) character(0) > try(system("convert tmp/3t2ys1444938210.ps tmp/3t2ys1444938210.png",intern=TRUE)) character(0) > try(system("convert tmp/4xjqf1444938210.ps tmp/4xjqf1444938210.png",intern=TRUE)) character(0) > try(system("convert tmp/5l0o01444938210.ps tmp/5l0o01444938210.png",intern=TRUE)) character(0) > try(system("convert tmp/6hopg1444938210.ps tmp/6hopg1444938210.png",intern=TRUE)) character(0) > try(system("convert tmp/7vyuh1444938210.ps tmp/7vyuh1444938210.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.449 0.442 2.920