R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" 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(98.72,98.67,98.82,99.39,99.33,99.22,99.05,98.83,98.84,98.89,98.8,99.4,98.89,98.85,98.69,98.48,98.39,98.35,98.26,98.06,98.14,98.17,98.41,98.64,99.25,99.61,100.28,100.31,100.55,100.45,100.78,100.68,101.69,98.09,99.13,99.18,96.22,96.11,96,95.96,97.95,98.43,98.32,97.45,96.42,95.36,95.1,95.54,94.07,93.48,92.86,90.98,91.45,91.16,90.71,90.31,89.78,91.02,90.77,90.69) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 98.72 98.89 99.25 96.22 94.07 NA [2,] 98.67 98.85 99.61 96.11 93.48 NA [3,] 98.82 98.69 100.28 96.00 92.86 NA [4,] 99.39 98.48 100.31 95.96 90.98 NA [5,] 99.33 98.39 100.55 97.95 91.45 NA [6,] 99.22 98.35 100.45 98.43 91.16 NA [7,] 99.05 98.26 100.78 98.32 90.71 NA [8,] 98.83 98.06 100.68 97.45 90.31 NA [9,] 98.84 98.14 101.69 96.42 89.78 NA [10,] 98.89 98.17 98.09 95.36 91.02 NA [11,] 98.80 98.41 99.13 95.10 90.77 NA [12,] 99.40 98.64 99.18 95.54 90.69 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.05 -0.04 0.36 -0.11 -0.59 NA [2,] 0.15 -0.16 0.67 -0.11 -0.62 NA [3,] 0.57 -0.21 0.03 -0.04 -1.88 NA [4,] -0.06 -0.09 0.24 1.99 0.47 NA [5,] -0.11 -0.04 -0.10 0.48 -0.29 NA [6,] -0.17 -0.09 0.33 -0.11 -0.45 NA [7,] -0.22 -0.20 -0.10 -0.87 -0.40 NA [8,] 0.01 0.08 1.01 -1.03 -0.53 NA [9,] 0.05 0.03 -3.60 -1.06 1.24 NA [10,] -0.09 0.24 1.04 -0.26 -0.25 NA [11,] 0.60 0.23 0.05 0.44 -0.08 NA [12,] -0.51 0.61 -2.96 -1.47 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/1lmx31457180555.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/2q8r11457180555.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/3xkhf1457180555.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/4gzb71457180555.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] [,11] [1,] 94.07 93.48 92.86 90.98 97.95 98.35 98.26 97.45 96.42 95.36 90.77 [2,] 96.22 96.11 96.00 95.96 97.95 98.35 98.26 97.45 96.42 95.36 95.10 [3,] 98.72 98.67 98.69 98.48 98.39 98.43 98.32 98.06 98.14 98.09 98.41 [4,] 98.89 98.85 98.82 99.39 99.33 99.22 99.05 98.83 98.84 98.17 98.80 [5,] 99.25 99.61 100.28 100.31 100.55 100.45 99.05 100.68 101.69 98.89 99.13 [,12] [1,] 90.69 [2,] 95.54 [3,] 98.64 [4,] 99.18 [5,] 99.40 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.83338 96.73392 96.6974 96.05637 97.4149 97.81526 97.76179 97.0849 [2,] 100.60662 100.60608 100.6826 100.90363 99.3651 99.04474 98.87821 99.0351 [,9] [,10] [,11] [,12] [1,] 96.43003 96.10446 95.79559 96.06799 [2,] 99.84997 100.07554 101.02441 101.21201 $out [1] 91.45 91.16 100.78 90.71 90.31 89.78 91.02 $group [1] 5 6 7 7 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.07, 96.22, 98.72, 98.89, 99.25, 93.48, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5efdp1457180555.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] [,12] [1,] -0.11 -0.62 -0.21 -0.09 -0.11 -0.17 -0.40 -1.03 -1.06 -0.26 -0.08 -2.960 [2,] -0.11 -0.16 -0.21 -0.06 -0.11 -0.17 -0.40 -0.53 -1.06 -0.25 0.05 -2.215 [3,] -0.05 -0.11 -0.04 0.24 -0.10 -0.11 -0.22 0.01 0.03 -0.09 0.23 -0.990 [4,] -0.04 0.15 0.03 0.47 -0.04 -0.09 -0.20 0.08 0.05 0.24 0.44 0.050 [5,] -0.04 0.15 0.03 0.47 -0.04 -0.09 -0.10 0.08 1.24 0.24 0.60 0.610 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.0994618237 -0.3290452 -0.2095834 -0.1344967 -0.14946182 -0.1665278 [2,] -0.0005381763 0.1090452 0.1295834 0.6144967 -0.05053818 -0.0534722 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.3613195 -0.4210245 -0.7543232 -0.4362328 -0.04557302 -2.77935 [2,] -0.0786805 0.4410245 0.8143232 0.2562328 0.50557302 0.79935 $out [1] 0.36 -0.59 0.67 0.57 -1.88 1.99 0.48 -0.29 0.33 -0.45 -0.87 1.01 [13] -3.60 1.04 $group [1] 1 1 2 3 3 4 5 5 6 6 7 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.109999999999999, -0.109999999999999, -0.0499999999999972, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6k7451457180555.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] [1,] 98.670 98.060 98.090 95.100 89.780 NA [2,] 98.810 98.215 99.215 95.750 90.700 NA [3,] 98.865 98.400 100.295 96.165 91.000 NA [4,] 99.275 98.665 100.615 97.700 92.155 NA [5,] 99.400 98.890 101.690 98.430 94.070 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 98.65291 98.19475 99.65645 95.27559 90.33636 NA [2,] 99.07709 98.60525 100.93355 97.05441 91.66364 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(98.67, 98.81, 98.865, 99.275, 99.4, 98.06, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7tle91457180555.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.306 98.060 96.7650 [2,] 96.832 98.230 97.3850 [3,] 97.198 98.420 97.5925 [4,] 97.427 98.655 98.3900 [5,] 97.534 98.720 98.7850 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 96.92662 98.22615 97.13411 [2,] 97.46938 98.61385 98.05089 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(96.306, 96.832, 97.198, 97.427, 97.534, 98.06, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lmx31457180555.ps tmp/1lmx31457180555.png",intern=TRUE)) character(0) > try(system("convert tmp/2q8r11457180555.ps tmp/2q8r11457180555.png",intern=TRUE)) character(0) > try(system("convert tmp/3xkhf1457180555.ps tmp/3xkhf1457180555.png",intern=TRUE)) character(0) > try(system("convert tmp/4gzb71457180555.ps tmp/4gzb71457180555.png",intern=TRUE)) character(0) > try(system("convert tmp/5efdp1457180555.ps tmp/5efdp1457180555.png",intern=TRUE)) character(0) > try(system("convert tmp/6k7451457180555.ps tmp/6k7451457180555.png",intern=TRUE)) character(0) > try(system("convert tmp/7tle91457180555.ps tmp/7tle91457180555.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.372 0.402 2.793