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(85,93.96,87.38,85.78,88.17,90.32,90.63,89.19,88.49,88.03,85.96,81.14,90.38,92.65,94.01,87.48,88.74,91.83,91.35,90.49,90.77,90.37,92.77,92.3,94.46,99.2,99.21,94.09,96.74,101.26,100.79,100.96,97.54,97.46,98.07,98.73,96.94,100.44,106.19,94.62,98.18,103.34,100.48,100.38,98.61,98.15,100.64,102.04,102.89,102.14,104.81,103.3,102.55,102.04,100.82,101.02,102.69,103.41,102.31,102.8,102.57,104.28,96.59,102.03,102.33,102.05,100.86,102.05,101.94,101.7,102.56,102.27) > 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,] 85.00 90.38 94.46 96.94 102.89 102.57 NA [2,] 93.96 92.65 99.20 100.44 102.14 104.28 NA [3,] 87.38 94.01 99.21 106.19 104.81 96.59 NA [4,] 85.78 87.48 94.09 94.62 103.30 102.03 NA [5,] 88.17 88.74 96.74 98.18 102.55 102.33 NA [6,] 90.32 91.83 101.26 103.34 102.04 102.05 NA [7,] 90.63 91.35 100.79 100.48 100.82 100.86 NA [8,] 89.19 90.49 100.96 100.38 101.02 102.05 NA [9,] 88.49 90.77 97.54 98.61 102.69 101.94 NA [10,] 88.03 90.37 97.46 98.15 103.41 101.70 NA [11,] 85.96 92.77 98.07 100.64 102.31 102.56 NA [12,] 81.14 92.30 98.73 102.04 102.80 102.27 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 8.96 2.27 4.74 3.50 -0.75 1.71 NA [2,] -6.58 1.36 0.01 5.75 2.67 -7.69 NA [3,] -1.60 -6.53 -5.12 -11.57 -1.51 5.44 NA [4,] 2.39 1.26 2.65 3.56 -0.75 0.30 NA [5,] 2.15 3.09 4.52 5.16 -0.51 -0.28 NA [6,] 0.31 -0.48 -0.47 -2.86 -1.22 -1.19 NA [7,] -1.44 -0.86 0.17 -0.10 0.20 1.19 NA [8,] -0.70 0.28 -3.42 -1.77 1.67 -0.11 NA [9,] -0.46 -0.40 -0.08 -0.46 0.72 -0.24 NA [10,] -2.07 2.40 0.61 2.49 -1.10 0.86 NA [11,] -4.82 -0.47 0.66 1.40 0.49 -0.29 NA [12,] 9.24 2.16 -1.79 0.85 -0.23 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/1wve81476383218.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/2zhcs1476383218.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/3661a1476383218.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/4qayu1476383218.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,] 85.00 92.65 87.38 85.780 88.17 90.32 90.630 89.19 88.490 88.030 [2,] 90.38 93.96 94.01 87.480 88.74 91.83 91.350 90.49 90.770 90.370 [3,] 95.70 99.82 97.90 94.355 97.46 101.65 100.635 100.67 98.075 97.805 [4,] 102.57 102.14 104.81 102.030 102.33 102.05 100.820 101.02 101.940 101.700 [5,] 102.89 104.28 106.19 103.300 102.55 103.34 100.860 102.05 102.690 103.410 [,11] [,12] [1,] 85.960 81.140 [2,] 92.770 92.300 [3,] 99.355 100.385 [4,] 102.310 102.270 [5,] 102.560 102.800 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 87.83706 94.54364 90.93365 84.96978 88.69401 95.05777 94.52654 [2,] 103.56294 105.09636 104.86635 103.74022 106.22599 108.24223 106.74346 [,8] [,9] [,10] [,11] [,12] [1,] 93.87781 90.86999 90.49678 93.20139 93.95403 [2,] 107.46219 105.28001 105.11322 105.50861 106.81597 $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(85, 90.38, 95.7, 102.57, 102.89, 92.65, 93.96, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52jgf1476383218.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.750 -7.690 -11.57 -0.750 -0.51 -1.220 -1.440 -3.420 -0.46 -2.070 -0.47 [2,] 1.710 -6.580 -6.53 0.300 -0.28 -1.220 -0.860 -1.770 -0.46 -1.100 -0.47 [3,] 2.885 0.685 -3.36 1.825 2.62 -0.835 0.035 -0.405 -0.32 0.735 0.10 [4,] 4.740 2.670 -1.51 2.650 4.52 -0.470 0.200 0.280 -0.08 2.400 0.66 [5,] 8.960 5.750 5.44 3.560 5.16 0.310 1.190 1.670 -0.08 2.490 1.40 [,12] [1,] -1.79 [2,] -0.23 [3,] 0.85 [4,] 2.16 [5,] 2.16 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.9305521 -5.281549 -6.5980621 0.3091741 -0.476155 -1.3187742 -0.6487342 [2,] 4.8394479 6.651549 -0.1219379 3.3408259 5.716155 -0.3512258 0.7187342 [,8] [,9] [,10] [,11] [,12] [1,] -1.7273162 -0.56511227 -1.522613 -0.6288865 -0.838768 [2,] 0.9173162 -0.07488773 2.992613 0.8288865 2.538768 $out [1] -2.86 0.72 -4.82 9.24 $group [1] 6 9 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.75, 1.71000000000001, 2.88500000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rz5u1476383218.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,] 81.140 87.480 94.09 94.620 100.820 101.700 NA [2,] 85.870 90.375 97.10 98.165 102.090 101.820 NA [3,] 88.100 91.060 98.40 100.410 102.620 102.050 NA [4,] 89.755 92.475 100.00 101.340 103.095 102.445 NA [5,] 93.960 94.010 101.26 103.340 103.410 102.570 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 86.32803 90.10218 97.07729 98.96186 102.1616 101.7649 NA [2,] 89.87197 92.01782 99.72271 101.85814 103.0784 102.3351 NA $out [1] 106.19 104.81 104.28 96.59 100.86 $group [1] 4 5 6 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(81.14, 85.87, 88.1, 89.755, 93.96, 87.48, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7dqt41476383218.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,] 94.55000 94.3550 94.65500 [2,] 96.31917 97.6325 96.37937 [3,] 96.86250 98.7150 97.10312 [4,] 97.76000 100.5100 98.08875 [5,] 98.77833 101.6500 99.03250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 96.20533 97.40255 96.32347 [2,] 97.51967 100.02745 97.88278 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(94.55, 96.3191666666667, 96.8625, 97.76, 98.7783333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wve81476383218.ps tmp/1wve81476383218.png",intern=TRUE)) character(0) > try(system("convert tmp/2zhcs1476383218.ps tmp/2zhcs1476383218.png",intern=TRUE)) character(0) > try(system("convert tmp/3661a1476383218.ps tmp/3661a1476383218.png",intern=TRUE)) character(0) > try(system("convert tmp/4qayu1476383218.ps tmp/4qayu1476383218.png",intern=TRUE)) character(0) > try(system("convert tmp/52jgf1476383218.ps tmp/52jgf1476383218.png",intern=TRUE)) character(0) > try(system("convert tmp/6rz5u1476383218.ps tmp/6rz5u1476383218.png",intern=TRUE)) character(0) > try(system("convert tmp/7dqt41476383218.ps tmp/7dqt41476383218.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.475 0.196 2.717