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(98.71,100.46,100.46,100.67,100.01,100.01,99.99,99.98,99.87,99.91,96.59,96.99,96.68,96.57,96.55,96.78,95.99,97.54,97.45,97.58,97.66,97.67,97.71,98.52,98.87,97.91,97.92,97.97,97.97,97.97,97.58,97.57,96.7,96.72,96.72,96.74,101.2,100.59,100.58,99.62,99.63,99.17,99.17,98.99,98.92,99.52,99.45,99.04,99.23,98.71,98.73,97.1,100.94,100.93,101.02,101.01,100.86,100.56,100.75,100.15,99.49,99.15,99.15,99.14,98.77,98.8,99.29,98.38,98.31,98.24,96.99,96.81) > 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] 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,] 98.71 96.68 98.87 101.20 99.23 99.49 NA [2,] 100.46 96.57 97.91 100.59 98.71 99.15 NA [3,] 100.46 96.55 97.92 100.58 98.73 99.15 NA [4,] 100.67 96.78 97.97 99.62 97.10 99.14 NA [5,] 100.01 95.99 97.97 99.63 100.94 98.77 NA [6,] 100.01 97.54 97.97 99.17 100.93 98.80 NA [7,] 99.99 97.45 97.58 99.17 101.02 99.29 NA [8,] 99.98 97.58 97.57 98.99 101.01 98.38 NA [9,] 99.87 97.66 96.70 98.92 100.86 98.31 NA [10,] 99.91 97.67 96.72 99.52 100.56 98.24 NA [11,] 96.59 97.71 96.72 99.45 100.75 96.99 NA [12,] 96.99 98.52 96.74 99.04 100.15 96.81 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.75 -0.11 -0.96 -0.61 -0.52 -0.34 NA [2,] 0.00 -0.02 0.01 -0.01 0.02 0.00 NA [3,] 0.21 0.23 0.05 -0.96 -1.63 -0.01 NA [4,] -0.66 -0.79 0.00 0.01 3.84 -0.37 NA [5,] 0.00 1.55 0.00 -0.46 -0.01 0.03 NA [6,] -0.02 -0.09 -0.39 0.00 0.09 0.49 NA [7,] -0.01 0.13 -0.01 -0.18 -0.01 -0.91 NA [8,] -0.11 0.08 -0.87 -0.07 -0.15 -0.07 NA [9,] 0.04 0.01 0.02 0.60 -0.30 -0.07 NA [10,] -3.32 0.04 0.00 -0.07 0.19 -1.25 NA [11,] 0.40 0.81 0.02 -0.41 -0.60 -0.18 NA [12,] -0.31 0.35 4.46 0.19 -0.66 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/1yswv1444919846.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/245x41444919846.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/3j0os1444919846.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/4ls9e1444919846.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,] 98.71 96.57 96.55 96.780 95.99 97.540 97.45 97.570 96.700 96.72 [2,] 98.71 97.91 97.92 97.100 97.97 97.970 97.58 97.580 97.660 97.67 [3,] 99.05 98.93 98.94 98.555 99.20 98.985 99.23 98.685 98.615 98.88 [4,] 99.49 100.46 100.46 99.620 100.01 100.010 99.99 99.980 99.870 99.91 [5,] 99.49 100.59 100.58 100.670 100.94 100.930 101.02 101.010 100.860 100.56 [,11] [,12] [1,] 96.59 96.740 [2,] 96.72 96.810 [3,] 97.35 97.755 [4,] 99.45 99.040 [5,] 100.75 100.150 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.54687 97.28517 97.30162 96.92952 97.88413 97.66913 97.67547 [2,] 99.55313 100.57483 100.57838 100.18048 100.51587 100.30087 100.78453 [,8] [,9] [,10] [,11] [,12] [1,] 97.13692 97.18948 97.43513 95.58906 96.31658 [2,] 100.23308 100.04052 100.32487 99.11094 99.19342 $out [1] 96.68 101.20 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.71, 98.71, 99.05, 99.49, 99.49, 96.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5w5pk1444919846.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.96 -0.02 -1.63 -0.790 -0.01 -0.09 -0.18 -0.15 -0.070 -1.250 -0.60 -0.66 [2,] -0.61 -0.01 -0.96 -0.660 -0.01 -0.09 -0.18 -0.15 -0.070 -1.250 -0.41 -0.31 [3,] -0.43 0.00 0.02 -0.185 0.00 -0.01 -0.01 -0.09 0.015 -0.035 -0.08 0.19 [4,] -0.11 0.01 0.21 0.010 0.03 0.09 -0.01 -0.07 0.040 0.040 0.40 0.35 [5,] -0.11 0.02 0.23 0.010 0.03 0.09 0.13 -0.07 0.040 0.190 0.81 0.35 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.7525161 -0.01290065 -0.7346878 -0.6171716 -0.02580129 -0.1261058 [2,] -0.1074839 0.01290065 0.7746878 0.2471716 0.02580129 0.1061058 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.11965549 -0.14160258 -0.05595355 -0.8670917 -0.6024762 -0.2763543 [2,] 0.09965549 -0.03839742 0.08595355 0.7970917 0.4424762 0.6563543 $out [1] 1.75 3.84 1.55 -0.46 -0.39 0.49 -0.91 0.08 -0.87 0.60 -0.30 -3.32 [13] 4.46 $group [1] 1 4 5 5 6 6 7 8 8 9 9 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.960000000000008, -0.609999999999999, -0.43, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62yop1444919846.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,] 98.710 95.990 96.700 98.920 97.100 96.990 NA [2,] 99.290 96.625 96.730 99.105 98.980 98.275 NA [3,] 99.985 97.495 97.745 99.485 100.655 98.785 NA [4,] 100.235 97.665 97.970 100.105 100.935 99.150 NA [5,] 100.670 98.520 98.870 101.200 101.020 99.490 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 99.55398 97.02065 97.17943 99.02889 99.76331 98.38591 NA [2,] 100.41602 97.96935 98.31057 99.94111 101.54669 99.18409 NA $out [1] 96.59 96.99 96.81 $group [1] 1 1 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(98.71, 99.29, 99.985, 100.235, 100.67, 95.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/70nul1444919846.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,] 98.54667 98.5550 97.88250 [2,] 98.63333 98.5850 98.56813 [3,] 98.89167 98.9050 98.85438 [4,] 98.97417 99.0175 99.06500 [5,] 99.08333 99.2300 99.12750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 98.73621 98.70773 98.62775 [2,] 99.04712 99.10227 99.08100 $out [1] 98.03500 98.04167 97.35000 97.75500 $group [1] 1 1 2 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(98.5466666666667, 98.6333333333333, 98.8916666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yswv1444919846.ps tmp/1yswv1444919846.png",intern=TRUE)) character(0) > try(system("convert tmp/245x41444919846.ps tmp/245x41444919846.png",intern=TRUE)) character(0) > try(system("convert tmp/3j0os1444919846.ps tmp/3j0os1444919846.png",intern=TRUE)) character(0) > try(system("convert tmp/4ls9e1444919846.ps tmp/4ls9e1444919846.png",intern=TRUE)) character(0) > try(system("convert tmp/5w5pk1444919846.ps tmp/5w5pk1444919846.png",intern=TRUE)) character(0) > try(system("convert tmp/62yop1444919846.ps tmp/62yop1444919846.png",intern=TRUE)) character(0) > try(system("convert tmp/70nul1444919846.ps tmp/70nul1444919846.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.845 0.498 3.370