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(92.3,97.1,117.61,104.42,101.88,117.54,105.34,96.77,116.43,113.33,110.76,100.95,105.91,110.2,125.05,108.98,119.11,113.7,107.45,97.48,110.56,108.74,107.71,101.05,104.0,110.56,120.88,106.09,109.18,111.06,106.16,98.24,103.53,113.3,107.86,95.34,103.23,103.12,113.77,111.83,112.12,108.57,114.31,93.22,112.42,119.31,109.95,103.21,109.16,108.58,114.71,116.04,110.69,113.46,113.98,93.73,118.97,117.69,104.42,101.11) > 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] 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,] 92.30 105.91 104.00 103.23 109.16 NA [2,] 97.10 110.20 110.56 103.12 108.58 NA [3,] 117.61 125.05 120.88 113.77 114.71 NA [4,] 104.42 108.98 106.09 111.83 116.04 NA [5,] 101.88 119.11 109.18 112.12 110.69 NA [6,] 117.54 113.70 111.06 108.57 113.46 NA [7,] 105.34 107.45 106.16 114.31 113.98 NA [8,] 96.77 97.48 98.24 93.22 93.73 NA [9,] 116.43 110.56 103.53 112.42 118.97 NA [10,] 113.33 108.74 113.30 119.31 117.69 NA [11,] 110.76 107.71 107.86 109.95 104.42 NA [12,] 100.95 101.05 95.34 103.21 101.11 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 4.80 4.29 6.56 -0.11 -0.58 NA [2,] 20.51 14.85 10.32 10.65 6.13 NA [3,] -13.19 -16.07 -14.79 -1.94 1.33 NA [4,] -2.54 10.13 3.09 0.29 -5.35 NA [5,] 15.66 -5.41 1.88 -3.55 2.77 NA [6,] -12.20 -6.25 -4.90 5.74 0.52 NA [7,] -8.57 -9.97 -7.92 -21.09 -20.25 NA [8,] 19.66 13.08 5.29 19.20 25.24 NA [9,] -3.10 -1.82 9.77 6.89 -1.28 NA [10,] -2.57 -1.03 -5.44 -9.36 -13.27 NA [11,] -9.81 -6.66 -12.52 -6.74 -3.31 NA [12,] 4.96 2.95 7.89 5.95 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/17k551444985680.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/20egx1444985680.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/3c8wv1444985680.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/4in7c1444985680.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,] 103.23 97.10 113.77 104.42 109.18 108.57 105.34 93.22 103.53 108.74 [2,] 103.23 103.12 114.71 106.09 109.18 111.06 106.16 93.73 110.56 113.30 [3,] 104.00 108.58 117.61 108.98 110.69 113.46 107.45 96.77 112.42 113.33 [4,] 105.91 110.20 120.88 111.83 112.12 113.70 113.98 97.48 116.43 117.69 [5,] 109.16 110.56 125.05 116.04 112.12 117.54 114.31 98.24 118.97 119.31 [,11] [,12] [1,] 104.42 100.95 [2,] 107.71 100.95 [3,] 107.86 101.05 [4,] 109.95 101.11 [5,] 110.76 101.11 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.1063 103.5773 113.2503 104.9241 108.6126 111.5946 101.9244 94.12026 [2,] 105.8937 113.5827 121.9697 113.0359 112.7674 115.3254 112.9756 99.41974 [,9] [,10] [,11] [,12] [1,] 108.2723 110.228 106.2772 100.9369 [2,] 116.5677 116.432 109.4428 101.1631 $out [1] 92.30 101.88 119.11 95.34 103.21 $group [1] 1 5 5 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(103.23, 103.23, 104, 105.91, 109.16, 97.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/559pk1444985680.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.58 6.13 -16.07 -5.35 -5.41 -12.20 -21.09 5.29 -3.10 -13.27 -12.52 [2,] -0.11 10.32 -14.79 -2.54 -3.55 -6.25 -20.25 13.08 -1.82 -9.36 -9.81 [3,] 4.29 10.65 -13.19 0.29 1.88 -4.90 -9.97 19.20 -1.28 -5.44 -6.74 [4,] 4.80 14.85 -1.94 3.09 2.77 0.52 -8.57 19.66 6.89 -2.57 -6.66 [5,] 6.56 20.51 1.33 10.13 2.77 5.74 -7.92 25.24 9.77 -1.03 -3.31 [,12] [1,] 2.950 [2,] 3.955 [3,] 5.455 [4,] 6.920 [5,] 7.890 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.8206064 7.449113 -22.269778 -3.688144 -2.585696 -9.6836649 -18.223059 [2,] 7.7593936 13.850887 -4.110222 4.268144 6.345696 -0.1163351 -1.716941 [,8] [,9] [,10] [,11] [,12] [1,] 14.55059 -7.434464 -10.2377969 -8.965782 3.11265 [2,] 23.84941 4.874464 -0.6422031 -4.514218 7.79735 $out [1] 15.66 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.579999999999998, -0.109999999999999, 4.29000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jbhd1444985680.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,] 92.300 101.05 95.340 93.220 93.730 NA [2,] 99.025 106.68 103.765 103.220 106.500 NA [3,] 104.880 108.86 107.010 110.890 112.075 NA [4,] 114.880 112.13 110.810 113.095 115.375 NA [5,] 117.610 119.11 120.880 119.310 118.970 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 97.64843 106.3742 103.7967 106.3859 108.0271 NA [2,] 112.11157 111.3458 110.2233 115.3941 116.1229 NA $out [1] 125.05 97.48 $group [1] 2 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.3, 99.025, 104.88, 114.88, 117.61, 101.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7fgeu1444985680.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,] 95.888 96.770 95.6050 [2,] 104.416 105.725 105.6150 [3,] 109.460 108.780 109.5150 [4,] 112.624 112.875 112.9375 [5,] 118.404 117.610 117.7950 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 105.7163 105.5188 106.1752 [2,] 113.2037 112.0412 112.8548 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(95.888, 104.416, 109.46, 112.624, 118.404, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17k551444985680.ps tmp/17k551444985680.png",intern=TRUE)) character(0) > try(system("convert tmp/20egx1444985680.ps tmp/20egx1444985680.png",intern=TRUE)) character(0) > try(system("convert tmp/3c8wv1444985680.ps tmp/3c8wv1444985680.png",intern=TRUE)) character(0) > try(system("convert tmp/4in7c1444985680.ps tmp/4in7c1444985680.png",intern=TRUE)) character(0) > try(system("convert tmp/559pk1444985680.ps tmp/559pk1444985680.png",intern=TRUE)) character(0) > try(system("convert tmp/6jbhd1444985680.ps tmp/6jbhd1444985680.png",intern=TRUE)) character(0) > try(system("convert tmp/7fgeu1444985680.ps tmp/7fgeu1444985680.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.392 0.399 2.820