R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(92.64,91.48,92.65,93.91,90.49,94.56,95.11,93.07,93.26,92.92,90.9,91.77,86.16,92.79,97.45,97.74,99.92,99.46,98.52,97.92,97.85,104.94,104.55,105.35,95.75,105.99,106.11,107.33,106.11,108.17,104.62,106.71,97.86,104.41,96.09,102.41,96.3,103.04,105.11,99.4,104.45,104.31,104.06,101.16,100.82,102.6,92.78,99.68,95.14,101.28,100.03,101.17,98.93,97.77,100.24,98.05,95.82,99.19,97.42,98.02,97.34,101.23,100.16,100.72,99.8,100.39,101.82,102.95,98.8,100.24,98.4,98.15) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (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,] 92.64 86.16 95.75 96.30 95.14 97.34 NA [2,] 91.48 92.79 105.99 103.04 101.28 101.23 NA [3,] 92.65 97.45 106.11 105.11 100.03 100.16 NA [4,] 93.91 97.74 107.33 99.40 101.17 100.72 NA [5,] 90.49 99.92 106.11 104.45 98.93 99.80 NA [6,] 94.56 99.46 108.17 104.31 97.77 100.39 NA [7,] 95.11 98.52 104.62 104.06 100.24 101.82 NA [8,] 93.07 97.92 106.71 101.16 98.05 102.95 NA [9,] 93.26 97.85 97.86 100.82 95.82 98.80 NA [10,] 92.92 104.94 104.41 102.60 99.19 100.24 NA [11,] 90.90 104.55 96.09 92.78 97.42 98.40 NA [12,] 91.77 105.35 102.41 99.68 98.02 98.15 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.16 6.63 10.24 6.74 6.14 3.89 NA [2,] 1.17 4.66 0.12 2.07 -1.25 -1.07 NA [3,] 1.26 0.29 1.22 -5.71 1.14 0.56 NA [4,] -3.42 2.18 -1.22 5.05 -2.24 -0.92 NA [5,] 4.07 -0.46 2.06 -0.14 -1.16 0.59 NA [6,] 0.55 -0.94 -3.55 -0.25 2.47 1.43 NA [7,] -2.04 -0.60 2.09 -2.90 -2.19 1.13 NA [8,] 0.19 -0.07 -8.85 -0.34 -2.23 -4.15 NA [9,] -0.34 7.09 6.55 1.78 3.37 1.44 NA [10,] -2.02 -0.39 -8.32 -9.82 -1.77 -1.84 NA [11,] 0.87 0.80 6.32 6.90 0.60 -0.25 NA [12,] -5.61 -9.60 -6.11 -4.54 -0.68 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/1qg9l1476190448.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/2ef911476190448.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/3chsl1476190448.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/49p5v1476190448.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,] 92.640 91.480 92.650 93.91 98.93 94.560 95.11 93.070 93.260 92.92 [2,] 92.640 92.790 97.450 97.74 98.93 97.770 98.52 97.920 95.820 99.19 [3,] 95.445 101.255 100.095 100.06 99.86 99.925 101.03 99.605 97.855 101.42 [4,] 96.300 103.040 105.110 101.17 104.45 104.310 104.06 102.950 98.800 104.41 [5,] 97.340 105.990 106.110 101.17 106.11 108.170 104.62 106.710 100.820 104.94 [,11] [,12] [1,] 90.900 91.770 [2,] 92.780 98.020 [3,] 96.755 98.915 [4,] 98.400 102.410 [5,] 104.550 105.350 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 93.08418 94.64342 95.15405 97.84754 96.29942 95.70649 97.45652 [2,] 97.80582 107.86658 105.03595 102.27246 103.42058 104.14351 104.60348 [,8] [,9] [,10] [,11] [,12] [1,] 96.36049 95.9328 98.05293 93.12992 96.08331 [2,] 102.84951 99.7772 104.78707 100.38008 101.74669 $out [1] 86.16 107.33 90.49 $group [1] 1 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(92.64, 92.64, 95.445, 96.3, 97.34, 91.48, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nrvb1476190448.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,] 3.890 -1.250 0.29 -3.42 -1.160 -3.55 -2.90 -8.850 -0.340 -9.82 -0.250 [2,] 3.890 -1.070 0.29 -2.24 -0.460 -0.94 -2.19 -4.150 1.440 -8.32 0.600 [3,] 6.385 0.645 0.85 -1.07 0.225 0.15 -1.32 -1.285 2.575 -1.93 0.835 [4,] 6.740 2.070 1.22 2.18 2.060 1.43 1.13 -0.070 6.550 -1.77 6.320 [5,] 10.240 4.660 1.26 5.05 4.070 2.47 2.09 0.190 7.090 -0.39 6.900 [,12] [1,] -6.11 [2,] -6.11 [3,] -5.61 [4,] -4.54 [5,] -4.54 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4.546658 -1.380401 0.25012 -3.921043 -1.400481 -1.378727 -3.4615072 [2,] 8.223342 2.670401 1.44988 1.781043 1.850481 1.678727 0.8215072 [,8] [,9] [,10] [,11] [,12] [1,] -3.916732 -0.721115 -6.154962 -2.854585 -6.719358 [2,] 1.346732 5.871115 2.294962 4.524585 -4.500642 $out [1] -1.16 -5.71 -9.60 -0.68 $group [1] 1 3 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3.89, 3.89, 6.38500000000001, 6.74000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kue31476190448.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,] 90.490 92.790 95.750 92.780 95.140 97.340 NA [2,] 91.625 97.595 100.135 99.540 97.595 98.600 NA [3,] 92.785 98.220 105.305 101.880 98.490 100.200 NA [4,] 93.585 102.235 106.410 104.185 100.135 100.975 NA [5,] 95.110 105.350 108.170 105.110 101.280 102.950 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.89103 96.10366 102.4429 99.76138 97.33149 99.11675 NA [2,] 93.67897 100.33634 108.1671 103.99862 99.64851 101.28325 NA $out [1] 86.16 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(90.49, 91.625, 92.785, 93.585, 95.11, 92.79, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wd461476190448.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,] 96.69000 95.4450 94.71375 [2,] 98.31583 98.3850 98.09812 [3,] 99.96333 99.8925 100.05875 [4,] 100.48417 100.5625 101.10438 [5,] 100.77667 101.4200 101.70500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 98.97434 98.89933 98.68758 [2,] 100.95232 100.88567 101.42992 $out [1] 93.88833 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(96.69, 98.3158333333333, 99.9633333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qg9l1476190448.ps tmp/1qg9l1476190448.png",intern=TRUE)) character(0) > try(system("convert tmp/2ef911476190448.ps tmp/2ef911476190448.png",intern=TRUE)) character(0) > try(system("convert tmp/3chsl1476190448.ps tmp/3chsl1476190448.png",intern=TRUE)) character(0) > try(system("convert tmp/49p5v1476190448.ps tmp/49p5v1476190448.png",intern=TRUE)) character(0) > try(system("convert tmp/5nrvb1476190448.ps tmp/5nrvb1476190448.png",intern=TRUE)) character(0) > try(system("convert tmp/6kue31476190448.ps tmp/6kue31476190448.png",intern=TRUE)) character(0) > try(system("convert tmp/7wd461476190448.ps tmp/7wd461476190448.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.465 0.162 2.676