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(89.56,89.84,89.97,90.65,91.17,91.35,91.41,91.55,91.63,91.54,91.74,91.87,92.13,92.14,92.05,92,92.51,92.67,92.68,92.77,92.85,92.71,92.73,92.28,92.49,92.46,92.55,92.24,92.41,92.83,92.85,93.04,93.04,92.83,92.96,92.83,93.01,93.21,93.58,94.07,94.57,95.03,95.21,95.89,96.43,96.35,96.71,96.32,97.23,97.88,98.2,98.56,99.31,99.69,99.77,101.06,101.77,101.91,102.52,102.09,102.22,102.74,103.56,104.4,104.76,104.86,104.84,104.96,104.83,104.58,104.8,104.17) > 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,] 89.56 92.13 92.49 93.01 97.23 102.22 NA [2,] 89.84 92.14 92.46 93.21 97.88 102.74 NA [3,] 89.97 92.05 92.55 93.58 98.20 103.56 NA [4,] 90.65 92.00 92.24 94.07 98.56 104.40 NA [5,] 91.17 92.51 92.41 94.57 99.31 104.76 NA [6,] 91.35 92.67 92.83 95.03 99.69 104.86 NA [7,] 91.41 92.68 92.85 95.21 99.77 104.84 NA [8,] 91.55 92.77 93.04 95.89 101.06 104.96 NA [9,] 91.63 92.85 93.04 96.43 101.77 104.83 NA [10,] 91.54 92.71 92.83 96.35 101.91 104.58 NA [11,] 91.74 92.73 92.96 96.71 102.52 104.80 NA [12,] 91.87 92.28 92.83 96.32 102.09 104.17 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.28 0.01 -0.03 0.20 0.65 0.52 NA [2,] 0.13 -0.09 0.09 0.37 0.32 0.82 NA [3,] 0.68 -0.05 -0.31 0.49 0.36 0.84 NA [4,] 0.52 0.51 0.17 0.50 0.75 0.36 NA [5,] 0.18 0.16 0.42 0.46 0.38 0.10 NA [6,] 0.06 0.01 0.02 0.18 0.08 -0.02 NA [7,] 0.14 0.09 0.19 0.68 1.29 0.12 NA [8,] 0.08 0.08 0.00 0.54 0.71 -0.13 NA [9,] -0.09 -0.14 -0.21 -0.08 0.14 -0.25 NA [10,] 0.20 0.02 0.13 0.36 0.61 0.22 NA [11,] 0.13 -0.45 -0.13 -0.39 -0.43 -0.63 NA [12,] 0.26 0.21 0.18 0.91 0.13 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/1vkeq1444997878.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/2ogyc1444997878.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/33l2z1444997878.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/4atbu1444997878.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,] 89.56 89.840 89.970 90.650 91.17 91.35 91.41 91.550 91.630 91.54 [2,] 92.13 92.140 92.050 92.000 92.41 92.67 92.68 92.770 92.850 92.71 [3,] 92.75 92.835 93.065 93.155 93.54 93.93 94.03 94.465 94.735 94.59 [4,] 97.23 97.880 98.200 98.560 99.31 99.69 99.77 101.060 101.770 101.91 [5,] 102.22 102.740 103.560 104.400 104.76 104.86 104.84 104.960 104.830 104.58 [,11] [,12] [1,] 91.740 91.870 [2,] 92.730 92.280 [3,] 94.835 94.575 [4,] 102.520 102.090 [5,] 104.800 104.170 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 89.46034 89.13251 89.09805 88.92359 89.08928 89.40187 89.45672 89.11768 [2,] 96.03966 96.53749 97.03195 97.38641 97.99072 98.45813 98.60328 99.81232 [,9] [,10] [,11] [,12] [1,] 88.98131 88.6557 88.52013 88.24723 [2,] 100.48869 100.5243 101.14987 100.90277 $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(89.56, 92.13, 92.75, 97.23, 102.22, 89.84, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53r031444997878.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.03 -0.090 -0.310 0.170 0.10 -0.02 0.090 -0.13 -0.250 0.02 -0.63 0.13 [2,] 0.01 0.090 -0.050 0.360 0.16 0.01 0.120 0.00 -0.210 0.13 -0.45 0.18 [3,] 0.24 0.225 0.425 0.505 0.28 0.04 0.165 0.08 -0.115 0.21 -0.41 0.21 [4,] 0.52 0.370 0.680 0.520 0.42 0.08 0.680 0.54 -0.080 0.36 -0.13 0.26 [5,] 0.65 0.370 0.840 0.750 0.46 0.18 1.290 0.71 -0.080 0.61 0.13 0.26 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.08896647 0.04439096 -0.04587358 0.4017948 0.1122916 -0.005152261 [2,] 0.56896647 0.40560904 0.89587358 0.6082052 0.4477084 0.085152261 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.1962181 -0.2683174 -0.1988542 0.06164257 -0.6164103 0.1534722 [2,] 0.5262181 0.4283174 -0.0311458 0.35835743 -0.2035897 0.2665278 $out [1] 0.82 0.14 0.91 $group [1] 2 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0300000000000011, 0.0100000000000051, 0.239999999999995, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6diru1444997878.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,] 89.56 92.000 92.240 93.010 97.23 102.740 NA [2,] 90.31 92.135 92.475 93.825 98.38 103.865 NA [3,] 91.38 92.590 92.830 95.120 99.73 104.670 NA [4,] 91.59 92.720 92.905 96.335 101.84 104.835 NA [5,] 91.87 92.850 93.040 96.710 102.52 104.960 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.79618 92.32318 92.63387 93.97517 98.15187 104.2276 NA [2,] 91.96382 92.85682 93.02613 96.26483 101.30813 105.1124 NA $out [1] 102.22 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(89.56, 90.31, 91.38, 91.59, 91.87, 92, 92.135, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qe421444997878.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.44000 92.7500 94.19750 [2,] 95.15250 93.1100 94.67937 [3,] 96.09917 93.9800 95.64687 [4,] 96.62333 94.5825 96.58125 [5,] 96.91000 94.8350 96.92750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 95.42831 93.30838 94.77942 [2,] 96.77002 94.65162 96.51433 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(94.44, 95.1525, 96.0991666666667, 96.6233333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vkeq1444997878.ps tmp/1vkeq1444997878.png",intern=TRUE)) character(0) > try(system("convert tmp/2ogyc1444997878.ps tmp/2ogyc1444997878.png",intern=TRUE)) character(0) > try(system("convert tmp/33l2z1444997878.ps tmp/33l2z1444997878.png",intern=TRUE)) character(0) > try(system("convert tmp/4atbu1444997878.ps tmp/4atbu1444997878.png",intern=TRUE)) character(0) > try(system("convert tmp/53r031444997878.ps tmp/53r031444997878.png",intern=TRUE)) character(0) > try(system("convert tmp/6diru1444997878.ps tmp/6diru1444997878.png",intern=TRUE)) character(0) > try(system("convert tmp/7qe421444997878.ps tmp/7qe421444997878.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.439 0.496 2.965