R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 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(95.2,95.34,95.32,96.04,99.65,100.85,108.18,108.18,103.14,99.71,99.39,98.99,98.83,99.52,99.5,99.5,99.39,101.79,106.03,105.41,104.32,101.17,99.79,100.08,100.27,101.63,101.74,103.73,103.29,105.71,107.42,107.57,105.13,103.61,102.35,102.14,104.32,104.69,106.02,104.78,106.36,109.27,113.46,113.46,110.61,104.37,103.82,104.1) > 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] 48 > (np <- floor(n / par1)) [1] 4 > 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] 4 4 4 4 4 4 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 95.20 98.83 100.27 104.32 NA [2,] 95.34 99.52 101.63 104.69 NA [3,] 95.32 99.50 101.74 106.02 NA [4,] 96.04 99.50 103.73 104.78 NA [5,] 99.65 99.39 103.29 106.36 NA [6,] 100.85 101.79 105.71 109.27 NA [7,] 108.18 106.03 107.42 113.46 NA [8,] 108.18 105.41 107.57 113.46 NA [9,] 103.14 104.32 105.13 110.61 NA [10,] 99.71 101.17 103.61 104.37 NA [11,] 99.39 99.79 102.35 103.82 NA [12,] 98.99 100.08 102.14 104.10 NA > darr [,1] [,2] [,3] [,4] [,5] [1,] 0.14 0.69 1.36 0.37 NA [2,] -0.02 -0.02 0.11 1.33 NA [3,] 0.72 0.00 1.99 -1.24 NA [4,] 3.61 -0.11 -0.44 1.58 NA [5,] 1.20 2.40 2.42 2.91 NA [6,] 7.33 4.24 1.71 4.19 NA [7,] 0.00 -0.62 0.15 0.00 NA [8,] -5.04 -1.09 -2.44 -2.85 NA [9,] -3.43 -3.15 -1.52 -6.24 NA [10,] -0.32 -1.38 -1.26 -0.55 NA [11,] -0.40 0.29 -0.21 0.28 NA [12,] -0.16 0.19 2.18 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/1wj3r1489658107.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/2c23a1489658107.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/3j4rr1489658107.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/4fkcd1489658107.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,] 95.200 95.340 95.32 96.040 99.390 100.85 106.030 105.410 103.140 [2,] 97.015 97.430 97.41 97.770 99.520 101.32 106.725 106.490 103.730 [3,] 99.550 100.575 100.62 101.615 101.470 103.75 107.800 107.875 104.725 [4,] 102.295 103.160 103.88 104.255 104.825 107.49 110.820 110.820 107.870 [5,] 104.320 104.690 106.02 104.780 106.360 109.27 113.460 113.460 110.610 [,10] [,11] [,12] [1,] 99.71 99.390 98.990 [2,] 100.44 99.590 99.535 [3,] 102.39 101.070 101.110 [4,] 103.99 103.085 103.120 [5,] 104.37 103.820 104.100 $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 95.3788 96.0483 95.5087 96.49185 97.27905 98.8757 104.5650 104.4543 [2,] 103.7212 105.1017 105.7313 106.73815 105.66095 108.6243 111.0351 111.2957 [,9] [,10] [,11] [,12] [1,] 101.4544 99.5855 98.30895 98.27785 [2,] 107.9956 105.1945 103.83105 103.94215 $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(95.2, 97.015, 99.55, 102.295, 104.32, 95.34, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5u8iv1489658107.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.140 -0.020 -1.240 -0.440 1.200 1.710 -0.620 -5.040 -6.240 -1.380 -0.400 [2,] 0.255 -0.020 -0.620 -0.275 1.800 2.950 -0.310 -3.945 -4.835 -1.320 -0.305 [3,] 0.530 0.045 0.360 0.735 2.410 4.215 0.000 -2.645 -3.290 -0.905 0.035 [4,] 1.025 0.720 1.355 2.595 2.665 5.785 0.075 -1.765 -2.335 -0.435 0.285 [5,] 1.360 1.330 1.990 3.610 2.910 7.330 0.150 -1.090 -1.520 -0.320 0.290 [,12] [1,] -0.160 [2,] 0.015 [3,] 0.190 [4,] 1.185 [5,] 2.180 $n [1] 4 4 4 4 4 4 4 4 4 4 4 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -0.0783 -0.5396 -1.20025 -1.5323 1.72665 1.97535 -0.30415 -4.3672 -5.265 [2,] 1.1383 0.6296 1.92025 3.0023 3.09335 6.45465 0.30415 -0.9228 -1.315 [,10] [,11] [,12] [1,] -1.60415 -0.4311 -0.8772897 [2,] -0.20585 0.5011 1.2572897 $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(0.140000000000001, 0.255000000000003, 0.530000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6g4h01489658107.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] [1,] 95.200 98.830 100.27 103.820 NA [2,] 95.690 99.500 101.94 104.345 NA [3,] 99.520 99.935 103.45 105.400 NA [4,] 101.995 103.055 105.42 109.940 NA [5,] 108.180 106.030 107.57 113.460 NA $n [1] 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [1,] 96.64425 98.31354 101.8627 102.8481 NA [2,] 102.39575 101.55646 105.0373 107.9519 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(95.2, 95.69, 99.52, 101.995, 108.18, 98.83, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7x4yp1489658107.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,] 99.6550 99.5500 99.6025 [2,] 100.8287 100.8450 100.9181 [3,] 101.7550 101.5425 101.5675 [4,] 105.1025 104.2375 104.6700 [5,] 108.7725 107.8750 108.2862 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.80571 99.99516 99.85624 [2,] 103.70429 103.08984 103.27876 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(99.655, 100.82875, 101.755, 105.1025, 108.7725, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wj3r1489658107.ps tmp/1wj3r1489658107.png",intern=TRUE)) character(0) > try(system("convert tmp/2c23a1489658107.ps tmp/2c23a1489658107.png",intern=TRUE)) character(0) > try(system("convert tmp/3j4rr1489658107.ps tmp/3j4rr1489658107.png",intern=TRUE)) character(0) > try(system("convert tmp/4fkcd1489658107.ps tmp/4fkcd1489658107.png",intern=TRUE)) character(0) > try(system("convert tmp/5u8iv1489658107.ps tmp/5u8iv1489658107.png",intern=TRUE)) character(0) > try(system("convert tmp/6g4h01489658107.ps tmp/6g4h01489658107.png",intern=TRUE)) character(0) > try(system("convert tmp/7x4yp1489658107.ps tmp/7x4yp1489658107.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.989 0.269 3.331